enmoderugby Posted February 16, 2015 Share Posted February 16, 2015 Hello, Since I have upgraded to PS 1.6.0.11, some prices (and stocks also) are at zero but only when we pass by the manufacturer menu! Otherwise, they are correctly displayed by all other menu and search field. (see image joined) I specify that when I duplicate one of these products, the new product works. I use default-bootstrap version 1.0 Brgds, Nicolas Link to comment Share on other sites More sharing options...
enmoderugby Posted February 27, 2015 Author Share Posted February 27, 2015 Any idea ? Link to comment Share on other sites More sharing options...
NemoPS Posted February 28, 2015 Share Posted February 28, 2015 It appears the Manufacturer::getProducts method is not able to grab your prices. Are some of them displaying? Say, the ones of products without combinations? Link to comment Share on other sites More sharing options...
enmoderugby Posted February 28, 2015 Author Share Posted February 28, 2015 It is what is surprising: some of the products are displaying correctly other not (the problem appears only with products with combinations) ... and after checking it seems to have no difference between a product displayed correctly and one not correctly. Link to comment Share on other sites More sharing options...
NemoPS Posted March 2, 2015 Share Posted March 2, 2015 So apparently that method I mentioned is broken, I didn't test it myself but it might as well e a new prestabug. Try adding this to the query, in the select statement MAX(product_attribute_shop.id_product_attribute) id_product_attribute, Link to comment Share on other sites More sharing options...
enmoderugby Posted March 2, 2015 Author Share Posted March 2, 2015 Sorry, I am not sure to understand correctly. Where do you want I add "MAX(product_attribute_shop.id_product_attribute) id_product_attribute" ? Link to comment Share on other sites More sharing options...
NemoPS Posted March 2, 2015 Share Posted March 2, 2015 Here: $sql = 'SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity'.(Combination::isFeatureActive() ? ', MAX(product_attribute_shop.minimal_quantity) AS product_attribute_minimal_quantity' : '').' , pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, pl.`available_now`, pl.`available_later`, MAX(image_shop.`id_image`) id_image, il.`legend`, m.`name` AS manufacturer_name, DATEDIFF( product_shop.`date_add`, DATE_SUB( NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' DAY ) ) > 0 AS new'.(Combination::isFeatureActive() ? ',MAX(product_attribute_shop.minimal_quantity) AS product_attribute_minimal_quantity' : '') .' FROM `'._DB_PREFIX_.'product` p '.Shop::addSqlAssociation('product', 'p'). (Combination::isFeatureActive() ? 'LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (p.`id_product` = pa.`id_product`) '.Shop::addSqlAssociation('product_attribute', 'pa', false, 'product_attribute_shop.`default_on` = 1') : '').' LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').') LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = p.`id_product`)'. Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').' LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (i.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.') LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`) '.Product::sqlStock('p', 0); if (Group::isFeatureActive() || $active_category) { $sql .= 'JOIN `'._DB_PREFIX_.'category_product` cp ON (p.id_product = cp.id_product)'; if (Group::isFeatureActive()) $sql .= 'JOIN `'._DB_PREFIX_.'category_group` cg ON (cp.`id_category` = cg.`id_category` AND cg.`id_group` '.$sql_groups.')'; if ($active_category) $sql .= 'JOIN `'._DB_PREFIX_.'category` ca ON cp.`id_category` = ca.`id_category` AND ca.`active` = 1'; } Manufacturer::getProducts() method Link to comment Share on other sites More sharing options...
enmoderugby Posted March 2, 2015 Author Share Posted March 2, 2015 Yes but what is the name of the file ? Link to comment Share on other sites More sharing options...
enmoderugby Posted March 2, 2015 Author Share Posted March 2, 2015 I have notice something new: the problem appears only with duplicated products. Link to comment Share on other sites More sharing options...
enmoderugby Posted March 3, 2015 Author Share Posted March 3, 2015 Ok, I have found the file: Manufacturer.php Where exactly should I add "MAX(product_attribute_shop.id_product_attribute) id_product_attribute" ? Link to comment Share on other sites More sharing options...
NemoPS Posted March 4, 2015 Share Posted March 4, 2015 Before this: .' FROM `'._DB_PREFIX_.'product` p Like .', MAX(product_attribute_shop.id_product_attribute) id_product_attribute FROM `'._DB_PREFIX_.'product` p Pay attention to commas Link to comment Share on other sites More sharing options...
enmoderugby Posted March 4, 2015 Author Share Posted March 4, 2015 I have just tried it but after that all manufacturer categories were empty! Link to comment Share on other sites More sharing options...
NemoPS Posted March 4, 2015 Share Posted March 4, 2015 Empty like blank page? There might be an error in the sql, turn on error reporting as described in my signature Link to comment Share on other sites More sharing options...
enmoderugby Posted March 4, 2015 Author Share Posted March 4, 2015 I tried again and it seems to work this time ! (I probably made a mistake the first time with the copy/paste). All products with prices zero have disappeared. I have have created 2 other products without problem. Thanks a lot. Link to comment Share on other sites More sharing options...
pixelwebmx Posted July 30, 2015 Share Posted July 30, 2015 Just to complete this subject. The file that you must edit is located here: classes/Manufacturer.php Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now