CoreShop
CoreShop copied to clipboard
Vouchers for product price rules
Q | A |
---|---|
Bug report? | no |
Feature request? | yes |
BC Break report? | no |
RFC? | yes |
Currently vouchers are only possible for cart price rules, not for product price rules. At first sight there is no problem with this as you could create a cart price rule with a certain product condition and apply a fixed discount (you cannot use a percentage discount because this would apply to the whole cart). But then the problems begin:
- When you advertised the corresponsing voucher code as 10% voucher and change the price of the product, you would have to adjust the discount amount of the cart price rule (automatically or manually)
- As the cart rule discounts get distributed weighted by the cart items' prices, there is a problem in accounting, e.g. you have 2 products:
- A for 90 EUR gross
- B for 10 EUR gross
- you have a cart rule which gives a discount of 1 EUR for product B
- Subtotal gross = 90 + 10 = 100 EUR
- Total discount gross = 1 EUR
- Discounts get distributed to the cart items:
- A: 90 / 100 * 1 EUR = 0.9 EUR
- B: 10 / 100 * 1 EUR = 0.1 EUR
- in accounting it now looks as if product A got sold for (90 - 0,9) EUR. And this is wrong - despite accounting it is also a problem in statistics.
A possible solution would be to use a product price rule for product B. Then we could use percentage discount and would get clean discount distribution. But those do currently not support vouchers. Or is there a way to enable them?
The solution would be to have a Cart Price Rule Action that can have conditions for products to be applied on. So basically apply 10% only on Product A.
see https://github.com/coreshop/CoreShop/issues/1752
actually implemented with https://github.com/coreshop/CoreShop/pull/2057