8

I have a specific type of shopping cart rule I'd like to create. You can think of it as a 'variety discount'; the more products from different categories the customer has in their basket, the greater a discount they get from their order:

Example

Categories:

  • Shoes (3% discount)

  • Coats (2% discount)

  • Jackets (2% discount)

  • Sale (Exempt from discount)

  • Accessories (5% discount)

Scenario:

  • A customer adds a product to the (empty) cart from category Shoes worth £40, this adds a 3% discount to the cart total, resulting in £38.80 (40 - 3%)

  • Then a product from the Coats category worth £200 is added to the cart. The total discount increases to 5% for the cart total, resulting in £228 (240 - 5%)

  • A second product from shoes is added worth £30. As the price rule has already been applied, the discount isn't affected, resulting in a total of £256.50 (270 - 5%)

  • A sale item is added to the cart worth £10, at a reduced price of £8. This is exempt from the deduction for the other products, giving a total of £264.5.

The Shopping Cart Price Rule interface allows you to discount a fixed amount from the cart, and the alternative is applying a percentage amount to items that match the conditions set.

Is the described scenario above possible without writing a custom extension? If not some advice on where to get started would be appreciated as Magento is still a little alien to me.

  • I think it would help if you edit your question and add a specific example to it (with real prices and percentages). This will make us understand your question better and might get you an answer sooner... – 7ochem Feb 24 '15 at 20:13
  • Thanks @7ochem - I've modified the example scenario to include a more detailed description of expected behaviour and real numbers, which should hopefully help visualise the expected outcome. – Gaffen Feb 26 '15 at 10:39
  • Sorry with the update you made it explains it a little better. The logic behind it is not what i thought it would be. Doesn´t seem very appealing as people will just order seperately to get the most discount in my opinion – Klettseb Feb 26 '15 at 10:45
  • You are of course right, @Thomas - I've updated the logic again to reflect a saner implementation. I had initially held off on this as it seemed like unnecessary complication - but I guess I might as well get a full answer if I'm going to ask for one. – Gaffen Feb 26 '15 at 11:21
0

The individual sales rules are possible, so you can create a cart rule that will give a percentage for any order containing items bought from a given category. You can then create other rules for other categories. So each of them could cumulatively give e.g. 2% off the order.

However, those rules are not aware of each other. So they do not know what the current discount is (from the other rules) and cannot then have the 'if' to decide whether a further discount is possible.

As for the product specific discount, you can do that one with a rule or a just a special price on the product.

If you want to do this with a module then the easy bit is coding the rules that you want. Quite a few other changes are needed. There may be a need to update templates (to show your extra line item), some xml for 'totals_sort' order - it goes on.

I also feel that your original sales idea might actually be confusing for customers. Sometimes the spend X get Y rules need to be easy for people to understand.

  • Thanks for the input, I did manage to get part of the way by stacking the rules the way you describe; creating several price rules that look for an item in the cart to add a discount, but the CMS only seemed to offer a fixed cart discount rather than a percentage - is there some way of enabling this? I agree the idea of a variety discount is a little unusual, unfortunately I'm just the guy being asked to implement it though. I know the Magento sales rules are very powerful, so I was hoping to avoid making an extension if possible – Gaffen Feb 26 '15 at 12:59
  • You can do percentages, however sometimes the labels on the boxes are not that clear, e,g, says 'amount' instead of 'amount or percentage'. Give it a few tests. – Henry's Cat Feb 26 '15 at 15:21
  • Thanks, I will take a look into this. If I manage to work it out I'll include the location of the CMS option that allows this as it's not obvious to beginners – Gaffen Feb 26 '15 at 16:45
  • If you want to go for doing it in your own code that can be done too, with a line item. Tutorials for that are hard to find online, contact me if you want some sample code for that. – Henry's Cat Feb 26 '15 at 16:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.