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!
|