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

Not possible to localize product variants #942

Closed duncanmcclean closed 6 months ago

duncanmcclean commented 9 months ago

Discussed in https://github.com/duncanmcclean/simple-commerce/discussions/941

Originally posted by **sattyframework** November 28, 2023 Hey there, I am currently working on a project which is using multi site. Currently it has two sites, UK being the default and US. I have set up my sites in my config files. I have my variants set up for products and I can see a price field. I can see that the currency changes when going between the different sites, however the price stays the same. My question is, is it possible to have different prices for the different sites? Also I have created a duplicate product in the CMS for US site and have made the product_variant field localizable, however the price fields within are set to read only and I cant figure out how to edit them. Any help is appreciated, thanks.
duncanmcclean commented 9 months ago

Making the price & other variant options localisable (so they can be different per site) will require quite a bit of work, so is unlikely something that'll be fixed within the next week or so.

sattyframework commented 9 months ago

Thanks for the update, will keep an eye for this.

duncanmcclean commented 8 months ago

I've just tagged v5.7.0 which will let you localize the product variants field. Simply make the "Product Variants" field localizable in your blueprint and that's you done.

sattyframework commented 8 months ago

Thanks Duncan. I am struggling to see the change. I have upgraded simple commerce to 5.8 and I have made the product_variants field localizable however the inner fields are still constrained to the origin site and are read only. Have I missed something?

Screenshot 2024-01-04 at 09 45 46

duncanmcclean commented 8 months ago

That's weird, I've just tested this myself on the latest version and it seems to be working... 🤔

https://github.com/duncanmcclean/simple-commerce/assets/19637309/dedb115a-37a6-46ab-9700-8a86b3a2baeb

Can you run php artisan statamic:install to ensure the latest JavaScript is definitely published & paste the output of php please support:details?

sattyframework commented 7 months ago

Sorry about this, not sure why it hasn't added the new change. I am using a temporary work around where I am creating new products in the US site as the origin, but I will have a look at this further too.

Thanks

Environment
Application Name: RST Version 2
Laravel Version: 10.37.3
PHP Version: 8.2.7
Composer Version: 2.6.6
Environment: staging
Debug Mode: ENABLED
URL: rst-v2.whattheframework.uk
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: database
Session: file

Simple Commerce
Currencies: GBP, USD
Gateways: Dummy
Repository: Customer: DoubleThreeDigital\SimpleCommerce\Customers\EloquentCustomerRepository
Repository: Order: App\Repositories\RstEloquentOrderRepository
Repository: Product: DoubleThreeDigital\SimpleCommerce\Products\EntryProductRepository
Shipping Methods: Free Shipping, BEST, AH2D, FE1D, FE2D, UP1D, UP2D, US1C, US4C
Tax Engine: DoubleThreeDigital\SimpleCommerce\Tax\Standard\TaxEngine

Statamic
Addons: 15
Antlers: runtime
Stache Watcher: Enabled
Static Caching: half
Version: 4.16.0 PRO

Statamic Addons
doublethreedigital/runway: 5.5.3
doublethreedigital/simple-commerce: 5.8.0
jacksleight/statamic-bard-texstyle: 3.1.1
rias/statamic-data-import: 1.3.0
rias/statamic-link-it: 2.3.1
rias/statamic-redirect: 2.x-dev
spatie/statamic-responsive-images: 4.0.3
statamic/eloquent-driver: 2.5.1
statamic/seo-pro: 5.2.0
weareframework/api-product-importer: dev-feature/update-simple-commerce
weareframework/clever-search: dev-main
weareframework/fwk-helper-tools: dev-feature/update-simple-commerce
weareframework/fwk-responsive: dev-feature/update-simple-commerce
weareframework/product-color-swatches: dev-main
weareframework/wps-service: dev-feature/update-simple-commerce

Statamic Eloquent Driver
Asset Containers: eloquent
Assets: eloquent
Blueprints: eloquent
Collection Trees: eloquent
Collections: eloquent
Entries: eloquent
Forms: eloquent
Global Sets: eloquent
Navigation Trees: eloquent
Navigations: eloquent
Revisions: eloquent
Taxonomies: eloquent
Terms: eloquent
duncanmcclean commented 7 months ago

Sorry about this, not sure why it hasn't added the new change. I am using a temporary work around where I am creating new products in the US site as the origin, but I will have a look at this further too.

Thanks

Environment
Application Name: RST Version 2
Laravel Version: 10.37.3
PHP Version: 8.2.7
Composer Version: 2.6.6
Environment: staging
Debug Mode: ENABLED
URL: rst-v2.whattheframework.uk
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: database
Session: file

Simple Commerce
Currencies: GBP, USD
Gateways: Dummy
Repository: Customer: DoubleThreeDigital\SimpleCommerce\Customers\EloquentCustomerRepository
Repository: Order: App\Repositories\RstEloquentOrderRepository
Repository: Product: DoubleThreeDigital\SimpleCommerce\Products\EntryProductRepository
Shipping Methods: Free Shipping, BEST, AH2D, FE1D, FE2D, UP1D, UP2D, US1C, US4C
Tax Engine: DoubleThreeDigital\SimpleCommerce\Tax\Standard\TaxEngine

Statamic
Addons: 15
Antlers: runtime
Stache Watcher: Enabled
Static Caching: half
Version: 4.16.0 PRO

Statamic Addons
doublethreedigital/runway: 5.5.3
doublethreedigital/simple-commerce: 5.8.0
jacksleight/statamic-bard-texstyle: 3.1.1
rias/statamic-data-import: 1.3.0
rias/statamic-link-it: 2.3.1
rias/statamic-redirect: 2.x-dev
spatie/statamic-responsive-images: 4.0.3
statamic/eloquent-driver: 2.5.1
statamic/seo-pro: 5.2.0
weareframework/api-product-importer: dev-feature/update-simple-commerce
weareframework/clever-search: dev-main
weareframework/fwk-helper-tools: dev-feature/update-simple-commerce
weareframework/fwk-responsive: dev-feature/update-simple-commerce
weareframework/product-color-swatches: dev-main
weareframework/wps-service: dev-feature/update-simple-commerce

Statamic Eloquent Driver
Asset Containers: eloquent
Assets: eloquent
Blueprints: eloquent
Collection Trees: eloquent
Collections: eloquent
Entries: eloquent
Forms: eloquent
Global Sets: eloquent
Navigation Trees: eloquent
Navigations: eloquent
Revisions: eloquent
Taxonomies: eloquent
Terms: eloquent

I'm still unable to replicate this, unfortunately. I don't suppose you're able to try and reproduce on a fresh site or give me access to your site so I can try and dig in?

sattyframework commented 7 months ago

No worries, I have done a fresh install on my local which has worked and can see the new update. I will see if I can do this for our dev site, thanks.

duncanmcclean commented 6 months ago

I'm going to close this issue again now.

I can re-open if you're able to reproduce this issue on a fresh install OR are able to give me access to your site and I can dig in.