View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005737 | OXID eShop (all versions) | 2.6. Administer orders | public | 2014-04-15 10:31 | 2024-10-09 08:53 |
Reporter | FibreFoX | Assigned To | |||
Priority | low | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.8.4 / 5.1.4 | ||||
Summary | 0005737: selectlists are handled wrong if name or value contains a comma followed by a space | ||||
Description | Maybe its listed somewhere (didnt found anything about this), but having a comma in the selectlist-value results in strange side-effects: * oxbasketitem::initFromOrderArticle will no select the right selectlists * oxorderarticle::getOrderArticleSelectList does not get all selectlists (because explode(",") will catch the value too) | ||||
Steps To Reproduce | How we are reproducing it: 1. In admin: Administer Product-> Selection List create selection list with 2 fields: ca. 850g, ca. 16cm Durchmesser ca. 1250g, ca. 22cm Durchmesser both of them have Price Surcharge 2. Assign the product for this list. 3. Make a purchase of this product. 4. Go to Admin-> Administer Order->Order->Overview Calculation is good. 5.Go to Admin-> Administer Order->Order->Main Set payment date and look in Overview tab. Calculation is wrong now. | ||||
Additional Information | I tried to have a nicer formatting inside order_overview, but ended up with messed results. My code so far: public function getNicerSelectionList( $orderArticle ){ $result = ""; $selectedListStringNormalized = $orderArticle->oxorderarticles__oxselvariant->value; $selectedLists = explode(",", $selectedListStringNormalized); foreach( $selectedLists as $singleList ){ $singleList = trim($singleList); if( !empty($singleList) ){ $listNameAndValue = explode(":", $singleList); $result .= $listNameAndValue[0] . ": " . $listNameAndValue[1] . "\n"; } } return nl2br($result); } | ||||
Tags | Selection List | ||||
Attached Files | |||||
Theme | All | ||||
Browser | All | ||||
PHP Version | Not defined | ||||
Database Version | Not defined | ||||
|
Because oxorderarticle::getOrderArticleSelectList is called in oxbasketitem::initFromOrderArticle .... and ends up being called in oxorder::recalculateOrder, this whole thing may be related to recalculation-bug https://bugs.oxid-esales.com/view.php?id=4624 |
|
Reminder sent to: FibreFoX Hi, unfortunately but we can not reproduce this issue. Could you provide more detailed information about how you reproducing it? |
|
Dont know how you tried to reproduce, but please try with this values (i uploaded a screenshot how it looks for me) : 1. "ca. 850g, ca. 16cm Durchmesser" 2. "ca. 1250g, ca. 22cm Durchmesser" (note that "comma + space" is inside selectlist-value value) They will destroy the method i wrote here (involves recalculating). When sending the "your order was send"-mail the layout is not as the "you ordered"-mail, so i looked where it came from ... and realized that they are not stored in a nice way. I hope this helps a little. Edit: maybe a serialized array would help a lot here (but would break compatibility) |
|
Reminder sent to: FibreFoX Hi, Could you please tell us what exactly is your shop version and on which edition you are reproducing it? Also is your shop UTF-8 or not? And what exactly is wrong after you make a purchase? could you please add a screenshot. It would really help us to figure out the problem. Thanks for the patience. |
|
The problem comes from the methods. If you are developing modules that are depending on the right selectlist-value (especially when they have price-additions), the current implemented algorithm is wrong. Please have a look at your own code: http://docu.oxid-esales.com/CE/sourcecodedocumentation/4.8.5.6fd00216aba774e84700d892fe7c037753ecb0e3/oxorderarticle_8php_source.html#l00383 It doesn't have todo anything with encoding, because your algorithm is flawed for selectlists. The culprit is in line 393, this will go wrong when having a value with ", " within the value itself (as described by me https://bugs.oxid-esales.com/view.php?id=5737#c9867) and thats the reason i suggested another form of that value: using serialize() And because of that code, even the recalculation of already existing orders are wrong, because they can't find the price-addition (assuming that one selectlist-entry has something like "+3 €" or something). |
|
Reminder sent to: FibreFoX There might be the problem, but we need to reproduce it and at this moment we can't do it, because for us it works like it should be. So something we are doing different. Please send us information: - shop version; - shop edition; - utf-8 or not - language of the shop; - how many selection list do you have; How we are reproducing it: 1. In admin: Administer Product-> Selection List create selection list with 2 fields: ca. 850g, ca. 16cm Durchmesser ca. 1250g, ca. 22cm Durchmesser both of them have Price Surcharge 2. Assign the product for this list. 3. Make a purchase of this product. 4. Go to Admin-> Administer Order->Order. 5. Look into returned results/database (table: oxorderarticles, column: oxselvariant) Even after recalculation for us it works correct. |
|
In current Demoshop: Enable price changes by selectlists. Assign surcharge 10€ to "ca. 850g, ca. 16cm Durchmesser" and 20€ to "ca. 1250g, ca. 22cm Durchmesser", assign to article, order both types. Look at order, surcharges are OK, set paydate, look again, both have low surcharge now. |
|
Thanks leofonic :) i knew i missed something (enabling price-changes by selectlists). and thats why i think its related to recalculation-bug https://bugs.oxid-esales.com/view.php?id=4624 (which is a real shame, because that bug-ticket is open for such a long time). |
|
I reproduced that bug. After payment date is set price of the order is recalculated wrong. But it is not related with comma inside text. Calculation doesn't depend of the name of the selection lists. It is always after payment date is set calculation is incorrect. |
|
But finding the selected value (with the right surcharge) fails with "comma + space", because it looks for it via its value, that's what this ticket is about, am i wrong? |
|
Related pull request which might have introduced the behaviour (CE 4.8.2 included the change, 4.8.1 not): https://github.com/OXID-eSales/oxideshop_ce/commit/f85158f9ba5c1582d527b9eac1bc2583f5582e92 @QS: We should test if the behaviour of the shop changed from 5.1.1 to 5.1.2. |
|
This won't fix the problem, if you have something like ", " or "," inside your labels, this still won't work. |
|
We were not able to reproduce this issue anymore. Since the select lists were refactored since the bugticket was filed, it is very likely that this also fixed the bug |