Is there a way to force a switch to a different store view in Magento when a user clicks on checkout or the product page?
To clarify the issue, let’s presume we have 2 different store views in Magento:
- One main store view (View A) that all users go to upon arriving to the store. This view displays products that are set to appear in all store views in the system
- One customized store view (View B) that has some specific branding and some other specific settings related to checkout, payment gateways etc.
When the user is browsing products in View A and clicks on either the checkout link or the product page link, we want to redirect them to View B and let them proceed with the checkout in that View.
Is this possible to accomplish in a relatively easy manner, and how?
Thanks.
Add a new store config which will store the base url of the product listing store.
We want the user to land on the checkout site home page, that will be the main page and you can override:
where you would simply string replace the returned parent::getUrl’s base url value with the base value in your new config.
Therefore what will happen is when the user clicks on catalog navigation they will be taken to the other store. Finally when they again click back on checkout or any other link that will bring them back to the checkout store.