Jump to content

Prices drop - Only products with >15% discount


george90

Recommended Posts

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

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

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

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...