duncanmcclean / simple-commerce

A simple, yet powerful e-commerce addon for Statamic.
https://statamic.com/simple-commerce
Other
143 stars 34 forks source link

'Use Shipping Address for Billing?' is always on and billing address not shown in order details #1052

Closed tobiv closed 2 months ago

tobiv commented 2 months ago

Description

In the control panel, opening an order and going to Addresses tab, the switch 'Use Shipping Address for Billing?' is always on, even when a billing address is present in the order. The billing address is not shown in the control panel, but gets sent in the email and is present in the markdown file.

Steps to reproduce

  1. Create a new order with shipping and separate billing address
  2. Verify in email/order markdown file that shipping address is saved
  3. Check order in control panel, go to Addresses
  4. Switch is on, no billing address shown
Environment Application Name: test Laravel Version: 10.48.4 PHP Version: 8.3.4 Composer Version: 2.7.2 Environment: local Debug Mode: ENABLED URL: localhost:8080 Maintenance Mode: OFF **Cache** Config: NOT CACHED Events: NOT CACHED Routes: NOT CACHED Views: CACHED **Drivers** Broadcasting: log Cache: statamic Database: mysql Logs: stack / single Mail: smtp Queue: sync Session: file **Simple Commerce** Currencies: CHF Gateways: Vorauskasse, Rechnung Repository: Customer: DuncanMcClean\SimpleCommerce\Customers\EntryCustomerRepository Repository: Order: DuncanMcClean\SimpleCommerce\Orders\EntryOrderRepository Repository: Product: DuncanMcClean\SimpleCommerce\Products\EntryProductRepository Shipping Methods: Standard-Versand Tax Engine: DuncanMcClean\SimpleCommerce\Tax\Standard\TaxEngine **Statamic** Addons: 1 Antlers: runtime Sites: 1 Stache Watcher: Enabled Static Caching: Disabled Version: 4.55.0 PRO **Statamic Addons** duncanmcclean/simple-commerce: 6.0.10
duncanmcclean commented 2 months ago

You should be able to fix this by editing your order blueprint and removing the default: true config setting from your use_shipping_address_for_billing field, so it looks like this:

- handle: use_shipping_address_for_billing
  field:
    type: toggle
    listable: false
    display: "Use Shipping Address for Billing?"
    instructions_position: above
    visibility: read_only

I'll tag a release shortly to fix this for new sites.

github-actions[bot] commented 2 months ago

Released as part of v6.1.0.