1

I have a shop with two websites for 2 different currencies:

shop.com/euro shop.com/gbp

The products on the websites are completely the same. The only reason for creating two different websites within the shop is the 2 currencies.

The customers can login on both websites but now I want to achieve the following:

  • Redirect customers to the website their account is associated with when they login at the website their account is not associated with.
  • Don't allow customers to manually change the url from shop.com/euro to shop.com/gbp to get into a website their account is not associated with.

Is this possible? How should I proceed?

1

In terms of the redirect on login you could you the event customer_customer_authenticated and then redirect the user to the appropriate store. This event gives you the following information.

  1. model: this is the actual customer model with the appropriate information such as store etc,
  2. password: this is the password entered in the login form,

With this information you should be able to check the current website is the one that the account is attached to and then simply redirect the user to the correct store. If the sessions are set-up the the user should stay logged in after redirect.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.