hi
i’ve an online store currently running,
however, there are some products which i would like to
state “call for price” instead of $0.00
would appreciate if anyone can help
thanks in advance
hi
i’ve an online store currently running,
however, there are some products which i would like to
state “call for price” instead of $0.00
would appreciate if anyone can help
thanks in advance
Hm… maybe:
[php]
if(strstr($-POST[‘aomoney’], ‘$0.00’) { //aomoney: amount of money
echo “Error: you must enter a value over than $0.00”;
} else {
continue query’s and other . . .
}
[/php]
hi
thanks but i’m using open source shopping cart and i’ve tried inserting the following:-
//////////////////////////////////
// Sale Price
////////
function salePrice($normPrice, $salePrice){
global $config;
if($config['saleMode']==1){
if($salePrice<$normPrice && $salePrice>0){
return $salePrice;
} else {
return FALSE;
}
} elseif($config['saleMode']==2) {
$saleValue = $normPrice * ((100-$config['salePercentOff'])/100);
if($saleValue<$normPrice && $saleValue>0){
return $saleValue;
} else {
return FALSE;
}
} else {
return FALSE;
}
}
//////////////////////////////////
// Format Price
////////
function priceFormat($price, $dispNull = FALSE){
if($price == TRUE){
global $currencyVars;
$price = $price * $currencyVars[0]['value'];
return $currencyVars[0]['symbolLeft'].sprintf("%.".$currencyVars[0]['decimalPlaces']."f", $price).$currencyVars[0]['symbolRight'];
} elseif($dispNull == TRUE) {
global $currencyVars;
return $currencyVars[0]['symbolLeft'].sprintf("%.".$currencyVars[0]['decimalPlaces']."f", 0.00).$currencyVars[0]['symbolRight'];
[b]} elseif($dispNull == TRUE) {
global $currencyVars;
return $currencyVars[0]['symbolLeft'].sprintf("%.".$currencyVars[0]['call for price']."f", $call for price).$currencyVars[0]['symbolRight'];[/b]
} else {
return FALSE;
}
}
the result was:
Parse error: syntax error, unexpected T_FOR in C:\Inetpub\vhosts\domain\httpdocs\store\includes\functions.inc.php on line 338
would appreciate if you can help
thanks in advance
Try this code
[php]function priceFormat($price, $dispNull = FALSE){
if($price == TRUE){
global $currencyVars;
$price = $price * $currencyVars[0]['value'];
return $currencyVars[0]['symbolLeft'].sprintf("%.".$currencyVars[0]['decimalPlaces']."f", $price).$currencyVars[0]['symbolRight'];
} elseif($dispNull == TRUE) {
global $currencyVars;
return $currencyVars[0][‘symbolLeft’].sprintf("%.".$currencyVars[0][‘decimalPlaces’].“f”, 0.00).$currencyVars[0][‘symbolRight’];
} else {
return "call for price";
}
}[/php]
hi
thanks, the codes does works
however, it doesn’t take away the 0.00 and replace with text instead it show both
result as follow:
USD0.00
call for price
as for items that already have price indicated it also show “call for price”
USD100.00
call for price
appreciate if you could help
thanks in advance