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

[6.x] When customer exists in cart, update customer with provided email. #972

Closed duncanmcclean closed 8 months ago

duncanmcclean commented 8 months ago

This pull request makes a behaviour change to the way customer information is handled in the {{ sc:cart:addItem }}, {{ sc:cart:update }} and {{ sc:checkout }} forms.

Previously, when you had one of these forms with a customer[email] input & a customer was already assigned to the cart, submitting the form with a different email than the existing customers would create an entirely new customer in Simple Commerce.

<input type="email" name="customer[email]" />

However, this PR changes that behaviour. Instead of a new customer being created, Simple Commerce will instead update the email of the existing customer.

Related: #934

github-actions[bot] commented 7 months ago

Released as part of v6.0.0.