Iterating over several products in a WooComerce order

-My first scenario, bear with me:)

I have created this system that automatically sends printready files (PDF’s) to the email of our print service.

Works just fine with 1 product, but if an order has 2 products it won’t work - It won’t iterate over several products in the same order. It only iterates over the very first product.

So in the end it will send an email containing the shared link of only the first product and not the second product, nor third and so on… Is there any way to get around this?

I’m using item name to locate the files both in Woocomerce and in Google Drive.

Test order
An order of 2 products: “Plain Foil for Soundboks 2 Backside - Light Blue” and “Plain Foil for Soundboks 3 Grill - Purple”.

1. Setup

2. WooComerce Watch Orders

3. Filter

4. Search for Files/Folders

5. Get a shared link

6. Text aggregator

7. Send an E-mail

Hi,

Welcome to the Make community!

You must add an iterator to iterate through each item line.

Unfortunately, you will have to change all mappings from 1. Line Items []... to the equivalent field from the iterator module.

You can learn more here: how to use iterator module

Hi @Mattis

Please use an Iterator and Text Aggregator in combination to solve your issue.

In Iterator, you can map the line items. Also, ensure that the source of the Text Aggregator is selected as the Iterator module.

Regards,
Msquare Automation - Gold Partner of Make

Book a Free Consultation | Connect Live

Explore our YouTube Channel for valuable insights and updates!

Update:
The system recognize both “purple product” and “blue product” and finds the shared link for both of them perfectly.

But just before it sends the email I use the text aggregator to combine the shared links using file id. This somehow ends up messing everything up as the final e-mail only sends the shared link for the first product “blue” and not the second. Also worth noticing that {{1.lineItems.quantity}} is 1, not 2 for some reason…

Search for Files/folders


Get a shared link

So I got the whole thing working! The only thing is that it sends 2 different e-mail (1 e-mail for each product). I want to send 1 e-mail containing 2 links, not 2 e-mail containing 1 link each.

2 Likes