Configurable product custom options not visible in order summary after order status change
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
- In admin create Configurable Product
- Set 2 extra paid custom options for that product
- Buy that product with both custom options
- Open order summary in admin and check the custom options you ordered for the product
- Change order status and again verify custom options
Expected result
- Custom options for our product visible in order summary in admin
- When status of the order changes custom options are still visible

Actual result
- 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

@ToshiroMifune thank you for your report. I created internal ticket MAGETWO-56694 and linked it to this issue.
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.
@amansrivastava I've noticed this issue as well. Would you be able to share what you did to address the issue?
I'll share it shortly. Currently I don't have it with me.
@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.
@tigerx7 I love it! ;) :+1:
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.
@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;
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.
@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