View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006657 | OXID eShop (all versions) | 1.02. Price calculations (discounts, coupons, additional costs etc.) | public | 2017-06-28 11:35 | 2024-08-07 13:27 |
Reporter | vanilla thunder | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | confirmed | Resolution | open | ||
Product Version | 4.10.2 / 5.3.2 | ||||
Summary | 0006657: Product and category coupon's value calculated from article's basket price instead of actual basketitem price | ||||
Description | category and product coupons take product's original price for calculating discount value instead of getting the actual basketitem price, which could be alredy reduced. You get the biggest side effect when combining discounts and coupons at same time, e.g. you offer 33% discount for a product "buy 3, pay 2" and also 10% for particular products or categories. When bots discount and coupon are valid for the product in your basket, both discount and coupon values are calculated with the original undiscounted price. | ||||
Steps To Reproduce | 1) product X costs 300€ 2) crate 100 € discount for product X 3) crate 10% coupon test666 4) add X to basket 5) you see: product X - 200€ ([del]300€[/del]) 6) enter coupon code test666 7) coupon value is calculated based on 200€ price -> 20€ 8) assign product xor its category to the coupon series 9) recalculate basket 10) coupon discoutn value is calculated based on product's original price 300€ -> 30€ | ||||
Additional Information | compare functions: oxVoucher::_getGenericDiscoutValue oxVoucher::_getCategoryDiscoutValue oxVoucher::_getProductDiscoutValue _getGenericDiscoutValue uses passed $dPrice from oxBasketitem for discount values calcultion _getCategoryDiscoutValue and _getProductDiscoutValue get array of basket items from function _getSessionBasketItems (inside _getBasketItems), but it contains prices from $oArticle->getBasketPrice(...), which are undiscounted. Using $oBasketItem->getUnitPrice()->getPrice() instead, would give the current price of the basket item here is my fix approach: $aItems[$iCount] = array( 'oxid' => $oArticle->getId(), //'price' => $oArticle->getBasketPrice($oBasketItem->getAmount(), $oBasketItem->getSelList(), $oBasket)->getPrice(), 'price' => $oBasketItem->getUnitPrice()->getPrice(), //'discount' => $oDiscount->getAbsValue($oArticle->getBasketPrice($oBasketItem->getAmount(), $oBasketItem->getSelList(), $oBasket)->getPrice()), 'discount' => $oDiscount->getAbsValue($oBasketItem->getUnitPrice()->getPrice()), 'amount' => $oBasketItem->getAmount(), ); | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Theme | Not defined | ||||
Browser | Not defined | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||
|
i tried to reproduce on https://demoshop.oxid-esales.com/professional-edition/ but the coupon discount value is calculated not on the product's original price 300€ -> 30€, but on the discounted price 200€ -> 20€. see Screenshot |
|
i guess, you forgot to assign trapez ion or it's category to the coupon series (step 8). i configured right now everything as described, not sure how often demoshop resets. (i added demoshop.PNG screenshot) |
|
Haben den gleichen Fehler bei einer CE 4.9.5: Produkt hat Preis von 53,95€ In Oxid ist ein Rabatt eingestellt von 5% , Einkaufsmenge 1-99999, Artikelzuordnung zu diesem Produkt Der Gutschein hat einen Rabatt von 10% und der Gutschein ist diesem Produkt zugeordnet. Der Warenkorb stellt nun die Position korrekt mit 51,25€ dar. Füge ich nun den Gutschein hinzu werden nicht 5,13€ angezogen sondern 5,40€ also 10% vom ursprünglichen Artikelpreis. Lässt man nun beim Gutschein die Artikelzuordnung weg, dann wird korrekterweise 5,13€ für den Gutschein abgezogen. |
|
@[email protected] you should rewrite that in english, as the whole bug-tracker is english, otherwise you risk you comment getting ignored. |
|
Reproduced and translated what [email protected] wrote in PE / EE 6.1.0: Have the same error with a CE 4.9.5: Product has price of 53,95€ In Oxid a discount of 5% is set, purchase quantity 1-99999, article assignment to this product. The voucher has a discount of 10% and the voucher is assigned to this product. The shopping cart now shows the position correctly with 51,25€. If I now add the voucher are not attracted 5.13€ but 5.40€ so 10% of the original article price. If you omit the article allocation now with the voucher, then correctly 5.13€ is deducted for the voucher. |
|
Verified in Apex / OXID 7.0 |