1
votes

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.

2

2 Answers

2
votes

In Magento each store is assigned an interface. An interface can have multiple themes in it. This is what I understand by what you call a View. Your templates can refer to theme1/css or theme2/css to give you different looking View A and View B.

To create a different looking checkout page you will have to code app/design/frontend/myinterface/default/template/checkout/onepage.phtml or whatever to use the appropriate theme1/css or theme2/css to change its look.

If however you are using different interfaces then they can only be assigned to different stores. This would be a multi-store setup. In which case you can change the Checkout button in View A (Store A) to link to View B (Store B). You will also have to write some code to allow automatic population of information for the order from Store A to be passed to Store B.

1
votes

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:

/Catalog/Model/Product/Url.php
getProductUrl and getUrl functions

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.