Question

How do I map Jotform order data (product & variations) to WooCommerce after form submission?


Hi,

I’m trying to map my jotform order form i created to create an order in woocommerce.

I have the site linked and the form works.  but when i submit the form there is no order data in woocommerce.

I’m having trouble figuring out how to map the form id to the woocommerce product and variation ID.

please help


16 replies

Userlevel 7
Badge +14

Hi @Davey1975 

Help us have more context by posting screenshots with how your Zap steps are outlined and configured in EDIT mode so we can see the field types/descriptions.

hi troy,

I have this screenshot:

and this of my jotform
 

the problem is that i don’t know how to use this screen to map my jotform fields:

 

 

here is the test data output:

 

Answers 400 Mens Grippers On Both

400 Men's Grippers on Both

["1","1","1","1","1","1","1","1","1","1","1","1","1","1"]|["2","3","9","10","11","12","13","14","15","16","17","18","19","20"]|["8"]

 

I know this somehow means that i ordered 1 qty of each size.

Size 7-14 is this:

["2","3","9","10","11","12","13","14","15","16","17","18","19","20"]

 

not sure what the ["8"] means

 

Userlevel 7
Badge +14

@Davey1975 

For Zap step 3, you need to map variables from the previous steps to the fields in order to pass data between the steps.

If you’re trying to handle 1+ order line items, then the logic becomes more complex.

Userlevel 7
Badge +11

Hi there @Davey1975 👋

How are things going on this? Were you able to map the necessary fields from the Jotform trigger and WooCommerce search action to select the relevant IDs to select the right product and variation?

If not, you might need to add a Find Product (WooCommerce) action to search for the relevant product. And as Troy mentioned, if you’re working with line items it can get a bit more complex. In which case you’d might want to try adding a Looping by Zapier action to allow the Zap to search for each product individually and add them to the order using the Update Order (WooCommerce) action. 

Keen to ensure you’re all set so please do let us know if you’re still in need of any assistance here! 🙂

still trying to work my head around the process.  there’s no resource that i can find where someone has done the same thing and can provide an example.  it should be pretty simple to say “this cell in the order form (jotform) relates to this item variation in woocommerce”.

working through jotform wasn’t the best option.

I’ve created a simple web form with HTML and the order comes in nicely.  I’m able to map all the fields easily.

 

However, I’m having difficulty getting the form data to include the customer or user id.  So when the order is sent to Woocommerce, it is not from any customer.

Userlevel 7
Badge +11

Thanks for getting back to me @Davey1975 🙂

it should be pretty simple to say “this cell in the order form (jotform) relates to this item variation in woocommerce”.

For those sort of cases you can use a Formatter (Utilities > Lookup Table) action to convert the value received from Jotform into the corresponding ID for the product variation in WooCommerce. However if you’ve got a long list of variants I find it’s often easier to use a search action like the Find Product (WooCommerce) action to search for the product variant and obtain it’s ID.

I’ve created a simple web form with HTML and the order comes in nicely.  I’m able to map all the fields easily.

However, I’m having difficulty getting the form data to include the customer or user id.  So when the order is sent to Woocommerce, it is not from any customer.

Does the HTML form you’ve built contain the email address for the user? If so, you could try using a Find Customer (WooCommerce) action to locate the customer. This action would return the customer’s ID number which you can then map in the Customer Id field on the Create Order (WooCommerce) action.

Looking forward to hearing from you on this!

okay thank you I was able to do that.

How do I make it so that on submit the order gets added to the woocommerce cart instead of creating an order?

Userlevel 7
Badge +11

Yay! Glad to hear that did the trick @Davey1975
 

How do I make it so that on submit the order gets added to the woocommerce cart instead of creating an order?

There aren’t any “Add to cart” type of actions currently available for WooCommerce. Looking at the API documentation for WooCommerce here I’m not seeing ant endpoints that would allow a Zap to add an item to a user’s cart so it would seem that this isn’t possible right now.

Can I ask why you’d want the item to be added to the customer’s cart instead of having an order created?

Is it that you’d like payment to be prompted via WooCommerce? If so, perhaps you could have the Zap set the order’s Status to Pending (e.g. received but not paid for) when creating the order. I expect WooCommerce would be able to send out an email for any pending orders to the customer with a link to then pay for the order. Would that be a viable solution?

We would want it added to cart because the order would be large, including things like several different types of footwear, handwear, brushes, and clothing.  All of the items should not be on one order form as it would be too busy to challenging to navigate.

so currently we have separated the forms by category and style.  A different zap for each form.  that means each zap creates an order that has to then get consolidated in the back end and shipped as one order.

If it was an add to cart Zap, we could then keep zapping to the cart and submit the order once after the customer reviewed everything and the correct boxes would be generated by the shipping plugin.

Userlevel 7
Badge +11

Thanks for clarifying that @Davey1975

In that case I wonder if a workaround for not being able to add the items to the cart could be to store a record of the order created by the first form in a Zapier table? Suggesting Zapier Tables here as although it involves extra steps, Zapier Tables actions don’t count towards your Zap’s task usage! 😅

In the table record you’d store information like the order ID and the customer, and the date as presumably the forms would be submitted on the same day. Then you could have the Zap check if a record exists for the customer for that same date (and create one if it doesn’t). Then depending on whether or not a new record was created in the table, you’d then use paths to add some branching logic to Zap (also doesn’t count towards your task usage) to either create the order (and then update the table record to add the order ID) or update the existing order using the ID of the record that was found. 

You could also handle that sort of branching logic using filters but would require splitting it out across two Zaps to handle either condition - see our Add branching logic to Zaps with filters guide for more details.

Do you think that sort of approach could work for handling the multiple form submissions for each order?

We are going to stick with the Create Order in Woocommerce function for the time being.

However, I’m having trouble getting the customers pricing correct on the orders.  they are a wholesale customer with the role of “GOLD”.

the pricing should automatically come over with the customer ID, however I see a lot of meta data being created in the way of caching.

 

Any help would be appreciated.

Userlevel 7
Badge +11

Hi @Davey1975! Hmm, judging be the naming of those fields it seems as though they are some sort of a checkbox type field to indicate whether a wholesale price exists or not for those specific product variations associated with the customer. I’m not entirely sure why those fields would be returned with a Find Customer action, but maybe they are added by WooCommerce (or another WordPress plugin?) when a customer places an order as a record/cache of a previous wholesale product they ordered. 

If customers with a role of “GOLD” would be charged the wholesale price for all products then perhaps what’s needed is to obtain the role of the customer from the Find Customer action then to check whether it contains Gold or not using a paths rule condition. If they do have a role of “GOLD” then you could use a Find Product (wooCommerce) action to find the product/variation and obtain the relevant wholesale prices when creating/updating the order. And for non “GOLD” customers a path would run that searches for the relevant product/variation but selects the non-wholesale price for it.

Hope that helps. If I’ve misunderstood or you run into any further trouble on this do let me know!

it doesn’t make a lot of sense that the role is identified, but nothing comes of it. We should be able to link the role pricing to the sku or variation id.

 

meta fields such as _wwp_wholesale_priced and _wwp_wholesale_role are present in every order that our site gets.  However, when i try and map these fields, the price for the product doesn’t actually change.  I even went as far as putting the string of data for wwp_wholesale_priced (yes,yes,yes,yes...) into the formatter and select the role from the Woocommerce find customer step.  Still no luck.

 

 

Userlevel 7
Badge +11

Indeed it does seem odd @Davey1975 that you’re not seeing any prices be returned for the wholesale price fields. I think it might be worth reaching out to our Support team here to see if they’re able to locate the necessary values within the logs or a different field that’s under a different name perhaps. And if needed they can open up a bug report or feature request to so those wholesale pricing fields can be accessed.

Please do keep us in the loop on how you get on with them, eager to know what they find!

Reply