AbanteCart Community

AbanteCart Development => Customization help => Topic started by: iangregson on April 23, 2018, 01:11:35 PM

Title: Remove 0.00 from product listing .. Solution
Post by: iangregson on April 23, 2018, 01:11:35 PM
I had the problem of listing a product with several options. As I had set the base price of 0.00 and the options at full option price it looked bad listing many products with 0.00
Several replies suggested amendments but sadly did not work
After much tinkering I have found the solution. It also works for items set as Call to Order.
the problem for me was trying to trap 0.00. Solution is trap £0.00 and other currencies used

product_listing.tpl      also change any blocks such as latest.tpl
Around Line 83
<div class="price">
                     <?php if ($product['special']) { ?>
                        <div class="pricenew"><?php echo $product['special'] . $tax_message; ?></div>
                        <div class="priceold"><?php echo $product['price'] ?></div>
                                       
                     
                     <?php } else if ($product['call_to_order']) { ?>
                         <div class="oneprice"><?php echo "Contact for Price" ?></div>                  
                     
                     <?php } else if ($product['price'] == "€0.00" or $product['price'] == "£0.00") { ?>
                         <div class="oneprice"><?php echo "Select Option" ?></div>

                     
                     
                     <?php } else { ?>
                         <div class="oneprice"><?php echo $product['price'] . $tax_message; ?></div>
                     <?php } ?>
Title: Re: Remove 0.00 from product listing .. Solution
Post by: Basara on April 25, 2018, 12:04:49 AM
Thank you