fbpx

Description

shortcode displays total items quantity for WooCommerce order. If order_id parameter is not set – total order items quantity is calculated and displayed for current order. Shortcode is intended to use with PDF Invoices module (e.g. in packing slips template), however actually can be used anywhere, including e.g. emails.

Args

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`
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`

Example

Total:  items
Accessible through:
  • [wcj_order_items_total_quantity]
Tested on WooCommerce 8.5.1 and WordPress 6.4.2