Display text after price if Tax status is none?
-
Hi all,
I have a unique situation that requires I display + VAT on some products in my woocommerce installation. I currently use the following code on my shop loop price.php which works really well for my normal goods.
global $product; if ($product->get_price() == '' || $product->get_price() == 0) { $price = '<span class="woocommerce-Price-amount amount">POA</span>'; } else { $price = $product->get_price_html(); }
What I would really like is the following:
global $product; if ($product->get_price() == '' || $product->get_price() == 0) { $price = '<span class="woocommerce-Price-amount amount">POA</span>'; } else { If Product Tax Status is "None" then $price = $product->get_price_html(). ' + VAT'; Else $price = $product->get_price_html(); }
The reason for this is half of my shop is in catalogue mode for trade customers and prices of machines are displayed as X + VAT (and cannot be bought online), the other half of the shop is a normal consumer shop which displays prices nicely with a suffix as £X inc vat (£X ex. VAT). However I don’t want the trade machines to show the inc vat prices as it looks messy and they don’t need to see the inc vat price as it’s not the way we trade in our industry.
So they way I have it currently set is the trade machines have their tax status set to none. This means they don’t show a suffix of any kind and display the ex vat price, however I would like to add “+ VAT” to the end of the products with no tax class. (Remember these machines are just displayed in a catalogue category, they cannot be purchased online)
Can anyone help with the above code so I can add + Vat to the end of my price as per my example above?
- The topic ‘Display text after price if Tax status is none?’ is closed to new replies.