coreshop / CoreShop

CoreShop - Pimcore enhanced eCommerce
http://www.coreshop.org
Other
276 stars 157 forks source link

Price rule actions affect all product unit prices #2676

Open EinShoppo opened 2 months ago

EinShoppo commented 2 months ago
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? n

Steps to reproduce: Create a product with different product units, each product unit has a different price. image

Add a product specific price rule to the product which sets the price to 100 EUR. image

Actual The price of all product units is changed to the price from the price rule (=100 EUR).

Expected: Only the price of the default product unit should be changed or – even better – there is a way to set the price for certain product units. Or did I miss something? May be the problem could be solved directly within the action by adding a product unit selection. The problem also exists with all kind of actions (discount price, discount amount, discount percent, not discountable) and probably also with other types of price rules, such as the general product price rules. image

dpfaffenbauer commented 2 months ago

@EinShoppo we are aware of that, we never added pricing rule conditions for units. One way is, as you already mentioned, do have a unit selector, but what would that selector do for products without a unit? Percentage discounts might still be valid for products with units.

EinShoppo commented 2 months ago

@dpfaffenbauer Okay, I see. I think the selector should contain a wildcard value (null) so that you can apply an action to all units. In this way, products without units could also be handled. I personally believe that percentage discounts should also be limitable on certain units, because you might want to discount the unit "carton" by 10%, for example, but not the unit "piece". A multi-select for selecting the units would probably be ideal, then you can select several units with one action if required.

dpfaffenbauer commented 2 months ago

yes. Problem might be that the rule Action itself doesn't know anything about the unit. That is something we need to check and solve first.

dpfaffenbauer commented 2 months ago

@EinShoppo we fixed it for now to disable Price and DiscountPrice for units: https://github.com/coreshop/CoreShop/pull/2678

dpfaffenbauer commented 2 months ago

@EinShoppo The bug fix is merged, I will keep this ticket open as a feature request for the unit selection