I add a popup login form in my magento 2 template and when I add a product to the wishlist and I'm not logged in, I want to show the popup for the login and then add to wishlist the product.
Anyone knows how to do it?
Thanks
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityYou can use code:
you can looking at vendor/magento/module-customer/view/frontend/templates/form/login.phtml
add in your layout
<referenceContainer name="before.body.end">
<block class="\Magento\Customer\Block\Form\Login" name="mlx_guestwishlist2_js" template="Magento_Customer::form/login.phtml"/>
</referenceContainer>
add styles
.block-customer-login{display: none;}
jQuery('.towishlist')
.removeAttr('data-post')
.click(function(){
jQuery('.block-customer-login').show();
});