Welcome Guest, Not a member yet? Register   Sign In
Shopping Cart and leading zeros issue
#3

(This post was last modified: 03-10-2017, 01:34 PM by PaulD. Edit Reason: Forgot code tags )

It depends exactly what the value that your cart is sending out. It looks like it is outputting a blank field. So where you output the total add a test for something like:

PHP Code:
<?php echo (!empty($total)) ? $total '0.00'?>


So if the total is not set, is 0, or FALSE, or blank, it will output 0.00 as you wanted.

Of course the better way would be to make sure you cart is not outputting anything but a numeric and well formatted string, but if you cannot access the cart code, then doing this in the view is fine.

Paul.
Reply


Messages In This Thread
Shopping Cart and leading zeros issue - by castle - 03-10-2017, 12:08 AM
RE: Shopping Cart and leading zeros issue - by PaulD - 03-10-2017, 01:33 PM



Theme © iAndrew 2016 - Forum software by © MyBB