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

Order in CP not displaying shipping method #1106

Closed sdussaut closed 4 weeks ago

sdussaut commented 1 month ago

Description

Hi! When placing an order and storing it in the database, the order view does not display the shipping method used for the order even though "shipping_method":"free_shipping" is present on the order.

It seems to work fine when orders are not stored in database though.

Capture d’écran 2024-07-08 à 15 52 04

Steps to reproduce

  1. Store orders in database (https://simple-commerce.duncanmcclean.com/database-orders)
  2. Place an order
  3. Go to CP in the order detailed view
  4. Shipping method is not filled

Environment

Environment Application Name: Statamic Laravel Version: 11.14.0 PHP Version: 8.3.8 Composer Version: 2.6.6 Environment: local Debug Mode: ENABLED URL: notification-test.test Maintenance Mode: OFF Timezone: UTC Locale: en

Cache Config: NOT CACHED Events: NOT CACHED Routes: NOT CACHED Views: CACHED

Drivers Broadcasting: log Cache: file Database: sqlite Logs: stack / single Mail: smtp Queue: sync Session: file

Simple Commerce Currencies: GBP Gateways: Dummy Repository: Customer: DuncanMcClean\SimpleCommerce\Customers\EloquentCustomerRepository Repository: Order: DuncanMcClean\SimpleCommerce\Orders\EloquentOrderRepository Repository: Product: DuncanMcClean\SimpleCommerce\Products\EntryProductRepository Shipping Methods: Free Shipping Tax Engine: DuncanMcClean\SimpleCommerce\Tax\BasicTaxEngine

Statamic Addons: 2 Sites: 1 Stache Watcher: Enabled Static Caching: Disabled Version: 5.13.0 PRO

Statamic Addons duncanmcclean/simple-commerce: 7.3.2 statamic-rad-pack/runway: 7.5.3

Web10-Joris commented 1 month ago

Now that I see this issue, I'm still experiencing this same problem on the database setup (v6.2.1) Also see #1026 (maybe related)

duncanmcclean commented 1 month ago

Thanks for reporting! I'll take a look when I'm able.

duncanmcclean commented 4 weeks ago

I've fixed this issue for future projects.

However, for existing projects, you'll need to change the handle of the "Shipping Method" field:

This is because shipping_method doesn't have its own column, it's nested inside the data column.

It's worth noting that you'll need to change the handle of the field manually in the blueprint file, instead of via the Blueprint editor in the CP since -> in the field handle will cause a validation error (this will be fixed in the next version of Runway).

github-actions[bot] commented 4 weeks ago

Released as part of v7.4.1.