Shopping Cart and leading zeros issue |
03-10-2017, 01:33 PM
(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. |
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 InsiteFX - 03-10-2017, 04:37 AM
RE: Shopping Cart and leading zeros issue - by PaulD - 03-10-2017, 01:33 PM
RE: Shopping Cart and leading zeros issue - by ivantcholakov - 03-10-2017, 07:34 PM
RE: Shopping Cart and leading zeros issue - by castle - 03-11-2017, 02:20 AM
|