Our goal
We want to create an own packing slip (rental slip) for our clients / ourselves so we can add information to this slip from a custom point of view.
We know there are woocommerce plugins who can create these but we want to automate them so the slips are automaticly printer by our printer and are ready to be picked by our staff members.
What we done so far
We created an scenario where we watch orders in Woocommerce who have a particular status. Then a document is created by a template in our Google Docs and all variables are insert so the document has the needed information, then the document is downloaded as a PDF and send to our printer which is located in the picking area. When printed the picker gets the document and starts picking.
Now the issue is that we want to add the products in a table on our template, but for some reason we do not get all the products (looped) in this table. We tried to use Interator as solution but then ending up getting a slip for every order line. Also tried join and map, but no solution thereâŚ
Help needed!
What we are looking for is a solution to âloopâ all productline within the woocommerce order and get it parsed in the table. Anyone in this lovely community that has an idea how to manage this?
Your iterator will indeed execute the rest of the modules after it for everey item in the LineItems array, because that is what an iterator does. Why donât you put a text aggregator after the iterator to create the necessary text you wish to dump into the document? And then insert that into the document in the right place after the text aggregator.
Aggregators turn multiple bundles (the output of the iterator) into 1 bundle.
And I assume the array aggregator has both bundles in one array too? How do you place this aggregated data into the document? You may consider using a text aggregator instead of an array aggregator to create the necessary text structure from the iterator.
If the array is coming out of the woocommerce watch orders module you could text aggregate it directly from there without the iterator but for now letâs keep the iterator there.
@alex.newpath
Weâre getting somewhere I added the text aggregator and it shows both lines, now only need to see how to add them to the table. Thanks for your help so far, learning on the job but also happy it looks like weâre hitting our goal!
I suggest you build all the tabular text for google doc in your text aggregator and then put that in rather than trying to fit it into an unstructured Google doc table. You may be able to build the table in HTML and then jam it into the google doc - canât remember if that works or not. Anything works in the text aggregator as you can generate a table using the right row separator