Jump to content

Disable cart rules for products on sale


LauraDo

Recommended Posts

Hi, 

I have a cart rules with amount discount and i would like to disable those cart rules for promotional products (products for which I have set a specific price). 

I'm thinking to add a condition in cartRule class. But i'm not sure what to do exactly. 

 

Does anyone have any leads that could help me?

Thank you

I'm using Prestashop 1.7.7. 

 

Link to comment
Share on other sites

Hi, 

 

I found a solution for disable card rules with amount reduction (since for percent reduction the option is already available) if there is a promotional product in the cart

in CartRules.php in public function checkValidity ad this

if((float) $this->reduction_amount > 0){
	$products = $context->cart->getProducts();
	foreach ($products as $product) {
		if ($product['reduction_applies']){
			return ('You cannot use this voucher on reduced products');
		}
	}
}

However the ideal would be to apply the reduction only on non-promotional products. 

Does anyone have any idea how to successfully do this ?

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