How to Display FREE Instead of $0.00 For a Product in OpenCart 3.x
If there is a more attractive phrase than “Free” in E-Commerce… it’s probably “FREE!”
Creating products that are free in your store is a powerful tactic to attract new customers.
But there is a way to make those products even more powerful.
The phrase “FREE” is much more powerful than showing that the product price is $0.00.
Some time ago, we created a tutorial for OpenCart 2.x that shows how your store can switch $0.00 to “FREE”.
In this post, we will show you how to create the same modification for OpenCart 3.x.
This screenshot shows how the product price will be changed.
Looks much more enticing, right?
Let’s show how to do that for your store.
It’s quite easy.
Step 1
Copy the code sample here:
<modification> <name>Show price FREE for zero amount</name> <version>1.0 (Initial)</version> <link>https://isenselabs.com</link> <author>iSenseLabs</author> <code>isenselabs_price_free</code> <file path="system/library/cart/currency.php"> <operation> <search><![CDATA[$string = '';]]></search> <add position="after"><![CDATA[ if ((float)$number == 0 && ($format)) { return 'FREE'; } ]]></add> </operation> </file> </modification>
Step 2
Now open the text editor of your choice and paste it there.
Now save the file as install.xml in a folder of your choice.
Step 3
Next, to be able to upload the image, compress the file into a .ZIP and name it something like price.zero.ocmod.zip.
Any name will work as long as you keep .ocmod.zip.
Step 4
Now upload the .ZIP into your OpenCart 3.x store.
Go to Extensions > Installer and upload the modification there.
When it’s uploaded, go to Modifications and click Refresh.
That’s all!
Now, to test it out, make a free product.
Go to Catalog > Products and change the price of a product to 0.0000.
Now go to the storefront and check how things look there.
Open a product and add it to the cart.
The price of the product will display FREE, as well as the price in the cart view.
Wrap up
This is a super easy and powerful modification you can do to your OpenCart 3.x store. Take it, install it and let us know if it has made a difference for you!