CoreShop icon indicating copy to clipboard operation
CoreShop copied to clipboard

Vouchers for product price rules

Open BlackbitDevs opened this issue 2 years ago • 2 comments

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:

  1. 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)
  2. 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?

BlackbitDevs avatar Apr 27 '22 05:04 BlackbitDevs

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.

dpfaffenbauer avatar Apr 27 '22 06:04 dpfaffenbauer

see https://github.com/coreshop/CoreShop/issues/1752

dpfaffenbauer avatar Apr 27 '22 06:04 dpfaffenbauer

actually implemented with https://github.com/coreshop/CoreShop/pull/2057

dpfaffenbauer avatar May 10 '23 14:05 dpfaffenbauer