[wcj_order_items_meta]
Display WooCommerce order items meta
Description
[wcj_order_items_meta]
shortcode displays WooCommerce order items meta.
Args
Please check shortcodes common args.
- meta_key
- (required) Order items meta key name.
- Default: None
- order_id
- (optional) The integer ID for an order.
- Default: The current order ID, if exists
- 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
- billing_country
- (optional) Make shortcode results visible only in orders with specific billing country. Value is two letter country code. Can be comma separated list.
- Default: None
- not_billing_country
- (optional) Make shortcode results visible only in orders excluding specific billing country. Value is two letter country code. Can be comma separated list.
- Default: None
Examples
This will display global (i.e. all products) product input field nr. 1:
[wcj_order_items_meta meta_key="_wcj_product_input_fields_global_1"]
This will display local (i.e. per product) product input field nr. 1:
[wcj_order_items_meta meta_key="_wcj_product_input_fields_local_1"]
Accessible through:
- [wcj_order_items_meta]
Hi, i’ve put into invoice [wcj_order_items_meta meta_key="_ebs_start_format"] and [wcj_order_items_meta meta_key="_ebs_end_format"]. Those are meta values for some products bookables.
But they appear into invoice in english format (Y, mm, dd).
Can i change the format for this shortcodes to date in Spanish (dd-mm-YY)?
Thanks a lot,
Joserra
Hi,
Unfortunately it is not possible to change the date format and the shortcodes output the data as it is saved but we have added this to our todo list.
Best regards,
Rokas – Support Team
Hello Staff
We are testing this feature (plugin free version)
We would like to print into Invoice some “wc-item-meta”.
In our website, we inserted this snippet into child functions.php so we are able to show into back-office > manage single order >> manage single meta data.
——————————————————————————
function add_order_item_meta($item_id, $values) {
$key = ‘COLLI’; // Define your key here
$key2 = ‘LOTTO’; // Define your key here
$value = ‘value’; // Get your value here
$value2 = ‘ value ‘; // Get your value here
woocommerce_add_order_item_meta($item_id, $key, $value);
woocommerce_add_order_item_meta($item_id, $key2, $value2);
}
add_action(‘woocommerce_add_order_item_meta’, ‘add_order_item_meta’, 10, 2);
——————————————————————————————
Question:
How to print those meta_key and relative meta_value into Invoice template? Is it possible?
———————————————
columns=”item_sku|item_name|COLLI-Key|LOTTO-key|item_quantity|line_total_tax_excl”
columns_titles=”Codice|Prodotto|COLLI_value|LOTTO_value|Qty|Totale”
columns_styles=”width:15%;|width:52%;|width:6%;text-align:center;|width:6%;text-align:center;|width:6%;text-align:center;|width:10%;text-align:right;”]
———————————————–
Someone can help me please?
BR
Giuseppe
Hi Giuseppe,
You would need to add these columns to your [wcj_order_items_table]:
item_meta=COLLI-Key
item_meta=LOTTO-key
where COLLI and LOTTO keys are actual meta keys.
Best regards,
Rokas – Support Team
I need to format the order_items_meta value, for example: [wcj_order_items_meta meta_key="Extras"], how should i do?