I am looking for the best way to remove inactive products (not available on stock) after user login from cart/mini-cart.
I know that I can set quote lifetime in admin, but I am wondering how to achieve this programmatically.
loginmagento2mini-cartquote
I am looking for the best way to remove inactive products (not available on stock) after user login from cart/mini-cart.
I know that I can set quote lifetime in admin, but I am wondering how to achieve this programmatically.
Best Answer
Create
events.xml
from Module/etc/frontend/ folder and paste it below code.UpdateCartAfterCustomerLoginAtObserver.php
Like this, you can try your logic.