[wcj_order_checkout_field]

Display WooCommerce order any checkout field by id

Description

[wcj_order_checkout_field] shortcode displays WooCommerce order any checkout field by id.

Args

field_id
(required) Order field ID.

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
visibility
(optional) User visibility. Possible values are WordPress user roles (including custom), e.g. administrator, shop_manager, customer, guest etc.

Default: all
location
(optional) Make shortcode results visible only to customers from specific country (by user IP). Value is two letter country code.

Default: all

Examples

Billing Phone

[wcj_order_checkout_field field_id="billing_phone"]

Billing Email

[wcj_order_checkout_field field_id="billing_email"]

Custom Billing Checkout Field

[wcj_order_checkout_field field_id="billing_wcj_checkout_field_1"]

Default WooCommerce Order Fields

billing_first_name The billing address first name.
billing_last_name The billing address last name.
billing_company The billing address company.
billing_address_1 The first line of the billing address.
billing_address_2 The second line of the billing address.
billing_city The city of the billing address.
billing_state The state of the billing address.
billing_postcode The postcode of the billing address.
billing_country The country of the billing address.
billing_phone The billing phone number.
billing_email The billing email.
shipping_first_name The shipping address first name.
shipping_last_name The shipping address last name.
shipping_company The shipping address company.
shipping_address_1 The first line of the shipping address.
shipping_address_2 The second line of the shipping address.
shipping_city The city of the shipping address.
shipping_state The state of the shipping address.
shipping_postcode The postcode of the shipping address.
shipping_country The country of the shipping address.
cart_discount Total amount of discount.
cart_discount_tax Total amount of discount applied to taxes.
customer_user User ID who the order belongs to. 0 for guests.
order_key Random key/password unqique to each order.
order_tax Stores order tax total.
order_shipping_tax Stores shipping tax total.
order_shipping Stores shipping total.
order_total Stores order total.
order_currency Stores currency code used for the order.
payment_method method ID.
payment_method_title Name of the payment method used.
customer_ip_address Customer IP Address.
customer_user_agent Customer User agent.
customer_note Order Notes
Recommended for PDF Invoicing and Packing Slips module
Accessible through:
  • [wcj_order_checkout_field]
Tested on WooCommerce 3.6.4 and WordPress 5.2.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

11 Comments

  1. Tom October 6, 2015 at 9:54 am #

    I’m trying to put out [wcj_order_checkout_field field_id="billing_last_name"] in the invoice-template but nothing shows up. Any ideas / help?

    Reply to thread

    Avatar
    • Valentin Solovjov October 6, 2015 at 10:28 pm #

      Hi,

      found/fixed bug in wcj_order_checkout_field, please update to the latest version of Booster for WooCommerce and try again.
      Also you can try different shortcode : [wcj_order_meta meta_key="_billing_last_name"]

      BR,
      Val

      Avatar
  2. Simon May 11, 2016 at 3:42 am #

    Where can I find all the billing info in [wcj_order_checkout_field]? like first/last name, company name, address….
    Also I can’t find [wcj_order_meta]
    Thank you

    Reply to thread

    Avatar
    • Booster Support Team May 11, 2016 at 11:24 am #

      Hi,

      I’ve added list of default WooCommerce order fields to the documentation above, please take a look.

      Regarding [wcj_order_meta] shortcode – unfortunately no documentation available yet, but basically this shortcode will display any order meta value, e.g. [wcj_order_meta meta_key="_billing_last_name"].

      Best regards,
      Tom

      Booster Support Team
  3. Moritz January 24, 2019 at 9:57 pm #

    Hi, i am trying to export a checkbox checkout field, which i created with the standard WooCommerce checkout field editor. The checkout fields name is “wc_billing_field_4701”. Is this already the field_id which i have to use in [wcj_order_checkout_field field_id="wc_billing_field_4701"] like this? Or do i have to change something. I set the texts for “checked” and “unchecked” and I can see their value in the order overview of WooCommerce. But when i try to export this like this: [wcj_order_checkout_field field_id="wc_billing_field_4701"] the column is not filled with any value.
    Greets Moritz

    Reply to thread

    Avatar
    • RokasJ January 27, 2019 at 10:29 pm #

      Hi Moritz,

      Could you contact us directly at support@booster.io with url to your website? Thank you.

      Best regards,
      Rokas – Support Team

      Avatar
    • Moritz January 29, 2019 at 9:29 pm #

      I can’t contact you, my emails are getting denied by your mailer-daemon. It says “High probability of spam”….

      Avatar
  4. Mitch March 17, 2019 at 1:16 am #

    Hello,

    I’m trying to place a checkout field as such:

    add_action( ‘woocommerce_checkout_after_customer_details’, ‘add_order_wcj_checkout_field’ );

    function add_order_wcj_checkout_field() {

    echo ‘test hello’;
    echo do_shortcode( ‘[wcj_customer_meta key="first_name" before="Welcome back, " after="!"]‘ );
    echo do_shortcode( ‘[wcj_order_checkout_field field_id="order_wcj_checkout_field_1"]‘ );

    }

    The hello is displaying, the customer_meta is displaying, but the checkout_field is not. What do I need to change to have the checkout_field display?

    Thank you.

    Reply to thread

    Avatar
    • RokasJ March 20, 2019 at 2:12 pm #

      Hi Mitch,

      Could you try echo do_shortcode( ‘[wcj_order_checkout_field field_id="_order_wcj_checkout_field_1"]‘ ); and also [wcj_order_meta meta_key="_order_wcj_checkout_field_1"]?

      Best regards,
      Rokas – Support Team

      Avatar
    • Mitch March 21, 2019 at 4:41 am #

      Hey Rokas,

      Thanks for the followup. Unfortunately, neither of those work.

      I assume it has to do with the fact that in the Checkout Custom Fields module, you have a hard setting which specifically only allows for one of four placement options. That must be overriding my effort to place that custom field via code ??

      Maybe if you had an option on that module to NOT preselect a placement, then the code could work?

      Thanks for considering how to make that work.

      Avatar
  5. Archana June 10, 2019 at 11:08 am #

    Hello.

    I have enabled product addon module and then get product addon with its price in my order confirmation page then how can i remove price of product addon only i want to see product addon label in order confirmation page then how can i do that? also same thing i want to do in confirmation mail.

    I have done in my PDF invoice using ‘wcj_pdf_invoicing_cell_data’ filter.

    can you please help me?

    Thanks!

    Reply to thread

    Avatar