-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix newsletter subscriptions between stores #12035
Conversation
Include store_id in query result in order to ensure that the action (subscribe/unsubscribe) it’s done in the correct store.
The updating for the data seems to be fine but I noticed during testing with 2 store views that the frontend will not load the right information. Using the following steps.
|
… new newsletter subscription mapping
@sbaixauli I updated the unit and integration tests so hopefully it all passes now.
Hopefully this passes and we can now continue with the processing of this PR. |
@sbaixauli if you are interested in knowing I used http://devdocs.magento.com/guides/v2.2/test/integration/integration_test_execution.html to run the individual tests that had been failing. Then stepped through the process using xdebug. I noticed that the stores did not match, which previously did not matter but with your change now mattered, so I updated the test fixtures to match. |
Thanks for all @dmanners! |
Hello @sbaixauli , due to the issue that I reported in my pull request #13469 , I was checking the function loadByCustomerId in Magento/Newsletter/Model/Subscriber.php. I noticed that also removing the line that you added ($customerData->setStoreId($this->_storeManager->getStore()->getId());), the newsletter subscription is working fine on frontend in a multi site scenario. I don't know if my checks are right, can you please give me a feedback? Thanks. |
Include store_id in query result in order to ensure that the action (subscribe/unsubscribe) it’s done in the correct store.
Description
When user have different accounts in two or more stores newsletter table save the subscription status, store_id and customer_id.
The problem is that when we try to update this information the query result don't keep in mind the store of the user.
Fixed Issues (if relevant)
Manual testing scenarios
Contribution checklist