LondonWebDesignCompany
Member
Hi I have a workflow where im trying to capture woocommerce orders and send them to myself via WhastApp Cloud API in a message template.
So far I have successfully set it all up and managed to get the template approved and passed acros the order id, the date of the order, the customer name, phone number and delivery address, and the total price.
The only part that isnt working are the details of the actual items ordered from the Line Items in the Woocommerce order.
When I map and send this over in a whatsapp message, it simply says "Array", and no order details are included.
I have searched the forum to find how to format the Line Items so that I can send them in rows in the message template.
I need to convert this:
[{"id":77,"name":"Porterhouse Steak \/ T-Bone Steak","product_id":208,"variation_id":0,"quantity":2,"tax_class":"","subtotal":"49.96","subtotal_tax":"0.00","total":"49.96","total_tax":"0.00","taxes":[],"meta_data":[],"sku":"","price":24.98,"image":{"id":"209","src":"https:\/\/chadwicksfarmshop.co.uk\/wp-content\/uploads\/2021\/01\/t-bone-steak.jpg"},"parent_name":null},{"id":78,"name":"Rump Steak","product_id":1857,"variation_id":0,"quantity":2,"tax_class":"","subtotal":"43.96","subtotal_tax":"0.00","total":"43.96","total_tax":"0.00","taxes":[],"meta_data":[],"sku":"","price":21.98,"image":{"id":"1858","src":"https:\/\/chadwicksfarmshop.co.uk\/wp-content\/uploads\/2023\/10\/PHOTO-2023-10-20-08-31-50.jpg"},"parent_name":null},{"id":79,"name":"Cumberland Sausages","product_id":1209,"variation_id":0,"quantity":1,"tax_class":"","subtotal":"4.50","subtotal_tax":"0.00","total":"4.50","total_tax":"0.00","taxes":[],"meta_data":[],"sku":"","price":4.5,"image":{"id":"1195","src":"https:\/\/chadwicksfarmshop.co.uk\/wp-content\/uploads\/2023\/09\/PHOTO-2023-09-27-20-23-23.jpg"},"parent_name":null}]
to this:
2 x Porterhouse Steak £46.96
2 x Rump Steak £43.96
1 x Sausages £4.50
and then send that as a single value to the message template.
Please can someone explain clearly how to do this, im running out of time to get this working, otherwise I will have to cancel and get a refund,
but I don't want to do that, I want to get Pabbly Connect sending my orders to me via WhatsApp.
So far I have successfully set it all up and managed to get the template approved and passed acros the order id, the date of the order, the customer name, phone number and delivery address, and the total price.
The only part that isnt working are the details of the actual items ordered from the Line Items in the Woocommerce order.
When I map and send this over in a whatsapp message, it simply says "Array", and no order details are included.
I have searched the forum to find how to format the Line Items so that I can send them in rows in the message template.
I need to convert this:
[{"id":77,"name":"Porterhouse Steak \/ T-Bone Steak","product_id":208,"variation_id":0,"quantity":2,"tax_class":"","subtotal":"49.96","subtotal_tax":"0.00","total":"49.96","total_tax":"0.00","taxes":[],"meta_data":[],"sku":"","price":24.98,"image":{"id":"209","src":"https:\/\/chadwicksfarmshop.co.uk\/wp-content\/uploads\/2021\/01\/t-bone-steak.jpg"},"parent_name":null},{"id":78,"name":"Rump Steak","product_id":1857,"variation_id":0,"quantity":2,"tax_class":"","subtotal":"43.96","subtotal_tax":"0.00","total":"43.96","total_tax":"0.00","taxes":[],"meta_data":[],"sku":"","price":21.98,"image":{"id":"1858","src":"https:\/\/chadwicksfarmshop.co.uk\/wp-content\/uploads\/2023\/10\/PHOTO-2023-10-20-08-31-50.jpg"},"parent_name":null},{"id":79,"name":"Cumberland Sausages","product_id":1209,"variation_id":0,"quantity":1,"tax_class":"","subtotal":"4.50","subtotal_tax":"0.00","total":"4.50","total_tax":"0.00","taxes":[],"meta_data":[],"sku":"","price":4.5,"image":{"id":"1195","src":"https:\/\/chadwicksfarmshop.co.uk\/wp-content\/uploads\/2023\/09\/PHOTO-2023-09-27-20-23-23.jpg"},"parent_name":null}]
to this:
2 x Porterhouse Steak £46.96
2 x Rump Steak £43.96
1 x Sausages £4.50
and then send that as a single value to the message template.
Please can someone explain clearly how to do this, im running out of time to get this working, otherwise I will have to cancel and get a refund,
but I don't want to do that, I want to get Pabbly Connect sending my orders to me via WhatsApp.