I didn’t see an answer in a quick search, so I decided make a new one, I am on the checkout_shipping.php in OScommerce 2.3.4 and I am adding an if statement so that the value of $0.00 is the text “free” here is my code, it is incomplete because it is crashing the page, here is the code that I modified.
<?php
if ('cost' > 0) {
?>
<td><?php echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'],
(isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></td>
<php
} ?>
fixed, it was syntax error; also cost wasn’t a value, so I changed it to $i
2
Answers
Actually you are comparing 0 to a string, what you need to do is compare zero to a variable like so:
The first issue is your use of
<php
instead of<?php
. But also the syntax ofif ('cost' > 0) {
makes no sense at all. So assumingcost
is actually a variable named$cost
, then this should work: