[wcj_order_subtotal]

Display WooCommerce order subtotal

Description

[wcj_order_subtotal] shortcode displays subtotal for WooCommerce order, that is order total before discount and excluding TAX.

Args

order_id
(optional) The integer ID for an order.

Default: The current order ID, if exists
hide_if_zero
(optional) If set to yes will return empty string instead of numeric zero “0”. Can be used in conjunction with before and after args, so in case the result is zero, the whole content will be hidden.

Default: no
before
(optional) Text to place before the content. If content is empty this argument is ignored.

Default: None
after
(optional) Text to place after the content. If content is empty this argument is ignored.

Default: None
visibility
(optional) Make shortcode results visible to everyone (all), or to admin only (admin).

Default: all

Usage Example

Display WooCommerce order total excluding taxes, taxes and total including taxes. Please note how total discount line is hidden if equals zero:

Subtotal: [wcj_order_subtotal]
[wcj_order_total_discount hide_if_zero="yes" before="Discount: "]
TAX: [wcj_order_total_tax]
Total: [wcj_order_total]
Accessible through:
  • [wcj_order_subtotal]
Tested on WooCommerce 3.0.7 and WordPress 4.7.5
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

1 Comment

  1. Scott February 7, 2017 at 8:28 am #

    How can this feature be used? Is it a matter of applying the shortcode?

    Reply