Jump to content

vparadiso

Members
  • Posts

    1
  • Joined

  • Last visited

Profile Information

  • First Name
    Valerio
  • Last Name
    Paradiso

Recent Profile Visitors

61 profile views

vparadiso's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi, I use ps 1.6.1.12 and I have a problem with the stock available for each attribute of products. For example, I have defined an attribute "shoes size" with value (34, 34.5, 35....). After I have inserted some shoes. All shoes have with combinations all value of shoes attribute, but only a few of them have quantity > 0. When I go to frontend I see all values of shoes size. The number in bracket is the count of product combinations and not the product that they have quantity > 0. For example, no product has a combination 34 but it looks the same with the total product counter. I see that the problem is in blocklayered.php in line 2219 in this query: $sql_query['select'] = ' SELECT COUNT(DISTINCT lpa.id_product) nbr, lpa.id_attribute_group, a.color, al.name attribute_name, agl.public_name attribute_group_name , lpa.id_attribute, ag.is_color_group, liagl.url_name name_url_name, liagl.meta_title name_meta_title, lial.url_name value_url_name, lial.meta_title value_meta_title'; $sql_query['from'] = ' FROM '._DB_PREFIX_.'layered_product_attribute lpa INNER JOIN '._DB_PREFIX_.'attribute a ON a.id_attribute = lpa.id_attribute INNER JOIN '._DB_PREFIX_.'attribute_lang al ON al.id_attribute = a.id_attribute AND al.id_lang = '.(int)$id_lang.' INNER JOIN '._DB_PREFIX_.'cat_restriction p ON p.id_product = lpa.id_product INNER JOIN '._DB_PREFIX_.'attribute_group ag ON ag.id_attribute_group = lpa.id_attribute_group INNER JOIN '._DB_PREFIX_.'attribute_group_lang agl ON agl.id_attribute_group = lpa.id_attribute_group AND agl.id_lang = '.(int)$id_lang.' LEFT JOIN '._DB_PREFIX_.'layered_indexable_attribute_group_lang_value liagl ON (liagl.id_attribute_group = lpa.id_attribute_group AND liagl.id_lang = '.(int)$id_lang.') LEFT JOIN '._DB_PREFIX_.'layered_indexable_attribute_lang_value lial ON (lial.id_attribute = lpa.id_attribute AND lial.id_lang = '.(int)$id_lang.') '; $sql_query['where'] = 'WHERE lpa.id_attribute_group = '.(int)$filter['id_value']; $sql_query['where'] .= ' AND lpa.`id_shop` = '.(int)$context->shop->id; $sql_query['group'] = ' GROUP BY lpa.id_attribute ORDER BY ag.`position` ASC, a.`position` ASC'; If I try to edit this I do not reach the desired result. Can someone help me. Thanks.
×
×
  • Create New...