Packing slip document with Woocommerce information

Hello all,

Hope you guys can help me with the following.

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?

The Screenshots
Below the screenshots

Order lines Woocommerce

Scenario

Schermafbeelding 2024-04-18 205556
Schermafbeelding 2024-04-18 205536

Template Doc

Output

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.

3 Likes

Hi Alex,

Thanks for helping me out in this case! I have added an aggregator, but it still only adds online one line to the document.


In woocommerce the following two lines are in the order, now only article
A-frame boshut (21338)
SKU: 884193

is added and not the second line “Legotheek bouwbox”

Any thoughts on how to solve?

What is the output bundle of the iterator? Does it have more than 1 bundle?

3 Likes

Yes, the output gives two bundles (and so the two lines from the woocommerce order).

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.

3 Likes

I personally believe that Google doc doesn’t work good for table to be created in invoice.

I always use html in “compose string” and then cloud convert to convert that html code to pdf.

If you can’t figure out the solution with google doc, then i will suggest to use above method.

I will share my client’s scenario blueprint if required. Let me know.

Princy Jain
Make consultant,
For consulting support: Follow up Automated

3 Likes

@alex.newpath
We’re getting somewhere :slight_smile: 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!


@Princy Would be cool if you could share. the table is not needed as created now but if there a another way…o

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

4 Likes

God it! Almost there, but i have read that Google Docs does not allow HTML to be parsed, so trying to solve this.

Output now:

Scenario

Solved the issue by creating the document in HTML and using the app Google Docs: Create a Document and parsed the html code in this.

@alex.newpath Thanks for all your help and suggestions to get me on the right track!

More information:

2 Likes

Right of course. I remember the Google doc app. Good job!

2 Likes