Support » Plugin: WooCommerce » SyntaxError: Unexpected token a in JSON at position 0

  • Resolved fede77

    (@fede77)


    When I try to pay with bank transfer I get this error:
    SyntaxError: Unexpected token a in JSON at position 0

    In console:
    Unable to fix malformed JSON checkout.min.js:1

    Network: ?wc-ajax=checkout
    array(13) {
    [“name”]=>
    string(11) “Pizarra Oso”
    [“type”]=>
    string(9) “line_item”
    [“item_meta”]=>
    array(9) {
    [“_qty”]=>
    array(1) {
    [0]=>
    string(1) “1”
    }
    [“_tax_class”]=>
    array(1) {
    [0]=>
    string(0) “”
    }
    [“_product_id”]=>
    array(1) {
    [0]=>
    string(4) “3252”
    }
    [“_variation_id”]=>
    array(1) {
    [0]=>
    string(1) “0”
    }
    [“_line_subtotal”]=>
    array(1) {
    [0]=>
    string(3) “490”
    }
    [“_line_total”]=>
    array(1) {
    [0]=>
    string(3) “490”
    }
    [“_line_subtotal_tax”]=>
    array(1) {
    [0]=>
    string(1) “0”
    }
    [“_line_tax”]=>
    array(1) {
    [0]=>
    string(1) “0”
    }
    [“_line_tax_data”]=>
    array(1) {
    [0]=>
    string(45) “a:2:{s:5:”total”;a:0:{}s:8:”subtotal”;a:0:{}}”
    }
    }
    [“item_meta_array”]=>
    array(9) {
    [15885]=>
    object(stdClass)#13248 (2) {
    [“key”]=>
    string(4) “_qty”
    [“value”]=>
    string(1) “1”
    }
    [15886]=>
    object(stdClass)#13246 (2) {
    [“key”]=>
    string(10) “_tax_class”
    [“value”]=>
    string(0) “”
    }
    [15887]=>
    object(stdClass)#13244 (2) {
    [“key”]=>
    string(11) “_product_id”
    [“value”]=>
    string(4) “3252”
    }
    [15888]=>
    object(stdClass)#13242 (2) {
    [“key”]=>
    string(13) “_variation_id”
    [“value”]=>
    string(1) “0”
    }
    [15889]=>
    object(stdClass)#13240 (2) {
    [“key”]=>
    string(14) “_line_subtotal”
    [“value”]=>
    string(3) “490”
    }
    [15890]=>
    object(stdClass)#13222 (2) {
    [“key”]=>
    string(11) “_line_total”
    [“value”]=>
    string(3) “490”
    }
    [15891]=>
    object(stdClass)#13216 (2) {
    [“key”]=>
    string(18) “_line_subtotal_tax”
    [“value”]=>
    string(1) “0”
    }
    [15892]=>
    object(stdClass)#13234 (2) {
    [“key”]=>
    string(9) “_line_tax”
    [“value”]=>
    string(1) “0”
    }
    [15893]=>
    object(stdClass)#13233 (2) {
    [“key”]=>
    string(14) “_line_tax_data”
    [“value”]=>
    string(45) “a:2:{s:5:”total”;a:0:{}s:8:”subtotal”;a:0:{}}”
    }
    }
    [“qty”]=>
    string(1) “1”
    [“tax_class”]=>
    string(0) “”
    [“product_id”]=>
    string(4) “3252”
    [“variation_id”]=>
    string(1) “0”
    [“line_subtotal”]=>
    string(3) “490”
    [“line_total”]=>
    string(3) “490”
    [“line_subtotal_tax”]=>
    string(1) “0”
    [“line_tax”]=>
    string(1) “0”
    [“line_tax_data”]=>
    string(45) “a:2:{s:5:”total”;a:0:{}s:8:”subtotal”;a:0:{}}”
    }

    I try change the PHP version since 7 to 5.5 but error continue. Theme is actualized. Woo v2.6.14. Try to update it before but it gives me many errors. Now I try to update in local but it is stuck and it never updates.

    How can i fix this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • That looks like debug information that was left somewhere, might need a fresh install or to go in and look for any var_dump functions

    Thanks for your time.

    Can explain me how can i get that? I need to repair that urgent

    Search through your files, there is code within it that is breaking the AJAX

    Sorry but I’m new to WP, do you say I look for a var_dump function in all the php codes of the site? Or in any specific?

    Fixed with the update of woocommerce. Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘SyntaxError: Unexpected token a in JSON at position 0’ is closed to new replies.