Skip to main content

Woo Commerce - Meta Mappings

Tom Higgs avatar
Written by Tom Higgs
Updated over a month ago

It's possible to map meta values from Woo Commerce into Mintsoft fields so they can be used e.g. Gift Messages, Personalisations etc. To do this you'll need to look at the JSON that we get for an order.


Viewing JSON Data from Woo Commerce

To see the JSON received from Woo Commerce please do the following:

  1. Click Orders then Overview.

  2. Find a Woo Commerce order.

  3. Click Actions then Edit.

  4. Then click History next, Connect.

  5. ExtraCode1 shows the JSON data from Woo Commerce.

Meta Data exists at two levels:

  • Order Level.

  • Order Item Level.


Order Level

At the top level, you'll find a meta_data node. This is where any custom data stored against the order is found.

"meta_data": [{ "key": "gift_message_checkout", "label": "Gift Message", "value": "Happy Birthday Luke" },

So in the example above we can see someone has left a gift message which is under the key gift_message_checkout. So what we would do is set up a meta mapping at Level Order and Map that to the gift message field. So when the order imports it will take the data from that and put it in the GiftMessage field against the order.


Order Item Level

Under line_items you'll find meta_data. This is where any custom data etc is usually found.

"line_items": [{ "id": 31647, "name": "Custom Mug", "sku": "CUSTOM-MUG", "product_id": 105885, "variation_id": 0, "quantity": 2, "tax_class": "", "price": "0", "subtotal": "33.67", "subtotal_tax": "6.73", "total": "0.00", "total_tax": "0.00", "taxes": [{ "total": 0.0, "subtotal": 6.733333 }], "meta_data": [{ "key": "personalised_name", "label": "Personalised Name", "value": "Luke" }] }],

So, we can see that in the Example someone has ordered a Mug that can be personalised.
​
So, under the MetaMapping tab, you'd set up the following mapping using the key of personalised_name and map at OrderItem Level and to NameValue (This will create a name-value pair against the order item with the name of Personalised_name and a value of Luke).

Did this answer your question?