kilbot / WooCommerce-POS

:bangbang: All development now at https://github.com/wcpos.
http://wcpos.com
GNU General Public License v3.0
353 stars 125 forks source link

Error excepting cash payment #126

Closed gwoodbridge closed 8 years ago

gwoodbridge commented 8 years ago

Hello, I'm getting an error when trying to use cash payment. "Unexpected token < in JSON at position 0. However, the orders are still showing up on the orders page." Any ideas?

kilbot commented 8 years ago

Is there an 'i' icon next to the 'Unexpected token ...' message? If so, click that and look for the unexpected token - it will usually be some text or html which is breaking the returned json.

Edit: given it is at position 0, the error message should be the first line before the json.

gwoodbridge commented 8 years ago

Here is what it says: wp-content/plugins/woocommerce-warehouses/includes/IM_Warehouse_Order.php on line 1095 {"order":{"id":3275,"order_number":3275,"order_key":"wc_order_57676a5868f58","created_at":"2016-06-20T04:00:24Z","updated_at":"2016-06-20T04:00:24Z","completed_at":"2016-06-20T03:00:24Z","status":"on-hold","currency":"USD","total":"42.15","subtotal":"39.95","total_line_items_quantity":1,"total_tax":"2.20","total_shipping":"0.00","cart_tax":"2.20","shipping_tax":"0.00","total_discount":"0.00","shipping_methods":"","payment_details":{"method_id":"pos_cash","method_title":"Cash","paid":true,"result":"success","message":"","redirect":"","method_pos_cash":{"tendered":"42.1473","change":"0"}},"billing_address":{"first_name":"","last_name":"","company":"","address_1":"","address_2":"","city":"","state":"","postcode":"","country":"","email":"","phone":""},"shipping_address":{"first_name":"","last_name":"","company":"","address_1":"","address_2":"","city":"","state":"","postcode":"","country":""},"note":"","customer_ip":"38.66.6.93","customer_user_agent":"Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/51.0.2704.103 Safari\/537.36","customer_id":0,"view_order_url":"http:\/\/www.impactfireworks.net\/my-account\/view-order\/3275","line_items":[{"id":109,"subtotal":"39.95","subtotal_tax":"2.20","total":"39.95","total_tax":"2.20","price":"39.95","quantity":1,"tax_class":null,"name":".30 Caliber Mini Cannon","product_id":1972,"sku":"IM 0900","meta":[],"cogs_cost":null,"cogs_total_cost":null}],"shipping_lines":[],"tax_lines":[{"id":110,"rate_id":"1","code":"US-MAIN-1","title":"Main","total":"2.20","compound":false}],"fee_lines":[],"coupon_lines":[],"is_vat_exempt":false,"customer":{"id":0,"email":"","first_name":"","last_name":"","billing_address":{"first_name":"","last_name":"","company":"","address_1":"","address_2":"","city":"","state":"","postcode":"","country":"","email":"","phone":""},"shipping_address":{"first_name":"","last_name":"","company":"","address_1":"","address_2":"","city":"","state":"","postcode":"","country":""}},"cashier":{"id":"2","first_name":"John","last_name":" Doe"},"subtotal_tax":"2.2","cart_discount_tax":"0","cogs_total_cost":null}}

kilbot commented 8 years ago

That is your error: wp-content/plugins/woocommerce-warehouses/includes/IM_Warehouse_Order.php on line 1095.

It looks like there is some words missing from the start of the error message, eg: PHP Notice, blah blah ... IM_Warehouse_Order.php on line 1095

In any case, the error is caused by Woocommerce Warehouses plugin at the line given in the error. You should contact the plugin author and let them know.