Edit Sale/New labels text in OpenCart
In order to change sale/new text for the featured/special products or on a category page, please, follow the steps below:
- Open the tm_stickers.ocmod file from your template package \themexxx\themexxx-extensions folder with any text editor and use a search tool in order to locate a label you need to change.
- If you want to change label text for the featured products, you need to amend the following code:
<file path="catalog/language/en-gb/module/featured.php"> <operation> <search><![CDATA[ $_['text_tax'] = 'Ex Tax:'; ]]></search> <add position="after"><![CDATA[ $_['text_sale'] = 'sale'; $_['text_new'] = 'new'; ]]></add> </operation> </file>
This part of code generates labels for English language, featured module.
- Change “sale” text to any you want and save the file.
- Then we would need to apply a new modification from OpenCart admin panel.
- Login to your OpenCart admin panel. Navigate to Extension Installer -> Modifications section.
- Locate the TM Stickers module and click Delete, refresh and clear the cache.
- Go to Extension Installer section and upload the tm_stickers.ocmod file you modified.
- Don’t forget to clear cache and refresh modifications. Reload your store page to see a new title.
Thank you for reading this tutorial. Now you know how to edit Sale/New labels text in OpenCart 2.x templates.