How to Enable and Disable Multiple Products - OpenCart 2.x DIY Coding Tutorial

The work of an administrator in an Ecommerce store is pretty time consuming. Nobody knows that better than us. And since iSenseLabs is all about making the life of OpenCart users easier, we decided to create a quick coding tutorial that will add an extra feature to your store. It’s free, it’s easy to implement, and it can save tons of time when editing multiple products.

Do you need to enable or disable products in your store? Doing that separately for each product can be a huge time investment. However, by implementing this piece of code in OpenCart, you will notice an immediate change - two wild Enable & Disable buttons will suddenly appear in your admin panel’s product management field.

Let’s see how this feature is implemented.

If you have a favorite text editor (Brackets, Notepad, Notepad ++, etc.), feel free to open it and paste the code sample.

Since the code sample is more than 200 lines, we decided to turn it into a file and share it with a link.



OpenCart 2.x Code Sample

When you’re done, remember to save the file with its name ending in .ocmod.xml.

Save the OCMOD

After that, upload it in your OpenCart store using the Extension Installer (Admin Panel > Extensions > Extension Installer).

OpenCart Extension Installer

Once you refresh the modifications, the brand new feature will be ready for testing - go to Catalog > Products in your admin panel.

OpenCart Modifications

The two buttons should be waiting for you there.

OpenCart Product Management

You are ready to test them out. Select a few products you want to disable and hide from the front end. After that, click the Disable button.

OpenCart Functionality

Works like a charm.

OpenCart Disabled Products

Repeat the same process and enable them again to bring them back to the front end.

Important note: This feature has been tested and working on OpenCart versions 2.1.x, 2.2.x and 2.3.x.

For OpenCart 3.0 Users

To get the modification that is compatible with OpenCart 3.x, follow this link:

Download the 3.0 Mod

Step 1: Use a text editor to paste the code there and save the file as install.xml.

Step 2: Compress/Zip the .xml file with a name

Step 3: Upload the modification in your OpenCart store using the Extension Installer.

Step 4: Refresh your modifications.

After you complete these steps, the modification will be active.

Go to Catalog > Products to see the change:

You are free to use the modification, we really hope it helps to save some time from editing and managing your products. Good luck, enjoy!

Join 11,000+ subscribers receiving actionable E-commerce advice

* Unsubscribe any time
comments powered by Disqus