Post by AhmedMaherPro » Thu Nov 08, 2018 8:25 pm

Hide Add to cart button in opencart 3 if price equal 0

Hello everyone,

I need a solution to hide "add to cart" button from product page when the product price is zero. i try with this code but it's not working

Code: Select all

{% if (price > 0) %}
<input type="button"  value="{{ button_cart }}" data-loading-text="{{ text_loading }}" id="button-cart" class="btn btn-mega btn-lg " />
{% endif %}
Thank you for your support.

Newbie

Posts

Joined
Thu Feb 09, 2017 8:09 pm

Post by straightlight » Fri Nov 09, 2018 6:53 am

Ensure to clear the cache after each changes. FAQ: viewtopic.php?f=176&p=737014#p718325

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by AhmedMaherPro » Sat Nov 10, 2018 6:21 pm

i already removed cache many times and still not working !!

Newbie

Posts

Joined
Thu Feb 09, 2017 8:09 pm

Post by straightlight » Sat Nov 10, 2018 7:24 pm


The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by synapseindia » Mon Nov 12, 2018 7:45 pm

Please check below extension it may help to disable/hide add to cart button for specific products. You can disable/hide button from admin for a specific product where product price is 0 -

https://www.opencart.com/index.php?rout ... 0to%20cart

User avatar
Active Member

Posts

Joined
Thu Apr 05, 2018 2:27 pm
Who is online

Users browsing this forum: No registered users and 27 guests