Custom Fields of Orders

Custom Fields of Orders

Since version 1.4.0 we have introduced a new big feature: Custom Fields of Sales Order.

Now its possible to map custom WC checkout fields with custom Zoho Sales Order fields.

*Note: in this tutorial, we assume you have already configured Custom Fields in Zoho and in WooCommerce. If not, please follow the Zoho Inventory documentation, as well as install a Checkout Custom Fields plugin in your WooCommerce store.

How to find the Zoho Custom Field ID:

  1. Go to Zoho Preferences > Items > Fields Customization
  2. Click on the custom field to edit it
  3. Now copy the field id from the URL of your browser. It will look something like this:
    inventory.zoho.com/app#/settings/preferences/customfields/163444000000350007/

End result:

Simply fill in the WooCommerce field name on the left side and the Zoho Field ID on the right side and click on save. Voila! Now you have enabled complete orders if you use custom fields!

How to sync the order’s Payment Method to Zoho:

The payment method is a standard field in Woo and not a custom field, so you will need to create a custom called “payment_method” for the order and then hide it on the Frontend with some CSS.
After that step, simply copy below code and paste it into your child theme – functions.php or custom plugin.

1
2
3
4
5
6
7
add_action( 'woocommerce_checkout_update_order_meta', 'my_custom_checkout_field_update_order_meta' );
 
function my_custom_checkout_field_update_order_meta( $order_id ) {
   $order = new WC_Order( $order_id );
   $method = $order->get_payment_method();
   update_post_meta( $order_id, 'payment_method', $method );
}

*Tip: we recommend in changing the function’s name to avoid conflict with other plugins.

    • Related Articles

    • Custom Fields Products

      Important To proceed, please ensure you have purchased the Add-On for syncing Items Custom Fields and have installed the ACF plugin (free). With this addon, you can sync the custom fields of Simple Items and Grouped Items to WooCommerce. All you need ...
    • Order Sync

      Via the Order Sync tab, you can manage all orders related settings. Create Package This ensures the creation of a Shipping Package in Zoho Inventory right after the Sales Order is synced. This is useful if you have custom workflows to speed up the ...
    • WooCommerce Account Settings

      Please ensure your WooCommerce account settings are setup at least as following to ensure the customers and orders are synced to Zoho: Allow customers to log into an existing account during checkout Allow customers to create an account during ...
    • Tax Mapping

      In this step we need to ensure we have setup Tax rates for all our products, even if we are not using any tax rates. This is required by Zoho to sync items and to create orders. Ensure you have enabled “Taxes” in WooCommerce Settings and created a ...
    • Zoho Order Status to Woo

      Starting from version 3.2.0 for the Pro plan, we have added the possibility to sync the Zoho Order Status to WooCommerce. Now you can keep your customers informed of the fulfilment process! Order Statuses supported: - Shipped - Fulfilled - Void (this ...