codehaven - php snippets - coding help
Generic filters
Exact matches only
  • Include and Exclude VAT Tax on Variable Products – Woocommerce

    8th November 2019


    woocommerce category codehaven

    After a client asked to show the prices of products from a woocommerce website that would show Included and Excluded VAT prices, I thought this would be simple!
    I searched “woocommerce display tax rate”, and tried many ways and nothing seemed to work!
    I thought Woocommerce would have this function within it. I was wrong. How easy it would be to add an option that would include this!
    The option would say “Do you want to include both prices?” and then another box that says the rate at which you want it to apply. But alas no such thing!
    I started to search for a simple plugin (woocommerce tax plugin) that would include this but they were either very complex and did not answer my problem or they were very costly and complex!

    Eventually I came across a very simple bit of code that will show the variable product price with VAT and without VAT and when the user selects another option of that product like colour or size it will trigger the code again to show the new updated price with VAT and without again. Yay!

    Why is this not an option???
    Just add this code to the bottom of your functions.php file and your done.
    Please then click the “Was this helpful button”, and let me know…..

    Was this code snippet helpful?