george90 Posted October 24, 2016 Share Posted October 24, 2016 How could be appeared in prices drop page only products with discount >15%; Thank you Link to comment Share on other sites More sharing options...
ventura Posted October 26, 2016 Share Posted October 26, 2016 You must override the function getPricesDrop classes\Product.php and add the code colored part in the query LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop='.(int)$context->shop->id.') LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.') LEFT JOIN `'._DB_PREFIX_.'specific_price` sp ON (sp.`id_product` = p.`id_product`) LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`) WHERE product_shop.`active` = 1 AND sp.`reduction` >= 0.15 /** For a 15% discount */ AND product_shop.`show_price` = 1 Link to comment Share on other sites More sharing options...
george90 Posted October 27, 2016 Author Share Posted October 27, 2016 Thank you for your immediate response. I added your provided code and also this "LEFT JOIN `'._DB_PREFIX_.'specific_price` sp ON (sp.`id_product` = p.`id_product`)" as it wasn't exist. But i dont see any difference. Do you need anything else to help me? Thank you in advance Link to comment Share on other sites More sharing options...
ventura Posted October 27, 2016 Share Posted October 27, 2016 which Prestashop version have you got? Link to comment Share on other sites More sharing options...
george90 Posted October 27, 2016 Author Share Posted October 27, 2016 The version is 1.6.1.4 Link to comment Share on other sites More sharing options...
ventura Posted October 27, 2016 Share Posted October 27, 2016 Then should not have no problem. Add only the colour code that is included in the previous message Link to comment Share on other sites More sharing options...
george90 Posted October 27, 2016 Author Share Posted October 27, 2016 The related lines are below in my file: LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop='.(int)$context->shop->id.') LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`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`) WHERE product_shop.`active` = 1 AND product_shop.`show_price` = 1 I added these that you provided me but it doesn't work. LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (image_shop.`id_product` = p.`id_product` AND image_shop.cover=1 AND image_shop.id_shop='.(int)$context->shop->id.') LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$id_lang.') LEFT JOIN `'._DB_PREFIX_.'specific_price` sp ON (sp.`id_product` = p.`id_product`) LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (m.`id_manufacturer` = p.`id_manufacturer`) WHERE product_shop.`active` = 1 AND product_shop.`show_price` = 1 AND sp.`reduction` >= 0.15 Link to comment Share on other sites More sharing options...
ventura Posted October 27, 2016 Share Posted October 27, 2016 you must add only this AND sp.`reduction` >= 0.15 in the indicated place in previous message. The discount must be a specific price percentage, in table specific_price,e.g and the result will be it the image indicated 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