[wcj_order_meta]

Display any WooCommerce order's meta

Description

[wcj_order_meta] shortcode displays any WooCommerce order’s meta by key name. For example you can use it in Booster’s PDF invoice template to display any (even third party plugin’s) meta.

Args

meta_key
(required) Meta key.

Default: None
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

Example

[wcj_order_meta meta_key="_your_key" before="My key: "]
Accessible through:
  • [wcj_order_meta]
Tested on WooCommerce 3.5.7 and WordPress 5.1.1
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. Ibrahim Jaber May 24, 2018 at 3:13 am #

    The meta shows the contents but HTML’s get filtered out.

    Reply to thread

    Avatar
  2. bordages January 16, 2019 at 11:35 pm #

    When using this shortcode with a Single checkbox field, it returns a value of “1” or “2” rather than the expected “Yes” or “No”.

    Reply to thread

    Avatar
    • RokasJ January 17, 2019 at 1:04 pm #

      Hi,

      Values should be “0” or “1” but not “2”. This is because checkbox meta is saved as a boolean type which can only be those 2 values. Unfortunately it is not possible to change that yet.

      Best regards,
      Rokas – Support Team

      Avatar
    • Cecil January 18, 2019 at 3:58 am #

      Sorry about the typo on 2 rather than 0.

      I was able to use some basic PHP to create a custom shortcode for the two checkbox fields I added to output “Yes” or “No” depending on the value your shortcode returned.

      Avatar