- Issue created by @vissini
2.0 is not actively being worked on.
Thanks for the issue. Please use a merge request instead of patch.
When adding a product with variations add-on (commerce_vado) to the cart, an error occurs during the ajax cart update. This happens specifically when the system tries to normalize the `Drupal\commerce_price\Price` object to JSON for the `/cart?format=json` route.
The error message is:
Symfony\Component\Serializer\Exception\NotNormalizableValueException: Could not normalize object of type "Drupal\commerce_price\Price", no supporting normalizer found. in Symfony\Component\Serializer\Serializer->normalize() (line 190 of /app/vendor/symfony/serializer/Serializer.php).
This issue prevents the cart from loading correctly via ajax when VADO is involved.
1. Install Drupal Commerce and the commerce_vado module.
2. Create a product with variations that uses variations add-ons.
3. Configure ajax cart to load on add to cart.
4. Add the product to the cart.
5. Observe the error in the browser console when the `/cart?format=json` request fails.
Modify the `VadoEventSubscriber` and `VadoOrderProcessor` to properly handle the `Price` object when setting and retrieving it as order item data. Convert the Price object into an array before saving it to order item data, and convert it back to a Price object when retrieving it.
* Review the patch.
* Test the patch.
* Commit the patch.
Active
2.0
Code
2.0 is not actively being worked on.
Thanks for the issue. Please use a merge request instead of patch.