Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable product custom options not visible in order summary after order status change #5686

Closed
ToshiroMifune opened this issue Jul 18, 2016 · 9 comments
Labels
bug report Component: Sales Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@ToshiroMifune
Copy link

ToshiroMifune commented Jul 18, 2016

Hi,
There is one configurable product in our shop, which has two extra paid custom options set.
Just after payment we can see the custom options for this product in order summary (status Pending payment).
When status of the order changes (to cancel, processing, complete etc), the custom options disappear.
It does not matter if status change is initialized by hand or as a result of payment confirmation.
I understand that it can be expected result when the order is cancelled, but not for other status changes. After all we need those informations to process the order.

Magento ver. 2.0.7

Steps to reproduce

  1. In admin create Configurable Product
  2. Set 2 extra paid custom options for that product
  3. Buy that product with both custom options
  4. Open order summary in admin and check the custom options you ordered for the product
  5. Change order status and again verify custom options

Expected result

  1. Custom options for our product visible in order summary in admin
  2. When status of the order changes custom options are still visible

good

Actual result

  1. Custom options for our product visible in order summary in admin only until status of the order changes. After status change only basic product info is visible

notgood

@veloraven veloraven self-assigned this Aug 8, 2016
@veloraven
Copy link
Contributor

@ToshiroMifune thank you for your report.
I created internal ticket MAGETWO-56694 and linked it to this issue.

@veloraven veloraven added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Aug 9, 2016
@veloraven veloraven removed their assignment Aug 9, 2016
@amansrivastava
Copy link
Member

amansrivastava commented Aug 29, 2016

Actual problem is in Order Item Model, It serializes the product_options column data in sales_order_item table every time it saves so the array becomes string next time and Block fails in rendering it.

I created a small snippet to convert the additionally serialized data to serialized array info only for the existing orders, waiting for the fix.

@joshuafredrickson
Copy link

@amansrivastava I've noticed this issue as well. Would you be able to share what you did to address the issue?

@amansrivastava
Copy link
Member

I'll share it shortly. Currently I don't have it with me.

@tigerx7
Copy link

tigerx7 commented Nov 28, 2016

@joshuafredrickson, this might not be pretty but it was quick and fast with the expectation that this will be fixed on the next update, thus no need to go through the hassle of doing an override. (ie. this modifies core code).

On Magento/Sales/Model/Order/Item.php in getProductOptions()

Change

return is_string($data) ? unserialize($data) : $data;

To:

return is_string($data) ? ( is_string(unserialize($data)) ? unserialize(unserialize($data)) : $data ) : $data;

I'm basically just checking if the unserialized data is still a string or not and if so, unserialize it again. I know this is a very dirty way of doing this, but it's fast and there's bigger fish to fry :) It doesn't change the fact that the re-serialized data remains in the database though so whenever the fix is rolled out in Magento's core, a quick update of the product_options field in sales_order_item will be required.

@joshuafredrickson
Copy link

@tigerx7 I love it! ;) 👍

I actually had to unserialize it one more time for it to work on my end. Hopefully this issue will get a proper fix from Magento shortly, but this'll keep business moving along in the interim.

@tigerx7
Copy link

tigerx7 commented Nov 28, 2016

@joshuafredrickson I ran into the same issue on some of the order items. Not sure what the correlation is since the number of re-serializations varied from once to several times. Whichever the case, I've updated my dirty code to reflect those situations:

while (is_string($data)){
   $data = unserialize($data);
}
return $data;

@salelsol
Copy link

salelsol commented Mar 2, 2017

Need help for solve this similar issue: Product custom options is missing in order confirmation mail, just recive correctly product name without selected custom options during checkout.

@magento-engcom-team magento-engcom-team added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Component: Sales labels Sep 11, 2017
@magento-engcom-team
Copy link
Contributor

@ToshiroMifune, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.3.0-dev, 2.2.0, 2.1.9

@magento-engcom-team magento-engcom-team added the Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch label Oct 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Sales Issue: Cannot Reproduce Cannot reproduce the issue on the latest `2.4-develop` branch Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

8 participants