Jump to content

Edit History

Kamil

Kamil

On 7/6/2017 at 3:38 PM, infisual said:

I had the same problem when I had 1.6x and it is also in 1.7.1.2

you will need to add the following line 

JOIN `'._DB_PREFIX_.'stock_available` sa
ON (sa.`id_product_attribute`=pac.`id_product_attribute` AND sa.`quantity`>0)

 

so the complete line will like this:

    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`)'.
         Shop::addSqlAssociation('product_attribute', 'pa').'
         JOIN `'._DB_PREFIX_.'stock_available` sa
         ON (sa.`id_product_attribute`=pac.`id_product_attribute` AND sa.`quantity`>0)
         WHERE '.implode(' OR ', $sub_query).') ';
     }

 

good luck

 

Thanks for help!

Best regards

Kamil

Kamil

On 7/6/2017 at 3:38 PM, infisual said:

I had the same problem when I had 1.6x and it is also in 1.7.1.2

you will need to add the following line 

JOIN `'._DB_PREFIX_.'stock_available` sa
ON (sa.`id_product_attribute`=pac.`id_product_attribute` AND sa.`quantity`>0)

 

so the complete line will like this:

    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`)'.
         Shop::addSqlAssociation('product_attribute', 'pa').'
         JOIN `'._DB_PREFIX_.'stock_available` sa
         ON (sa.`id_product_attribute`=pac.`id_product_attribute` AND sa.`quantity`>0)
         WHERE '.implode(' OR ', $sub_query).') ';
     }

 

good luck

Hi,

I made this step. but it still doesn't work.

I have Presta 1.6.1.18, modify blocklayered but nothing change. For Example: I have shoes with size combinations 24, 25 and 26. When I change one of them to 0, for example 25. I need that  the shoe with combination 25 don't apear on list, when i choose in filter size 25.

Someone can help?

Best regards

×
×
  • Create New...