• Instructions to Ask a Question

    Click on the "Ask a Question" button and select the application for which you would like to ask questions.

    We have 5 different products namely - Pabbly Connect, Pabbly Subscription Billing, Pabbly Email Marketing, Pabbly Form Builder, Pabbly Email Verification.

    The turnaround time is 24 hrs (Business Hours - 10.00 AM to 6.00 PM IST, Except Saturday and Sunday). So your kind patience will be highly appreciated!

    🚀🚀Exclusive Discount Offer

    Just in case you're looking for any ongoing offers on Pabbly, you can check the one-time offers listed below. You just need to pay once and use the application forever -
     

    🔥 Pabbly Connect One Time Plan for $249 (🏆Lifetime Access) -  View offer 

    🔥 Pabbly Subscription Billing One Time Plan for $249 (🏆Lifetime Access) - View offer

WooCommerce line item discounts to Zoho Books invoices

Status
Not open for further replies.
Hello team! I have a workflow set up that creates a Zoho Books Invoice (multi-line) from WooCommerce orders. I am using the Data Transformer to break out the line items, which is working great!

The problem I'm running into is adding discounts to the line items. WooCommerce does not have a line item discount field, only the total order discount. To get the line item discount, you have to subtract the Line Item Total from the Line Item Subtotal (see screenshot).

When I try to do this by creating a SUBTRACT funtion in the Number Formatter, it does not work properly because it is seeing all of the comma separated values..

How can I extract the data to create a Line Item Discount?

Thanks for your help!
 

Attachments

  • Screenshot 2023-04-10 171306.jpg
    Screenshot 2023-04-10 171306.jpg
    59.3 KB · Views: 75

Supreme

Well-known member
Staff member
The problem I'm running into is adding discounts to the line items. WooCommerce does not have a line item discount field, only the total order discount. To get the line item discount, you have to subtract the Line Item Total from the Line Item Subtotal (see screenshot).
Regarding your concern about the line item for a discount price, we have added a JavaScript code in the workflow to calculate the individual products' discounts.

Kindly try it and let us know if that works for you.

1681208058729.png
 
It seems to be headed the right direction, however, the result needs to end up in an array so it can apply to the subsequent line items. It should be more like 4. Output : 0,5 and allow for infinite values based on the number of line items in the order.
 

Attachments

  • Screenshot 2023-04-11 095043.jpg
    Screenshot 2023-04-11 095043.jpg
    94.2 KB · Views: 79

Supreme

Well-known member
Staff member
Hey @nicole watt

Please check your workflow once we have parsed the discount line item from the JavaScript Code to Text Formatter and after parsing the line item discount.

I hope this might help you out.

1681276745499.png
 
YES!!! Oh, that's wonderful! It works perfectly. I tried it with 4 items and multiple discounts, and the results came out as expected. Thank you so much for your help!
 
Status
Not open for further replies.
Top