Post by GlennWilton » Sun Aug 23, 2009 6:25 am

I have a few products which have no base price, Im using options to let the user select the price.

In the cetegory listings it shows the price as "$0.00" under each product, to hide this I did a little hack and replaced this:

Code: Select all

<span style="color: #900; font-weight: bold;"><?php echo $products[$j]['price']; ?></span><br />
with this :

Code: Select all

            
<?php if ($products[$j]['price']<>'$0.00') {  ?>
<span style="color: #900; font-weight: bold;"><?php echo $products[$j]['price']; ?></span><br />
<?php } ?>
Secondly to in products.tlp I added in the following so if the price is Zero it says "Select options below"

Code: Select all

<?php if ($price<>'$0.00') {   ?> 
     <span class="pricetext"><?php if (!$special) { ?>
          <?php echo $price; ?>
     <?php } else { ?>
          <span style="text-decoration: line-through;"><?php echo $price; ?></span> <span style="color: #F00;"><?php echo $special; ?></span>
     <?php } ?></span>
<?php } else { ?>
     <span class="pricetext">Select options below</span>
<?php } ?>
It would be nice in future to have the option (globally or per-product) to not show $0.00 for products, or even add the options to insert custom text i.e "$90.00 to $299.00"

Glenn

Newbie

Posts

Joined
Sun Aug 23, 2009 6:10 am

Post by digitalchaos » Mon Oct 05, 2009 2:49 pm

OK two things in what file do we add the first and 2nd hack

and where in the 2nd file do we add the hack

The most terrifying words in the English language are: I'm from the government and I'm here to help.
Ronald Reagan

Digital Chaos | Graphic Design Studio http://www.digitalchaos.biz
Digital Chaos Prints | Custom Art Prints http://www.digitalchaosprints.biz


User avatar
New member

Posts

Joined
Mon Sep 28, 2009 9:22 pm
Location - Paterson NJ

Post by GoGo OpenCart » Thu Nov 24, 2011 7:13 am

I just released an extension for doing that. This extension will display "Call for Price" or any other text that you like, for products that have 0 (zero) price. It works independent from different currencies, multiple currencies, left or right currencies, etc. With other words, all you need to do, is to install the extension, and put 0 price for the products you don't want to have prices.

It will also disable the "Add to Cart" button for 0 priced products, making it gray, so costumers can't add that product into the cart.

Look at the pictures to see how it looks like.

Extension's page: http://www.opencart.com/index.php?route ... on_id=4067

See all my extensions: https://www.opencart.com/index.php?rout ... 20OpenCart


User avatar
Active Member

Posts

Joined
Mon Nov 14, 2011 11:30 pm
Who is online

Users browsing this forum: No registered users and 5 guests