anis_r Posted November 12, 2019 Share Posted November 12, 2019 Hello, I already asked this question before, but I accidentally posted it on Core Developers forum, so I am re-posting here. Sorry for the inconvenience! I currently need to deduct x% of the profit of all products when cart quantity is greater than 2. I tried using Product Catalog rules for that, but I could only set the discount as either a fixed amount or a percentage of the product's *total amount* (I could figure out the cart quantity part though). How can I set a discount based on profit instead (i.e. retail price minus cost)? Something like: New price = Old price - 10% of profit Is there a way of having one general catalog price rule for all products that satisfies this? Otherwise, I don't mind some coding (I am a web developer, but not a Prestashop expert). Link to comment Share on other sites More sharing options...
NemoPS Posted November 14, 2019 Share Posted November 14, 2019 The only real way is to edit the CartRule class. Have a look at the method name GetContextualValue, you need to edit that, not sure where off the top of my head, but you will find the product's price variable, which you can modify. 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