View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006562 | OXID eShop (all versions) | 1.02. Price calculations (discounts, coupons, additional costs etc.) | public | 2016-12-08 15:18 | 2023-01-24 17:44 |
Reporter | mksschroeder | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | duplicate | ||
Product Version | 4.10.0 / 5.3.0 | ||||
Fixed in Version | 6.2.4 | ||||
Summary | 0006562: Wrong Voucher Calculation - session basket mixing | ||||
Description | This bug has been already reported, but has been closed as not reproducable(https://bugs.oxid-esales.com/print_bug_page.php?bug_id=6213) It only appears if the voucher calculation is set on percentual and categories or articles are assigned to it. I could solve the problem by passing the basket object to the oxvoucher model before calculating the voucherdiscount. I added a function setRealBasket($oBasket) in oxvoucher to set the basket. In oxbasket::_calcVoucherDiscount() i set the basket before calling $oVoucher->getDiscountValue($dPrice) In oxvoucher->_getSessionBasketItems() i use this basket for calculation. | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Theme | All | ||||
Browser | All | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||
|
Update: Problem is not solved by passing the basket object to oxvoucher. We still have orders with the applied discount of an previous order using the same voucher code. Another series with percentage and assigned articles seems to be calculated correctly. (This series uses unique voucher codes) |
|
Please provide Steps to Reproduce (hopefully with screenshots) to help us reproduce the issue and thereby analyse it. |
|
I uploaded a screenshots of the orders with the assigned voucher. The voucher was set to 5% for an assigned group of articles only. The voucher code is the same for the voucherseries. (no unique vouchercodes - this is important) The red highlited parts are orders with the same voucherdiscount amount, but with wrong calculation for the newer one. - so it seems that the amount is taken by the older order/session ?? We stopped this promotion, because it caused too much trouble, so iam nnot able to produce the error in live situtation. we will try to reproduce this bug in dev and give feedback. |
|
I´ve been able to reproduce it in stage env. 1. Create voucherseries with percentage discount (OXALLOWSAMESERIES=0, OXALLOWOTHERSERIES=0, OXMINIMUMVALUE=0, OXCALCULATEONCE=0) 2. assign a bunch of articles to it 3. Create vouchers with a single voucher code (e.g. "08154711") 4. open several sessions signin with mutltiple accounts 5. use voucher code to buy articles (assigned to voucherseries) in my case i left some session with voucher and didn´t finish those orders As you can see in provided screenshot (voucherdebug.jpg) it took 5 orders till the calculation was wrong. |
|
The issue is not reproducable from our end. Kindly try to reproduce the issue in our Reference sytem : http://demoshop.oxid-esales.com/professional-edition/ |
|
This part is the same: 1. Create voucherseries with percentage discount (OXALLOWSAMESERIES=0, OXALLOWOTHERSERIES=0, OXMINIMUMVALUE=0, OXCALCULATEONCE=0) 2. assign a bunch of articles to it 3. Create vouchers with a single voucher code (e.g. "08154711") The session.gc_maxlifetime should be higher than standard iVoucherTimeout (oxvoucher::_getVoucherTimeout() standard 3*3600 seconds) 2 customers are necessary: 1. customer A assign voucher to basket -> oxreserved will be set on 3*3600 seconds = 3 hours -> Timestamp #1 2. customer A keeps the session alive for 3 or more hours. 3. customer B assigns the same voucher code to the basket 3 hours after {Timestamp #1}. As a result the same oxvouchers__oxid will be assigned -> Timestamp #2 4. customer B finishes the order process (oxorderid, oxuserid and oxdiscount will set!) 5. customer A refreshes the basket after {Timestamp #2} (in step 1 ala cart :D ) and get the oxvouchers__oxdiscount from customer B's order. 5. customer A fineshes the order process and saves the discount value from the already used voucher Hint #1: this is not reproducable in demoshop.oxid-esales.com because of the hourly reset Hint #2: set the oxreserved field in oxvouchers at the oxvoucher from customer A to a lower value or wait 3 hours ;). KH edit: possible solution in oxvoucher::checkBasketVoucherAvailability(): if("0000-00-00" != $this->oxvouchers__oxdateused->value || false == empty($this->oxvouchers__oxorderid->oxvalue)) { $oEx = oxNew( 'oxVoucherException' ); $oEx->setMessage('Do not use expired vouchers'); $oEx->setVoucherNr($this->oxvouchers__oxvouchernr->value); throw $oEx; } |
|
Closed because duplicate and resolved in the other bug ticket. -MF |