duncanmcclean / simple-commerce

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

Add support for separate first & last name fields on `Address` #788

Closed duncanmcclean closed 1 year ago

duncanmcclean commented 1 year ago

This pull request adds support for using separate first & last name fields for billing/shipping addresses. The Address class will now automatically pick up fields called shipping_first_name, shipping_last_name.

If you wish to use separate fields for the first & last names of addresses, you need to:

  1. Adjust the fields on your Order blueprint. They'll need to match this naming convention:
    • shipping_first_name
    • shipping_last_name
    • billing_first_name
    • billing_last_name
  2. Replace shipping_name and billing_name in your field whitelist with the new field handles.
  3. Adjust the inputs on your frontend forms to accommodate for the separate fields.
  4. That should be all! 🎉
benjibee commented 1 year ago

I followed the steps listed and am able to confirm these modifications work as expected. This is great, thank you :)

github-actions[bot] commented 1 year ago

Released as part of v4.4.2.