Hi All,
Iam using an extension to show my signin in a popup form. When I add an item to wishlist, iam redirected to login page instead login popup. I wanted user to load popup and login when an item is added to wishlist. Is there any way to do this?
Thanks.
Solved! Go to Solution.
@rekharajas68ab
you can use the following code to check customer is logged in or not
define([ 'uiComponent', 'Magento_Customer/js/model/customer' ], function ( Component, customer ) { 'use strict'; return Component.extend({}, /** * Check if the customer is logged in or not * @return {boolean} */ isLoggedIn: function () { return customer.isLoggedIn(); } }); });
then you can update the onClick function for wishlist and show the popup for login if the customer is not logged in.
I hope it helps!
@rekharajas68ab
you can use the following code to check customer is logged in or not
define([ 'uiComponent', 'Magento_Customer/js/model/customer' ], function ( Component, customer ) { 'use strict'; return Component.extend({}, /** * Check if the customer is logged in or not * @return {boolean} */ isLoggedIn: function () { return customer.isLoggedIn(); } }); });
then you can update the onClick function for wishlist and show the popup for login if the customer is not logged in.
I hope it helps!