Question

How to split individual products from WooCommerce order

  • 10 August 2023
  • 6 replies
  • 255 views

I’m using Zapier to take orders from WooCommerce and send them to a Pardot form handler via a webhook. However, the order data coming through is a huge mess and I’m trying to make it readable for our sales team.

Background:

  • I’m using this plugin to connect WooCommerce and Zapier: https://docs.om4.io/woocommerce-zapier/
  • I’d prefer not to be using a webhook & form handler, but Zapier’s native send-to-Pardot isn’t working for me. I’ve posted about it on this forum without finding a resolution, and neither Pardot support or Zapier support could offer any solutions. Zapier said: “I don't have an ETA I can provide for this bug fix.” 

So here we are.

The main challenge I’m encountering is that using a webhook sends all of the order data as big, unwieldly clump of text. It’s extra difficult because we use a plugin (YITH Product Options) that adds a ton of metadata in unexpected and unordered ways. 

The product order info info -- from sending Line Items Name -- I’ve been getting in Pardot has been a total mess:
 


Yikes, right? In an attempt to simplify this, I created a loop that pulls out the info I need -- product name, quantity, and meta data.

 

 

Sending to Pardot, via a form handler, looks like this:
 


However, with this approach, the output appears in Pardot like this (assuming there are two products in the order):


Product 1, Product 2, Quantity 1, Quantity 2, Metadata 1, Metadata 2

My question → What step do I need to have the data appear like:

Product 1
Quantity 1
Metadata 1

Product 2
Quantity 2
Metadata 2

Seems so simple, and I’ve tried a number of different approaches. :/

 


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

6 replies

Userlevel 7
Badge +14

Hi @sean-the-patrick 

Good question.

Have you tried using this Zap trigger: WooCommerce - Line Item in an Order

 

Hi @Troy Tessalone, thanks again for jumping in.

Edited: I’ll try this out and get back to you. :)

Hey @Troy Tessalone, that’s working much better, thanks. Still getting some junk metadata that’s output by the WooCommerce plugin, but it’s at least coming through as individual products.

Two questions on this:

1. Some of our products have an ampersand in the title -- e.g., “Arts & Crafts kit” -- which isn’t playing nicely with the output. Pardot only sees “Arts” as the product name.

2. Can I add a line break, so it comes in like this:

Product

Quantity

Meta

… instead of:

Product,Quantity,Meta

I tried some variations of “\n” but had no luck.

Here’s what my Webhook looks like (I added “Quantity:” and “Options:” to try and clean it up)

Thanks again!

Userlevel 7
Badge +14

@sean-the-patrick 

May need to encode the data point.

A Formatter > Text > Encode step can be added.

1. Some of our products have an ampersand in the title -- e.g., “Arts & Crafts kit” -- which isn’t playing nicely with the output. Pardot only sees “Arts” as the product name.

 

Would need to see screenshot example of this.

2. Can I add a line break, so it comes in like this:

Product

Quantity

Meta

… instead of:

Product,Quantity,Meta

 

Usually for POST requests, key/value pairs are sent in the Data section vs as query string parameters which is more common as a GET request, altho that depends on the API endpoint documentation you are using, which we’d need to see.

 

 

Thanks for the tips, @Troy Tessalone ! 

I edited the POST in Webhooks action to pair the key/data values, which has solved the ampersand issue. :)

 


Here’s what it looks like when it comes into Pardot. I tested with multiple products and they do show up in different bullet points.
 

 

I’d like this to show up in a cleaner fashion, like:

Deposit & Surface Analysis (DSA) Test Kit
1
25 tests

(the 60:0 seems to be junk meta data).

 

Any tips?
 


 

Userlevel 7
Badge +14

@sean-the-patrick 

Try adding line breaks between each mapped variable so those are each on a new line in the field.

Also looks like there is a leading space that can be removed.