View Issue Details

IDProjectCategoryView StatusLast Update
0006797OXID eShop (all versions)1.02. Price calculations (discounts, coupons, additional costs etc.)public2018-02-23 09:45
Reporterhenrik.steffen 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version4.10.7 / 5.3.7 
Target VersionFixed in Version 
Summary0006797: Random order in voucher discount recalculation leads to changing order amounts in admin backend upon saving
DescriptionIt's a difference if you apply a percentual voucher after an absolute voucher or the other way round.

Example:
Basket amount: 100,00 €
Apply a 10 € absolute voucher: 90,00 €
Apply additional 10 % percentual voucher: 81,00 €

If however you'd add the voucher codes in opposite order the calculation gives this:

Basket amount: 100,00 €
Apply 10 % percentual voucher: 90,00 €
Apply additional 10 € absolute voucher: 80,00 €

As you see, the order amounts differ by 1 €, even though the same voucher codes where used.

This is a funny fact for the customer, if he'd ever try to play with the order in which vouchers are added to the basket.
But in the OXID backend it gets really ugly, and this should be considered a serious bug:
Order recalculation in admin backend applies vouchers in a RANDOM order, this means, not in the same order as the customer entered his voucher codes. So, the order total amount could change by simply saving the order again in admin backend order section (except on the main tab where discount recalculcation is not performed).

So, when trying to capture the order on credit cards or similar, the amount might differ, which could result in a capture error, if the order amount increased or changed.


Additional InformationTo solve:

application/models/oxorder.php
$sQ = 'select oxid from oxvouchers where oxorderid = ' . $oDb->quote($this->getId());
add an "order by oxreserved" to the query statement, so the same order will be used as when the user entered the voucher codes in the shop frontend.

TagsPrice Calculation, Solution Provided, Voucher
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
MySQL VersionNot defined

Activities

henrik.steffen

2018-02-22 21:49

reporter  

vouchers1.png (63,334 bytes)
vouchers1.png (63,334 bytes)
vouchers2.png (61,929 bytes)
vouchers2.png (61,929 bytes)