View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004631 | OXID eShop (all versions) | 1.02. Price calculations (discounts, coupons, additional costs etc.) | public | 2012-10-16 10:45 | 2014-03-04 11:28 |
Reporter | msubotovic | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | unable to reproduce | ||
Product Version | 4.2.0 revision 23610 | ||||
Target Version | 4.8.3 / 5.1.3 | ||||
Summary | 0004631: Discount quantity and purchase price filters are working incorrectly | ||||
Description | There are issues in oxDiscount class, isForBasketAmount and isForAmount methods: 1) It looks like the discount filter uses logical OR, but not logical AND method (oxDiscount::isForBasketAmount): if ( $blForBasketItem ) { if ( $this->oxdiscount__oxprice->value ) { if ( ( $oPrice = $oBasketArticle->getPrice() ) ) { $dAmount += $oPrice->getBruttoPrice() * $oBasketItem->getAmount(); } } elseif ( $this->oxdiscount__oxamount->value ) { $dAmount += $oBasketItem->getAmount(); } } 2) When the price AND quantity filters are set (both) and basket price passes the price filter it is being compared with "oxamount" value (oxDiscount::isForAmount): $blIs = true; if ( $this->oxdiscount__oxprice->value && ( $dAmount < $this->oxdiscount__oxprice->value || $dAmount > $this->oxdiscount__oxpriceto->value ) ) { $blIs = false; } elseif ( $this->oxdiscount__oxamount->value && ( $dAmount < $this->oxdiscount__oxamount->value || $dAmount > $this->oxdiscount__oxamountto->value ) ) { $blIs = false; } | ||||
Steps To Reproduce | 1. Go to Admin -> Shop Settings -> Discounts 2. Create new discount with any type (abs, % or itm) 4. Set "Quantity" filter - From: 1, To: 10 5. Set "Purchase Price" filter - From: 1, To: 1000 6. Click "Save" 7. Go to "Products" tab and assign some article with price greater than 1 and less than 1000 7. Go to front-end page 8. Find article that match the discount 9. Add article to basket 10. Observe that the discount has not been applied | ||||
Tags | Discount | ||||
Attached Files | |||||
Theme | Both | ||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||