POA instead of 0 for product price
#1
Posted 17 November 2004 - 07:56 AM
#2
Posted 17 November 2004 - 12:01 PM
function display_price($products_price, $products_tax, $quantity = 1) {
if($products_price == '0') {
return 'POA';
} else {
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
}
}
}
(the last curly bracket closes the class rather than this function - it should be the last in the file before ?>)
Matti
Edited by Johnson, 17 November 2004 - 12:02 PM.
We were all once expert at...... nothing
_____
#3
Posted 30 October 2006 - 03:51 PM
#4
Posted 30 October 2006 - 10:58 PM
Edited by jamiedia, 30 October 2006 - 10:59 PM.
#5
Posted 12 January 2007 - 11:21 AM
Lisa x
#6
Posted 05 May 2008 - 09:52 PM
i add the code mentioned above, but then get the following error -
Fatal error: Cannot instantiate non-existent class: currencies in /home/markb/domains/classicstamps.co.uk/public_html/includes/application_top.php on line 258
The above line is the following -
$currencies = new currencies();
not quite sure why this is happening, can someone point me in the right direction please?
#7
Posted 02 March 2009 - 02:02 PM
Just come accross the same problem myself - little search problem solved.
I am running the latest version - editing on Vista and had no probs with this.
#8
Posted 29 June 2012 - 02:59 AM
This is how I have it for OSC 2.3.1. I noted the 'return $this->' statment is different in 2.3.1 so I used that one instead of the one from you original post. Otherwise works great and thanks for the mod.
function display_price($products_price, $products_tax, $quantity = 1) {
if($products_price == '0') {
return 'POA';
} else {
return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
}
}
Colin
#9
Posted 11 October 2012 - 02:19 PM
Quote
// BOF: modification for POA
IF($products_price=='0')
{return POA_MESSAGE ;}
Else // EOF … POA modification
{return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
}
}
Add for each language you have defined in your OSC store, the following line in the language file in /includes/languages/
This example is for English, thus file is /includes/languages/english.php
Quote
For each language define your own POA message in the [language].php file.
Hope this helps
#10
Posted 20 November 2012 - 11:54 AM
#11
Posted 08 March 2013 - 01:11 PM
function display_price($products_price, $products_tax, $quantity = 1) {
// BOF: modification for AFP
if($products_price=='0') {
return '<a class="pricedrod" href="#">' . AFP_MESSAGE .'</a>';
} else {
return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
}
}
u must define this in your language fileQuote
Edited by madbusu, 08 March 2013 - 01:12 PM.
#12
Posted 11 April 2013 - 05:36 AM
madbusu, on 08 March 2013 - 01:11 PM, said:
function display_price($products_price, $products_tax, $quantity = 1) {
// BOF: modification for AFP
if($products_price=='0') {
return '<a class="pricedrod" href="#">' . AFP_MESSAGE .'</a>';
} else {
return $this->format($this->calculate_price($products_price, $products_tax, $quantity));
}
}
u must define this in your language fileI've been trying for days to hide the price of items if it's $0. I have v2.3.3 and I used the above code, but when I click on the product, it still shows the price in the upper right corner.
I added the first code to the currencies.php file. And the second code to the english.php.
Am I doing something wrong? This is my first store and I seem to be getting nowhere









