• Resolved pas2019

    (@pas2019)


    Hi,

    I am struggeling with the Woocommerce prices, i can’t find a proper solution for this

    Situation:
    We have a wordpress website with woocommerce installed. We use Elementor to create pages and ele custom pro to create a custom loop for the product archives. We also use it for the single product layout.

    Our shop is mainly for business to business users so we would like to show the prices Excluding TAX by default but we will also show the price including TAX (smaller on a new row) below the price excluding tax.

    I already found that i can show both prices in woocommerce with the price suffix: {price_excluding_tax} and {price_including_tax}

    This will show someting like this: € 365.10 (excl. tax) € 441,77 (incl. tax)
    This is just one row of text, i cant style this like i would, it isn’t possible to create a <br> in this code

    Is there a way to create 2 shortcodes that are showing the price of the product in a proper way?

    I would like to have something like this with shortcodes that i can use in elementor for example.

    [price-inc-tax] shows € 441,77 (incl. TAX)
    [price-ex-tax] shows € 365,10 (excl. TAX)

    Hope someone can help me out?

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @pas2019 ,

    Okay, I understand the end goal.

    However, I do not have an exact code to create the shortcode, I can suggest how can you access the prices with or without tax from WooCommerce –

    echo wc_price(wc_get_price_including_tax($product));
    echo wc_price(wc_get_price_excluding_tax($product));

    To understand how to add the shortcode in WordPress see – https://www.wpbeginner.com/wp-tutorials/how-to-add-a-shortcode-in-wordpress/

    This is a fairly complex development topic. I’m going to leave it open for a bit to see if anyone is able to chime in to help you out.

    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.

    If you need a paid solution, you can consider taking help from one of our partner’s website.

    Thank you ??

    Hi there,

    We’ve not heard back from you in a while, so I’m marking this thread as resolved.

    Hopefully, you were able to find a solution to your problem! If you have further questions, please feel free to open a new topic.

    Thank you ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Woocommerce shortcodes to show price including and excluding TAX’ is closed to new replies.