Shopware6 icon indicating copy to clipboard operation
Shopware6 copied to clipboard

Check for subscription type on PDP not working for de/en shops

Open m-waes opened this issue 11 months ago • 1 comments

If there is one sales channel with two domains, one for german one for english, the subscription type is only properly resolved for the english PDP.

Example: left is wrong (german PDP), right is correct (english PDP) image

How to reproduce:

Have two sales channel domains like this: image

Create one product and assign it properly to the sales channel. Active the Mollie Subscription for this product via the admin. Lookup the product in the storefront and toggle between the languages. The behaviour should be as seen in the first image.

The main issue I see is with this: https://github.com/mollie/Shopware6/blob/master/src/Struct/Product/ProductAttributes.php#L146 because the custom fields are empty when the german product version (or non english language for that matter) is loaded. The reason for that is that we can't set the subscription toggle for any non english version of the product in the admin.

This could be fixed if the translated custom fields are used, e.g like this: $product->getTranslations()['customFields']['mollie_payments_product_subscription_xyz']

But I haven't looked into the subscription logic any further and I'm unsure about the impact of a change like this But the described behaviour is not intended, correct?

Versions: SW 6.5.8.2 + Mollie 4.5.0

m-waes avatar Mar 02 '24 21:03 m-waes

@m-waechter thanks for the ticket, have you tried to use the extra tab in Product settings? Under specifications you see the custom fields, but we added extra an overview "Mollie" to product detail where you can enable it the default language it will be saved for all languages.

We added a wiki page for that as well

https://github.com/mollie/Shopware6/wiki/Subscription

BlackScorp avatar Mar 19 '24 09:03 BlackScorp

@m-waechter there is indeed a problem. iam going to fix this for the next release

BlackScorp avatar Apr 29 '24 11:04 BlackScorp

Thank you 👍

m-waes avatar May 08 '24 12:05 m-waes