[wcj_product_you_save]

Display saved amount for onsale WooCommerce product

Description

[wcj_product_you_save] shortcode displays WooCommerce product price discount (if any).

This will display the absolute value, if you wish to display the discount in percent, use [wcj_product_you_save_percent] shortcode.

Args

hide_currency
(optional) Hide currency symbol (yes).

Default: no
hide_if_zero
(optional) Hide output if result equals zero (yes).

Default: no

Examples

[wcj_product_you_save before="You save: " hide_if_zero="yes"]
Accessible through:
  • [wcj_product_you_save]
Tested on WooCommerce 3.2.5 and WordPress 4.9
Plugin can be downloaded here. If there are any locked fields in the module, you will need to get Booster Plus to unlock them.

Leave a Reply

Comments

4 Comments

  1. brixxo September 13, 2017 at 9:32 am #

    Hi,

    I have the following setup: Enter prices excluding tax, display price including & excluding tax. Like this:

    https://www.screencast.com/t/yWZse2y54DE

    The main price is including tax, but the savings are displayed excluding tax. Is there a way to fix that?

    Reply to thread

    • Booster Support Team September 13, 2017 at 6:05 pm #

      Hi,

      Shortcode calculates prices as entered, so in your case as you enter it excluding tax, it will calculate the discount based on that. If you’d set to enter prices including tax, then the discount would be calculated including tax. I’m thinking about a workaround solution – adding multiply_by attribute to the shortcode, so if for example you have 21% tax, you could use the shortcode like this:

      [wcj_product_you_save before="You save: " multiply_by="1.21" hide_if_zero="yes"]

      Would it be good enough?

      Best regards,
      Tom

      Booster Support Team
    • Booster Support Team September 15, 2017 at 1:06 pm #

      Hi,

      I went on and implemented the workaround. If you wish to check it out, you can download the development version here – https://booster.io/dev/. You will need to uninstall the old plugin version first (don’t worry your saved settings won’t disappear). So now, you can use the multiply_by attribute as described above.

      Best regards,
      Tom

      Booster Support Team
  2. brixxo October 9, 2017 at 9:41 am #

    Hi Tom,

    Sorry for my very late reply. I have been away for almost a month.

    For me your solution will do, as we have only 1 tax rate. But I guess that if a country has multiple tax rates, this won’t work?

    Reply to thread