How to Remove Disable Product from Cart in Magento 2

in #magentoblog6 years ago

Hello, Magento Folks,

Last time we have learned how you can Change MyAccount navigation links title dynamically in Magento 2. Today we are going to learn how you can remove disable products from the cart. So, without further talks, let’s get started.

How-to-Remove-Disable-Product-from-Cart-in-Magento-2.png

Now the era of the e-commerce world is up and running, and developers are expanding their coding capabilities to make CMS smarter and flexible. With this view, we are coming up and developing new codes to fulfill the function that any store owner like you require.

There are times when you require to remove disabled products from the cart. These disabled products are of no use to anyone, so it is better to remove them from the cart. To achieve this, we need to create a custom extension and test module to use the below code.

Create a Test Module, in which create these files,

Create file app/code/Vendor/Extension/etc/frontend/event.xml

Use the below code,
for more: https://magecomp.com/blog/how-to-remove-disable-product-from-cart-in-magento-2/

Sort:  

Warning! This user is on our black list, likely as a known plagiarist, spammer or ID thief. Please be cautious with this post!
If you believe this is an error, please chat with us in the #appeals channel in our discord.