duncanmcclean / simple-commerce

A simple, yet powerful e-commerce addon for Statamic.
https://statamic.com/addons/duncanmcclean/simple-commerce
Other
146 stars 40 forks source link

Update a product with product variants in cart returning exception #844

Closed de-raaf-media closed 1 year ago

de-raaf-media commented 1 year ago

Description

Hi There,

If I change the number of items in my cart and the product has product variants then it will display an error about the expected type for a variation.

I think this can be fixed by changing line 222 in CartItemController.php to:

: $product->variant($lineItem->variant()['variant']);

Regards, Mark

Steps to reproduce

add product with variants to shopping cart change the number of items for this item in shopping cart

Environment

Environment Application Name: Statamic Laravel Version: 9.52.4 PHP Version: 8.1.15 Composer Version: 2.1.11 Environment: local Debug Mode: ENABLED URL: statamic-shop.test Maintenance Mode: OFF

github-actions[bot] commented 1 year ago

Released as part of v4.5.6.

de-raaf-media commented 1 year ago

Cool! Thanks.