Im from Vietnam . Im newby in opencart and coding .
I ve been finding how to change price value to text value when price equal = 0 but found nothing or wrong instructions or commercial copyright modules
After thinking and trying , I find a solution that is very easy and simple to do .
I show you guys how to do that
- List all the extensions and common modules you use on your page .
In my site , I use Feature.twig , latest.twig , special.twig , category.twig , recent _ product.twig and product.twig
- Go and edit every file and find the value {{ product.price }} and replace with the code below
Code: Select all
{% if product.price == 0%}
put the text you need to show here for example I put "Xin Lien He" in Vietnamese , it means "Contact us" in English
{% else %}
{{ product.price }}
{% endif %}
Code: Select all
{% if price == 0 %}
<h2>put the text you need to show here for example I put "Xin Lien He" in Vietnamese , it means "Contact us" in English</h2>
{% else %}
<h2>{{ price }}</h2>
{% endif %}
I m new and I have no chance to use previous Opencart version like 1.xxx 2.xxx but I think it s the same rule but instead the .twig files , you try to edit .tpl files
Hope this will help you guys .
Sorry for my very very bad English coz Im too old to learn English .