Jump to content

[BUG] Module "blocklayered" shows products with attributes which have stock quantity = 0 (PS1.4.5.1)


Recommended Posts

Hello everyone,

 

I use PS 1.4.5.1 and have an issue with the blocklayered module: When I filter product attributes (e. g. t-shirt sizes like S, M, L, XL etc.), the layered navigation shows products with attributes that aren't available (attribute stock quantity = 0). I guess a workaround would be to delete all product attributes with stock quantity = 0 manually, but that could be a painstaking task in some cases.

 

Two further bugs also concern the blocklayered module:

  • The price range slider doesn't appear in Internet Explorer 9 (but does in all other browsers)
  • The title of the "price range" segment isn't really translatable. Sure, there's a label for it in the backend, but when I enter a translation (range = "Preisspanne" in German), the translation doesn't appear on the frontend. I guess this could be caused by a missing mod='blocklayered' in blocklayered.tpl on line 98?

Is anyone else experiencing these problems? Or does somebody know a fix, especially for the attributes problem?

 

 

 

 

Thanks for your help!

Tom

Link to comment
Share on other sites

  • 10 months later...

Hi,

i solved your problem with quantity adding " pa.quantity>0 and " string

in blocklayered.php at above 2254 line

exactly into this case:

 

case 'id_attribute_group':

$sub_queries = array();

 

 

foreach ($filter_values as $filter_value)

{

$filter_value_array = explode('_', $filter_value);

if (!isset($sub_queries[$filter_value_array[0]]))

$sub_queries[$filter_value_array[0]] = array();

$sub_queries[$filter_value_array[0]][] = 'pac.`id_attribute` = '.(int)$filter_value_array[1];

}

foreach ($sub_queries as $sub_query)

{

$query_filters_where .= ' AND p.id_product IN (SELECT pa.`id_product`

FROM `'._DB_PREFIX_.'product_attribute_combination` pac

LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa

ON (pa.`id_product_attribute` = pac.`id_product_attribute`) WHERE pa.quantity>0 and ';

$query_filters_where .= implode(' OR ', $sub_query).') ';

}

break;

Link to comment
Share on other sites

  • 6 months later...
  • 6 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...