10. Invoices


WooCommerce Checkout Manager is compatible with three of the most popular PDF invoices plugins for WooCommerce.

Notice: Only fields with price will be included.

10.1. I use other plugin


We currently don't offer support for other PDF Invoice plugins for WooCommerce. If this is your case, contact the plugin support and share this code with them.

function get_wooccm_fields($fields, $order) {

if (count($billing = WOOCCM()->billing->get_fields())) {
foreach ($billing as $field_id => $field) {
if (!in_array($field['name'], WOOCCM()->billing->get_defaults())) {
if ($value = get_post_meta($order->get_id(), sprintf('_%s', $field['key']), true)) {
$fields[$field['key']] = array(
'label' => $field['label'],
'value' => $value
);
}
}
}
}

if (count($shipping = WOOCCM()->shipping->get_fields())) {
foreach ($shipping as $field_id => $field) {
if (!in_array($field['name'], WOOCCM()->shipping->get_defaults())) {
if ($value = get_post_meta($order->get_id(), sprintf('_%s', $field['key']), true)) {
$fields[$field['key']] = array(
'label' => $field['label'],
'value' => $value
);
}
}
}
}

if (count($additional = WOOCCM()->additional->get_fields())) {
foreach ($additional as $field_id => $field) {
if (!in_array($field['name'], WOOCCM()->additional->get_defaults())) {
if ($value = get_post_meta($order->get_id(), sprintf('_%s', $field['key']), true)) {
$fields[$field['key']] = array(
'label' => $field['label'],
'value' => $value
);
}
}
}
}

return $fields;
}