• Resolved faizan1122

    (@faizan1122)


    Hello,

    I’m trying to show both product prices including Vat and Excluding Vat on WC single product page but the Inc. Vat price is only showing to admin. How can I show this price to all my users?

    Any help would be appreciated!

    Thank You!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @faizan1122

    If I understood you correctly, there isn’t an option to show both options natively.

    However, there’s a topic about it with a solution here:

    https://stackoverflow.com/questions/64948839/show-single-product-prices-with-and-without-vat-in-woocommerce

    Since, this is a fairly complex development topic, if the link above doesn’t help, I can also recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack.

    We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    Thank you!

    Thread Starter faizan1122

    (@faizan1122)

    I am using this code to show both the prices and it works fine if I visit the website by login as an admin.

    global $product;
    
    // Get the prices
    $price_excl_tax = wc_get_price_excluding_tax( $product ); // price without VAT
    $price_incl_tax = wc_get_price_including_tax( $product );  // price with VAT
    $tax_amount     = $price_incl_tax - $price_excl_tax; // VAT amount
    
    // Display the prices
    ?>
    <h4 class="price-excl"><span class="exc-price-head" style="font-size:15px">Exc. VAT    -  </span><?php echo wc_price( $price_excl_tax ); ?></h4>
    <h4 class="price-incl"><span class="inc-vat-heading" style="font-size:15px"> Inc. VAT      -   </span><?php echo wc_price( $price_incl_tax ); ?></h4>

    Hi @faizan1122

    It looks like this thread as been marked as resolved. If you still need help with customizing your code, I’d also recommend the WooCommerce Facebook group and/or the #developers channel of the WooCommerce Community Slack as @chiape mentioned previously.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Including Vat price is only showing to admin’ is closed to new replies.