How to get WooCommerce Product IDs from line items order?
I do have WooCommerce orders with line items (i.e. an order with multiple products). And I want to migrate the orders from an old WooCommerce site to a new one.
The problem is that the product IDs aren’t the same on both sites. My idea now was to search for the existing products in the new woocommerce site using their SKUs (as unique identifier) and get their responding product IDs to link it with the correct product on the new site.
But the SKUs are available as line items (sku1, sku2, sku3 etc.). So how can I from each SKU the corresponding product ID? Do I have to use “Looping by Zapier”
Hi Troy, wow that was quick. But I do not understand how Looping is working. Because I need to search for the product IDs of all line items on the new site using the unique SKU.
My plan was to:
Get Product ID for first product (using the first line item/SKU)
Get Product ID for second product (using the second line item/SKU)
Get Product ID for third product (using the third line item/SKU)
And later to create a new order on the new site using the newly retrieved Product IDs from the new site and add it again as line items (10001, 10002, 10003).
So I tried to do this:
Then I added a new step “Find Product in WooCommerce” and searched for the products using the SKU. But I only got the first product/line item.
I think I am something completely wrong.
@michael291
Did you review the available help article that covers Looping?
Looping is a pretty advanced function and it can be tricky to catch everything when you’re using it for the first time, but it It looks like you have things set up the way that you need, nice work
Are you able to test the Zap with a new WooCommerce order? That’s the best way to make sure that it’s working as intended.