With the launch of Magento 2.2 version, it introduced major change in terms of serialization. It introduces json serialization instead of regular one. There are many tables in database which includes several fields using serialized values, for example: catalogrules tables. While dealing with products, orders and customers in Magento 2.2, when the data is commanded to unserialize, it flashes an error named “Unable to Unserialize Value”. We were working on a client’s project and while adding products to cart, it showed the same error. The error is already available in Magento 2.2.X versions, you may get the same while dealing with order, product or customers data and voila, we nailed the solution for this “Unable to Unserialize Value” in Magento 2.2.

To solve this, go to \vendor\magento\framework\Serialize\Serializer\json.php and replace the below function in the file.

Implementing the above code will definitely unserialize the old values and serializes them back using Json. Let me know through commenting if you stuck somewhere and need help regarding this code. I’ll be glad to help.

Click to rate this post!
[Total: 32 Average: 3.9]