Issue with woocommerce_refund_line_items
-
Hi guys,
I am running TaxJar through jetpack and when we try to refund an item we’re getting the following error generated by the woocommerce-services-new-order-taxjar-2.4.1.js file inside of Jetpack.VM31754:1 Uncaught SyntaxError: Expected ',' or '}' after property value in JSON at position 165 (line 1 column 166)
at JSON.parse ()
at HTMLDocument. (woocommerce-services-new-order-taxjar-2.4.1.js:1:1153)The string we’re trying to parse looks like
{"action":"woocommerce_refund_line_items","order_id":"38812","refund_amount":"","refunded_amount":"5","refund_reason":"","line_item_qtys":"{}","line_item_totals":"{"99046":0,"99047":0}","line_item_tax_totals":"{"99046":{"42":0},"99047":{"42":0}}", ...}It looks like there’s an issue with the way the line items are being generated here in /woocommerce/assets/js/admin/meta-boxes-order.js
var data = { action : 'woocommerce_refund_line_items', order_id : woocommerce_admin_meta_boxes.post_id, refund_amount : refund_amount, refunded_amount : refunded_amount, refund_reason : refund_reason, line_item_qtys : JSON.stringify( line_item_qtys, null, '' ), line_item_totals : JSON.stringify( line_item_totals, null, '' ), line_item_tax_totals : JSON.stringify( line_item_tax_totals, null, '' ), api_refund : $( this ).is( '.do-api-refund' ), restock_refunded_items: $( '#restock_refunded_items:checked' ).length ? 'true': 'false', security : woocommerce_admin_meta_boxes.order_item_nonce };Any help would be much appreciated!
The topic ‘Issue with woocommerce_refund_line_items’ is closed to new replies.