• Instructions to Ask a Question

    For any assistance, please click the "Ask a Question" button and select the Pabbly product for which you require support.

    We offer seven comprehensive applications designed to help you efficiently manage and grow your business:

    Our support team endeavors to respond within 24 business hours (Monday to Friday, 10:00 AM to 6:00 PM IST). We appreciate your understanding and patience.

    🚀 Exclusive Lifetime Offers 🚀

    We invite you to take advantage of our special one-time payment plans, providing lifetime access to select applications:

    • 🔥 Pabbly Connect — Lifetime Access for $249View Offer
    • 🔥 Pabbly Subscription Billing — Lifetime Access for $249View Offer
    • 🔥 Pabbly Chatflow — Lifetime Access for $249View Offer

    Make a one-time investment and enjoy the advantages of robust business management tools for years to come.

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: 132
P

Pabblymember11

Guest
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: 153
P

Pabblymember11

Guest
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