View Issue Details

IDProjectCategoryView StatusLast Update
0007344OXID eShop (all versions)1.02. Price calculations (discounts, coupons, additional costs etc.)public2022-08-10 14:46
ReporterSimonGassenschmidt Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Summary0007344: The item discount option doesn't work correctly, if the option "Multiply" is active
DescriptionThe discount type "item" adds one or more products to the basket if the requirements are met.
If the option "Multiply" is not activated, then the set amount of items are added to the basket.
If the option "Multiply" is activated, then the set amount times the required amount of items per products are added.

Example:

Required amount of items per product: 2
Multiply: 1

2 items: The basket will have one additional item as discount.
4 items: The basket will have two additional items as discount.

This works as long as there is no restriction for categories or products.

If this discount applies only to categories or products then it doesn't work as one would expect. The additional item gets only added if the amount of one product meets the required amount of the discount. This behaviour differs if there isn't any restriction to categories or products. Also the online documentation states that the amount of the products of the basket are calculated. So the amount of items of two products should count and not each item for itself.

Expected behaviour:
the amount of items of all products should count every time to add the discount items.

Current behaviour:
- discount is restricted to categorise and/or products: the amount of items of one product must met the required amount of the discount.
- discount is not restricted to categorise and/or products: the amount of items of all product are summed up to check if the required amount of the discount was met.
Steps To Reproduce1) Install CE 6.4 with the demo data.
2) Goto Admin > Shop Settings > Discounts.
3) Deactivate all active discounts.
4) Create a new discount. Always active: check; Quantity: From 12 To 999999; Discount: Item: Art.Nr 1210: Amount: 1; Multiply: true.
5) Goto Frontend.
6) Add product 1205 six times to the basket.
7) Add product 1206 six times to the basket, you must have 12 items in the basket.
8) Open the basket, you must see both products and one additional added discount item 1210.
11) Goto Admin > Shop Settings > Discounts > your created discount.
12) Open the tab "Products" and assign all categories.
13) Goto Frontend > Basket
14) There is no more additional added item, but you still have 6 items per product.
15) Increase the item amount of product 1205 to 12.
16) You will get the addition discount item.
Additional InformationSomehow the basket calculates the amount of additional discount items differently, when there's a restriction to categorise and/or products.

This query https://github.com/OXID-eSales/oxideshop_ce/blob/v6.10.3/source/Application/Model/Discount.php#L321 is the cause. It will return true, which gets negated to false. Because of this, the method
vendor/oxid-esales/oxideshop-ce/source/Application/Model/DiscountList::getBasketBundleDiscounts will not add the discounted item to the basket.
TagsDiscount
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined

Activities

QA

2022-08-10 10:23

administrator   ~0014027

- ES