Post by Noveltex » Tue Sep 11, 2012 10:46 pm

I was wondering if you could remove price for certain products. Like, I would like prices removed IF product has options like checkbox options.

New member

Posts

Joined
Sun Dec 25, 2011 7:31 pm

Post by Avvici » Wed Sep 12, 2012 12:04 am

The options are displayed it their own foreach statement. The price is actually displayed OUTSIDE of that loop so if you wanted to set up a check you would simply need to apply some jQuery in that loop. The jQuery would hide the price element if return TRUE for checkbox type.

Code: Select all

 <?php if ($option['type'] == 'checkbox') { ?>
<script type="text/javascript"><!--
DO JQUERY/ HIDE PRICE ELEMENT//--></script>
<?php }?>

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by Noveltex » Wed Sep 12, 2012 12:09 am

Thanks for the reply, where would this code go exactly?

Thank you!

New member

Posts

Joined
Sun Dec 25, 2011 7:31 pm

Post by Avvici » Wed Sep 12, 2012 1:51 am

The element you want to hide is <div class="price">

Open: catalog/view/theme/your_theme/template/product/prodcut.tpl and find this code:

Code: Select all

<?php if ($option['type'] == 'checkbox') { ?>
Right below it add this:

Code: Select all

 <script type="text/javascript"><!--
		$('.price').hide();
		
           //--></script>
This will certainly work for you.

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by drajkon » Wed Dec 12, 2012 4:49 pm

Hello,
I need some help with this, I just want som remove price from certain products not all, i dont want to show the price on the products anywere on the webbside.
Is this possible?

Newbie

Posts

Joined
Wed Dec 12, 2012 4:46 pm

Post by drajkon » Wed Dec 12, 2012 4:53 pm

Hello,
I need help with a problem, I want to remove the price from certain products.
I don't want to have a price on certain products, is this possible?

Newbie

Posts

Joined
Wed Dec 12, 2012 4:46 pm

Post by drajkon » Wed Dec 12, 2012 4:55 pm

Hello,
I need help with a problem, I want to remove the price from certain products.
I don't want to have a price on certain products, is this possible?

Newbie

Posts

Joined
Wed Dec 12, 2012 4:46 pm

Post by drajkon » Wed Dec 12, 2012 4:55 pm

Hello,
I need help with a problem, I want to remove the price from certain products.
I don't want to have a price on certain products, is this possible?

Newbie

Posts

Joined
Wed Dec 12, 2012 4:46 pm

Post by jhuang5555 » Fri Apr 06, 2018 9:56 pm

Avvici wrote:
Wed Sep 12, 2012 1:51 am
The element you want to hide is <div class="price">

Open: catalog/view/theme/your_theme/template/product/prodcut.tpl and find this code:

Code: Select all

<?php if ($option['type'] == 'checkbox') { ?>
Right below it add this:

Code: Select all

 <script type="text/javascript"><!--
		$('.price').hide();
		
           //--></script>
This will certainly work for you.
I tried this method, but it didn't work for me. On my check selection it still shows + $ price.

Newbie

Posts

Joined
Sun Dec 31, 2017 2:05 pm

Post by Satya - Safiramedia » Tue Jun 21, 2022 8:47 pm

jhuang5555 wrote:
Fri Apr 06, 2018 9:56 pm
Avvici wrote:
Wed Sep 12, 2012 1:51 am
The element you want to hide is <div class="price">

Open: catalog/view/theme/your_theme/template/product/prodcut.tpl and find this code:

Code: Select all

<?php if ($option['type'] == 'checkbox') { ?>
Right below it add this:

Code: Select all

 <script type="text/javascript"><!--
		$('.price').hide();
		
           //--></script>
This will certainly work for you.
I tried this method, but it didn't work for me. On my check selection it still shows + $ price.
pleeasee convert this scriptt opencart v1.5++ to opencart v3.0 i needd thisss case solve

User avatar
New member

Posts

Joined
Tue Jun 15, 2021 10:56 am
Location - Indonesia
Who is online

Users browsing this forum: Majestic-12 [Bot] and 26 guests