duncanmcclean / simple-commerce

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

Non-default Multi-site order/customer set to the default site. #899

Closed Web10-Joris closed 1 year ago

Web10-Joris commented 1 year ago

Description

Is it normal that when I place an order via one of the subsites (i.e. the non-default one), the order and customer are still categorized as an entry on the default site? I would like them to be separate per site. I am using different domains ( #893 ) for this setup. So when placing an order on the .de domain it should be linked to the German sub-site instead of the default English one.

Steps to reproduce

  1. Place an Order on a non-default site
  2. Check the CP and see that the Order + Customer is linked to the default site.

Environment

Environment Application Name: XXXX Laravel Version: 10.15.0 PHP Version: 8.1.5 Composer Version: 2.5.5 Environment: local Debug Mode: ENABLED URL: localhost 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: EUR, EUR, EUR Gateways: Dummy Repository: Customer: DoubleThreeDigital\SimpleCommerce\Customers\EntryCustomerRepository Repository: Order: DoubleThreeDigital\SimpleCommerce\Orders\EntryOrderRepository Repository: Product: DoubleThreeDigital\SimpleCommerce\Products\EntryProductRepository Shipping Methods: Free Shipping Tax Engine: DoubleThreeDigital\SimpleCommerce\Tax\BasicTaxEngine

Statamic Addons: 6 Antlers: runtime Stache Watcher: Enabled Static Caching: Disabled Version: 4.11.0 PRO

Statamic Addons aerni/advanced-seo: 2.1.3 aryehraber/statamic-impersonator: 2.6.0 aryehraber/statamic-logbook: 3.1.0 doublethreedigital/simple-commerce: 5.3.0 rias/statamic-data-import: 1.3.0 statamic/collaboration: 0.7.2

github-actions[bot] commented 1 year ago

Released as part of v5.3.5.

Web10-Joris commented 1 year ago

@duncanmcclean Thank you for releasing an update! It seems that orders are now created in the correct subsite. However, customers are still being created on the default site when they place an order via one of the subsites.

For both collections, I have set the collection setting 'Origin Behavior: When localizing an entry, which site should be used as the origin?' set to: Use the site the entry was originally created in. Additionally, all sites are enabled for both collections.

On the orders overview page, the customer preview tag is not visible for non-default site orders (Pools). Although there is a customer linked to it, they were created in the default site (Netherlands).

Schermafbeelding 2023-08-21 om 15 49 11

One last question: is it possible to disable the default 'Site' filter on page load? Or is it coded into the CP view? I would love to have this option disabled, so that all orders are visible on the initial load of the overview page.

Schermafbeelding 2023-08-21 om 15 49 28
duncanmcclean commented 1 year ago

However, customers are still being created on the default site when they place an order via one of the subsites.

I'll re-open and take a look at this when I can. My fix concentrated on fixing it for orders. I forgot about customers.

On the orders overview page, the customer preview tag is not visible for non-default site orders (Pools). Although there is a customer linked to it, they were created in the default site (Netherlands).

One last question: is it possible to disable the default 'Site' filter on page load? Or is it coded into the CP view? I would love to have this option disabled, so that all orders are visible on the initial load of the overview page.

Both of these are out of control of Simple Commerce - they're Statamic Core issues.

Web10-Joris commented 1 year ago

Thanks for your quick responses! No problem, sad to hear that the last 2 options are about Statamic Core issues.

github-actions[bot] commented 1 year ago

Released as part of v5.3.6.