Best answer

Filtered WooCommerce "Order Trigger" creating action for all products

  • 15 April 2022
  • 4 replies
  • 169 views

I currently have two domains with Woocommerce on it. One is primarily for license keys that get sent when certain products are ordered.

 

For Example, A new customer purchases a membership to my program and received a certificate for 7 night resort stay. The sales rep adds the following line Items:

Sku: Platinum199 (this is the membership)

Sku: NMB3NCERT (this is a certificate for a 3 night bonus stay)

 

I’ve set up the filters to read read and create an order based on the voucher (2night, 3night, 7night). It’s supposed to trigger an order for a license Key to be sent from my other domain to the used so they can log in and activate the certificate using that license key. It works fine when I test an order with a single voucher, but I run into a problem when there are multiple vouchers and or additional products on the order.

 

In the example above, the filter is set to trigger when the order goes complete and have the NMB3NCERT, then it should place an order for 1(one) license key for the 7 night license Key. What’s happening is that it’s creating a license key for every sku in the order. The same should apply if I had a 3-night cert and a 7-night cert. The new order that’s created should only be for 1(one) 3-night license key and 1(one) 7-night license key.

 

So here is what I want:

Customer order:

Sku: Platinum199 (this is the membership)

Sku: NMB3NCERT (this is a certificate for a 3-night bonus stay)

Sku: NMB7NCERT (this is a certificate for a 7-night bonus stay)

 

Zapier collects data and triggers new order for:

sku: CERT3NHS (one license key for the 3-night stay)

sku: CERT7NRS (one license Key for 7 night stay)

 

Additional Note: I currently have the different certs on 3 different zaps and understand that I’ll probably mean to keep it that way with the customer receiving 2 separate emails, one with each license Key. That’s what I expect. I would be nice to put them together but I’m ok if that can’t be done.

icon

Best answer by jesse 22 April 2022, 20:04

View original

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

4 replies

Userlevel 7
Badge +9

@tfredella were you able to incorporate the suggestions from this thread to get to a solution? We’d love to hear how you’re doing and help out if you’re stuck! I know order/line item logic can get tricky sometimes! 😉

In the meantime, I am going to summarizes the other suggestions from this thread, for anyone following along:

From whatever I understood, please use a database like Airtable to collect all the Order data from your first woocommerce site using the Order Status as both Processing or Completed instead of only Complete.Then create zaps with Paths and Filter Condition to create orders on your other woocommerce from the data collected in the airtable base.

You can use the Looping app in the Zap to handle the order line item data individually: https://zapier.com/apps/looping/integrations#triggers-and-actions

 

Userlevel 4
Badge +6

Hello @tfredella 

From whatever I understood, please use a database like Airtable to collect all the Order data from your first woocommerce site using the Order Status as both Processing or Completed instead of only Complete.Then create zaps with Paths and Filter Condition to create orders on your other woocommerce from the data collected in the airtable base.

Thank you. for the suggestions. I’m sure that would have worked too, but I figured out that you can run the filters inside the data fields as well. By adding the “only if true” filter to the new order fee line seems to prevent it from running. 

 

I have 4 zaps set up based on 4 license keys now. Even If I put two of the product dkus into one sale, It will only send one license key for each product now. It sends them out in separate emails but that’s fine for now. I having someone redoing my site so this should only need to be a temporary solution.

Userlevel 7
Badge +14

Hi @tfredella 

Good question.

You can use the Looping app in the Zap to handle the order line item data individually: https://zapier.com/apps/looping/integrations#triggers-and-actions