0

I have created 3 website "A1", "A2", "A3" and all opening website from subfolder URL wise. for example main website url as http://example.com/ then when customer select "A1" website open url as http://example.com/A1/ etc.

Now My question is : Is it possible I will provide customer to access login for "A1" and "A3" website but not access "A2" website. similarly other customer come and we restrict to access "A1" & "A2" website but not "A3" website to login.

How to restrict customer to login by multiple website wise but not all website login.

  • 1
    Make customer attribute : a1_site, a2_site and a3_site and create customer_login event and based on attribute check attribute enabled or not – Naresh Rupareliya Dec 30 '19 at 04:47
  • You can easily do it via a pre-dispatch event. If you are looking for ready-made extension then here is one - https://www.magepsycho.com/magento-2-store-restriction-pro.html – MagePsycho Dec 30 '19 at 05:02
  • @NareshRupareliya and MagePsycho : Thank you for your suggestion. If possible then let me know how to call pre-dispatch customer_login event. do you have any reference..? I have reference for after login but not have before login https://magento.stackexchange.com/questions/178873/magento-2-get-customer-data-after-login-with-observer – Sangeeta Chandaliya Dec 30 '19 at 05:17
  • 1
    @SangeetaChandaliya https://magento.stackexchange.com/questions/244062/magento-2-get-customer-data-before-login-with-observer – Naresh Rupareliya Dec 30 '19 at 05:19
  • @NareshRupareliya: Thank you so much for your support. let me try this method and will update you soon. – Sangeeta Chandaliya Dec 30 '19 at 05:21

1 Answers1

0

You can manage customer per website by below configuration. Navigate to:Stores -> Configuration -> Customers -> Customer Configuration -> Account sharing option -> Share Customer Accounts

Birjitsinh Zala
  • 1,167
  • 6
  • 19