Sort Line Items from Woocommerce by product type

NLL

Member
Your Task History ID
IjU3NjYwNTZlMDYzMDA0MzQ1MjZhNTUzMDUxMzEi_pc
Is there a way to have line items from woocommerce be sorted out by product type, let's say we have multiple rooms and multiple items. So we want to put the data into our CRM. The problem is Line Items follow the order in the cart and when we put them in our CRM. It skips a few fields, i.e

Order 1
Room A
Accessories A
Accessories B
Room B

Right now it's going with

R1 = Room A
R2 = Empty
R3 = Empty
R4 = Room B

A1 = Empty
A2 = Accessories A
A3 = Accessories B
A4 = Empty

What we want is to have it like this below

R1 = Room A
R2 = Room B
R3 = Empty
R4 = Empty

A1 = Accessories A
A2 = Accessories B
A3 = Empty
A4 = Empty
 

ArshilAhmad

Well-known member
Staff member
Hi @NLL,

It's not possible to get the data in the format you desire using Line Itemizer. You can write a script (or ask ChatGPT to write one for you) and execute it using the 'Code (Pabbly)' module to convert the JSON into your desired format.
 
Top