LinuxUK
   Home About us Design services Get in Touch Testimonails Create and account / Log in
Categories
 Premium Sites

 Security checks

 Power OSC

 Free Sites

 Support Club

 Tips and Tricks

 How to guides osC

 My Contributions

Best Buys
Fondant style
Fondant style
$184.79
$147.83
LiveZilla Live Help
Hide Price if 0 & replace with a message
Product stats Product Stats
Products name Product Name: Hide Price if 0 & replace with a message
Products model Model: Hide Price
Products info Product description

This mod will allow you to hide prices if they are set to 0, and in their place display a message.
We use the same bit of code as we used here, all we do is change the IF statement.
From catalog / includes / classes / currencies.php
Line 72 & 73 find

     function display_price($products_price, $products_tax, $quantity = 1) {
      return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
    }

to this we add a simple IF statement, so it looks ....

    function display_price($products_price, $products_tax, $quantity = 1) {
      if ($products_price > 0.01) {
   return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
   }else{
   return 'Contact us';
   }
    }

We are saying, IF the price is over 0.01 show the prices ELSE display the message.

Its a very simple method compared to some of the contributions you come across!

 

Reviews

Hide Price if 0 & replace with a message - Bookmark with Delicious Hide Price if 0 & replace with a message - Bookmark with Digg Hide Price if 0 & replace with a message - Bookmark with Yahoo, My webb Hide Price if 0 & replace with a message - Bookmark with Spurl Hide Price if 0 & replace with a message - Bookmark with Furl Hide Price if 0 & replace with a message - Bookmark with Ask Hide Price if 0 & replace with a message - Bookmark with Sqidoo Hide Price if 0 & replace with a message - Bookmark with Simply Hide Price if 0 & replace with a message - Bookmark with Reddit Hide Price if 0 & replace with a message - Bookmark with Magnolia Hide Price if 0 & replace with a message - Bookmark with Facebook Hide Price if 0 & replace with a message - Bookmark with Google