• Resolved topopti

    (@topopti)


    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!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi there @topopti 👋

    Welcome to WooCommerce Support. I’d be happy to help you with this.

    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.

    Just to clarify, are you referring to utilizing WooCommerce Tax at your store, and noticed this, or otherwise?

    To get an idea of how your site is configured, could you please share a copy of your site’s System Status, as exemplified here? Kindly paste it here in your response.

    Looking forward to hearing from you!

    Thread Starter topopti

    (@topopti)

    We updated to the latest version of WooCommerce Shipping and Tax which fixed the issue.

    Thank you!

    Hey @topopti,

    I’m glad to hear that updating did the trick!

    I’ll go ahead and mark this as resolved then – feel free to create a new topic if you need any further help. 🙂

    Also, if you have a minute, we’d love it if you could leave us a review:

    https://ww.wp.xz.cn/support/plugin/woocommerce/reviews/

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Issue with woocommerce_refund_line_items’ is closed to new replies.