mollie / magento2-subscriptions

BSD 2-Clause "Simplified" License
3 stars 5 forks source link

[BUG] subscription follow up orders will only be created in default store view #72

Closed beendeluxe closed 9 months ago

beendeluxe commented 9 months ago

Hey There,

we found another bug within this extension.

We have two different store views for different languages.

  1. English (EN) standard view
  2. German (DE)

When creating an order for storeview german the first order and also the first email templates from subscription module works as expected. But as soon as the tool creates new following up orders for a subscription product, it takes the default store view, in our case the english one. Our expected result here was that the orders will be still created at german storeview with german email templates.

Its not that big problem, but for the best user experience it should be fixed.

Hopeful that it comes in one of your next updates.

Thanks.

ThomasNegeli commented 9 months ago

@beendeluxe can you have a look at the store_id of the order object in the database that was created via a subscription. Is it the wrong store_id or are the mails simply not translated? I'm asking because of this issue here https://github.com/magento/magento2/issues/35674

beendeluxe commented 9 months ago

Thanks for that fast reply.

Its not the translation bug. The subscription module creates the following up orders into the wrong store_id. In our Instance, we create different order numbers for each store view.

In example; German starts with DE123456789 (Store ID 2) English (default) starts with EN123456789 (Store ID 1)

The first order is placed with german view (ID 2). That works. The following up orders are placed with english view (ID 1)

I think that the module do not catch the store ids and places following up orders within the default store. In our case english = ID 1.

Hope it helps.

ThomasNegeli commented 9 months ago

@beendeluxe https://github.com/mollie/magento2-subscriptions/blob/main/Service/Magento/CreateOrderFromSubscription.php#L159 store_id is coming from the customer object. Are the customers created from a different store_view?

beendeluxe commented 9 months ago

Yes, the customer was created on default store (English).

beendeluxe commented 9 months ago

Closing this issue for now because the language is called by customer attribute.