Open mihob opened 4 days ago
Hi @mihob
Thank you for your message.
Could I ask what your store handle is/what was the URI you were trying to access?
Thanks!
The handle is primaryStore
The url looks like this: https://cms.example.test/commerce/store-management/primaryStore/discounts?site=german
Thank you for your reply.
Could you please send your composer files (JSON and .lock
) along with a database backup to support@craftcms.com and reference this ticket.
This will allow us to explore this further.
Thanks!
Is that really necessary? I would have to clean up the database first so as not to disclose any customer data.
This doesn't seem to be an isolated case, maybe you can share the solution from this ticket?
@nfourtythree
The error is probably here (https://github.com/craftcms/commerce/blob/5.x/src/templates/_layouts/store-management.twig):
I think this is simply wrong:
Since we are not using a cpTrigger
, but the CMS is running on a subdomain, the storeHandle
should be segment 3 and not segment 2
storeHandle should be defined as follows:
{% set storeHandle = craft.app.request.getSegment((craft.app.config.general.cpTrigger ? 4 : 3)) ?? craft.commerce.stores.getPrimaryStore().handle %}
For some pages (Shipping Categories) it works because store & and storeHandle are correctly determined in the controller and passed to the template.
However, it is not clear to me why this is not a problem for everyone. Maybe I'm missing something
@nfourtythree Any news on this? We need the discounts feature...
The problem affects the following store management pages:
What happened?
Description
I get the following error when I try to access different store management pages (for example ‘Discounts’):
The shop already existed in Craft 4/Commerce 4 and was migrated to Craft 5/Commerce 5
Steps to reproduce
Craft CMS version
5.5.2
Craft Commerce version
5.2.5
PHP version
8.2.24
Operating system and version
Linux 6.10.14-linuxkit
Database type and version
MariaDB 11.4.2
Image driver and version
Imagick 3.7.0 (ImageMagick 7.1.1-32)
Installed plugins and versions
Asset Locations 3.0.3 BlurHash 3.0.2 Control Panel CSS 3.0.0 CP Clear Cache 2.0.1 CP Field Inspect 2.0.2 Craft Commerce 5.2.5 Default Dashboard 3.0.1 Easy Image 2.0.1 Events dev-craft-5 Expanded Singles 3.0.1 Field Manager 4.0.3 Hyper 2.2.0 Incognito Field 2.0.0 No-Cache 3.0.4 Redactor 4.2.0 Redactor Anchors 1.5.0 Reverse Relations 3.0.0 Schedule 0.6.2 Sentry Logger 5.0.1 SEOMate 3.1.1 Smith 3.1.0 Sprig 3.5.1 Stripe for Craft Commerce 5.0.4.3 Super Table 4.0.2 Vite 5.0.1