I have two stores. Store A - Showing products as a catalog, unable to buy. Store B - Able to buy for exclusive customers with a given login account.

That I want to do is, create a button on store A at product page called "Login and order". Clicking on this button will redirect the user to store B. Store B is configured in the way, that users can only access it if login. Code for the URL link in view.phtml in Store A's template:

    $shopProId = $_product->getId();
    $shopProduct = Mage::getModel('catalog/product')->setStoreId(4)->load($shopProId)->getProductUrl();
<a href="<?php echo $shopProduct; ?>">bestil</a>

The url of the link looks like this: https://storeA.com/category/productname?SID=123456789&_storetitle

After clicking on the link, it will redirect the user to Store B and asked the user to login. The URL for the login page looks like this: https://storeB.com/customer/account/login/

But the problem is, the session was never passed, or it could maybe not be done like this. So after logging in, the website just redirected me to account dashboard. I also have change the status to "No" on System->Configuration->Customer->Customer Configuration > Login Options

I'm thinking this could maybe be done if modify the loginPostRedirect() function in AccountController.php? But I have no idea how? Anyone have an example of how to do it?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.