kilbot / WooCommerce-POS

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

POS not working with WooCommerce 3.6.1 #215

Open doug-6sense opened 5 years ago

doug-6sense commented 5 years ago

When upgrading to Woocommerce 3.6.1 from 3.5.8 the WooCommerce POS UI throws a generic 'error' message and no products or orders will load at all. We have 2 sites using WooCommerce POS Pro and both experience this same error.

Have had to roll back to WooCommerce 3.5.8 to get it to work, I have WooCommerce POS 0.4.22 & WooCommerce POS Pro 0.4.19 installed. please provide a fix.

kilbot commented 5 years ago

Hi Doug,

This is likely due to an Internal Server Error, hopefully it will be written to the WooCommerce logs and we can figure out a solution from there.

Please go to WP Admin > WooCommerce > Status > Logs, then look through the fatal-errors logs. Copy any logged info to the comments below and I will try to help.

doug-6sense commented 5 years ago

Cheers, Below is the log but nothing about WooCommerce POS

2019-04-20T23:24:44+00:00 CRITICAL Uncaught Error: Call to a member function get_cart() on null in /home/shinewholesale/public_html/wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php:159 Stack trace:

0 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(286): VTMIN_Parent_Cart_Validation->vtmin_woo_apply_checkout_cntl('')

1 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)

2 /home/shinewholesale/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)

3 /home/shinewholesale/public_html/wp-settings.php(526): do_action('wp_loaded')

4 /home/shinewholesale/public_html/wp-config.php(90): require_once('/home/shinewhol...')

5 /home/shinewholesale/public_html/wp-load.php(37): require_once('/home/shinewhol...')

6 /home/shinewholesale/public_html/wp-blog-header.php(13): require_once('/home/shinewhol...')

7 /home/shinewholesale/public_html/index.php(17): require('/home/shinewhol...')

8 {main}

thrown in /home/shinewholesale/public_html/wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php on line 159

2019-04-20T23:24:53+00:00 CRITICAL Uncaught Error: Call to a member function get_cart() on null in /home/shinewholesale/public_html/wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php:159 Stack trace:

0 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(286): VTMIN_Parent_Cart_Validation->vtmin_woo_apply_checkout_cntl('')

1 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)

2 /home/shinewholesale/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)

3 /home/shinewholesale/public_html/wp-settings.php(526): do_action('wp_loaded')

4 /home/shinewholesale/public_html/wp-config.php(90): require_once('/home/shinewhol...')

5 /home/shinewholesale/public_html/wp-load.php(37): require_once('/home/shinewhol...')

6 /home/shinewholesale/public_html/wp-blog-header.php(13): require_once('/home/shinewhol...')

7 /home/shinewholesale/public_html/index.php(17): require('/home/shinewhol...')

8 {main}

thrown in /home/shinewholesale/public_html/wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php on line 159

2019-04-20T23:25:18+00:00 CRITICAL Uncaught Error: Call to a member function get_cart() on null in /home/shinewholesale/public_html/wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php:159 Stack trace:

0 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(286): VTMIN_Parent_Cart_Validation->vtmin_woo_apply_checkout_cntl('')

1 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)

2 /home/shinewholesale/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)

3 /home/shinewholesale/public_html/wp-settings.php(526): do_action('wp_loaded')

4 /home/shinewholesale/public_html/wp-config.php(90): require_once('/home/shinewhol...')

5 /home/shinewholesale/public_html/wp-load.php(37): require_once('/home/shinewhol...')

6 /home/shinewholesale/public_html/wp-blog-header.php(13): require_once('/home/shinewhol...')

7 /home/shinewholesale/public_html/index.php(17): require('/home/shinewhol...')

8 {main}

thrown in /home/shinewholesale/public_html/wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php on line 159

2019-04-20T23:28:55+00:00 CRITICAL Uncaught Error: Call to a member function get_cart() on null in /home/shinewholesale/public_html/wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php:159 Stack trace:

0 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(286): VTMIN_Parent_Cart_Validation->vtmin_woo_apply_checkout_cntl('')

1 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)

2 /home/shinewholesale/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)

3 /home/shinewholesale/public_html/wp-settings.php(526): do_action('wp_loaded')

4 /home/shinewholesale/public_html/wp-config.php(90): require_once('/home/shinewhol...')

5 /home/shinewholesale/public_html/wp-load.php(37): require_once('/home/shinewhol...')

6 /home/shinewholesale/public_html/wp-blog-header.php(13): require_once('/home/shinewhol...')

7 /home/shinewholesale/public_html/index.php(17): require('/home/shinewhol...')

8 {main}

thrown in /home/shinewholesale/public_html/wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php on line 159

2019-04-20T23:33:26+00:00 CRITICAL Uncaught Error: Call to a member function get_cart() on null in /home/shinewholesale/public_html/wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php:159 Stack trace:

0 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(286): VTMIN_Parent_Cart_Validation->vtmin_woo_apply_checkout_cntl('')

1 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)

2 /home/shinewholesale/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)

3 /home/shinewholesale/public_html/wp-settings.php(526): do_action('wp_loaded')

4 /home/shinewholesale/public_html/wp-config.php(90): require_once('/home/shinewhol...')

5 /home/shinewholesale/public_html/wp-load.php(37): require_once('/home/shinewhol...')

6 /home/shinewholesale/public_html/wp-blog-header.php(13): require_once('/home/shinewhol...')

7 /home/shinewholesale/public_html/index.php(17): require('/home/shinewhol...')

8 {main}

thrown in /home/shinewholesale/public_html/wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php on line 159

2019-04-20T23:33:39+00:00 CRITICAL Uncaught Error: Call to a member function get_cart() on null in /home/shinewholesale/public_html/wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php:159 Stack trace:

0 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(286): VTMIN_Parent_Cart_Validation->vtmin_woo_apply_checkout_cntl('')

1 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)

2 /home/shinewholesale/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)

3 /home/shinewholesale/public_html/wp-settings.php(526): do_action('wp_loaded')

4 /home/shinewholesale/public_html/wp-config.php(90): require_once('/home/shinewhol...')

5 /home/shinewholesale/public_html/wp-load.php(37): require_once('/home/shinewhol...')

6 /home/shinewholesale/public_html/wp-blog-header.php(13): require_once('/home/shinewhol...')

7 /home/shinewholesale/public_html/index.php(17): require('/home/shinewhol...')

8 {main}

thrown in /home/shinewholesale/public_html/wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php on line 159

2019-04-20T23:34:21+00:00 CRITICAL Uncaught Error: Call to a member function get_cart() on null in /home/shinewholesale/public_html/wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php:159 Stack trace:

0 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(286): VTMIN_Parent_Cart_Validation->vtmin_woo_apply_checkout_cntl('')

1 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)

2 /home/shinewholesale/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)

3 /home/shinewholesale/public_html/wp-settings.php(526): do_action('wp_loaded')

4 /home/shinewholesale/public_html/wp-config.php(90): require_once('/home/shinewhol...')

5 /home/shinewholesale/public_html/wp-load.php(37): require_once('/home/shinewhol...')

6 /home/shinewholesale/public_html/wp-blog-header.php(13): require_once('/home/shinewhol...')

7 /home/shinewholesale/public_html/index.php(17): require('/home/shinewhol...')

8 {main}

thrown in /home/shinewholesale/public_html/wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php on line 159

2019-04-20T23:34:56+00:00 CRITICAL Uncaught Error: Call to a member function get_cart() on null in /home/shinewholesale/public_html/wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php:159 Stack trace:

0 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(286): VTMIN_Parent_Cart_Validation->vtmin_woo_apply_checkout_cntl('')

1 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)

2 /home/shinewholesale/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)

3 /home/shinewholesale/public_html/wp-settings.php(526): do_action('wp_loaded')

4 /home/shinewholesale/public_html/wp-config.php(90): require_once('/home/shinewhol...')

5 /home/shinewholesale/public_html/wp-load.php(37): require_once('/home/shinewhol...')

6 /home/shinewholesale/public_html/wp-blog-header.php(13): require_once('/home/shinewhol...')

7 /home/shinewholesale/public_html/index.php(17): require('/home/shinewhol...')

8 {main}

thrown in /home/shinewholesale/public_html/wp-content/plugins/minimum-purchase-for-woocommerce/woo-integration/vtmin-parent-cart-validation.php on line 159

2019-04-20T23:36:28+00:00 CRITICAL Uncaught Error: Call to private method WC_Tracker::get_product_counts() from context 'WC_Tracks' in /home/shinewholesale/public_html/wp-content/plugins/woocommerce/includes/tracks/class-wc-tracks.php:24 Stack trace:

0 /home/shinewholesale/public_html/wp-content/plugins/woocommerce/includes/tracks/class-wc-site-tracking.php(68): WC_Tracks::get_products_count()

1 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(286): WC_Site_Tracking::add_tracking_function('')

2 /home/shinewholesale/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)

3 /home/shinewholesale/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)

4 /home/shinewholesale/public_html/wp-admin/admin-footer.php(73): do_action('admin_footer', '')

5 /home/shinewholesale/public_html/wp-admin/admin.php(288): include('/home/shinewhol...')

6 /home/shinewholesale/public_html/wp-admin/index.php(10): require_once('/home/shinewhol...')

7 {main}

thrown in /home/shinewholesale/public_html/wp-content/plugins/woocommerce/includes/tracks/class-wc-tracks.php on line 24

doug-6sense commented 5 years ago

Hold the phone. I've located & fixed the fatal error in the 'Minimum Purchase' plugin & now WooCommerce POS is showing products & orders.

Thanks you made me look where I needed to

doug-6sense commented 5 years ago

Ok spoke too soon now that the plugin fatal error is solved did some testing & receiving fatal error for some of the payment options set up in WooCommerce when used via WooCommerce POS. The Cash & Credit Card payment options work but getting fatal errors on cheque, bacs & cod. Log is below

2019-04-21T05:11:23+00:00 CRITICAL Uncaught Error: Call to a member function empty_cart() on null in /home/shinewholesale/public_html/wp-content/plugins/woocommerce/includes/gateways/cod/class-wc-gateway-cod.php:285 Stack trace:

0 /home/shinewholesale/public_html/wp-content/plugins/woocommerce-pos/includes/apiv2/class-wc-pos-orders.php(180): WC_Gateway_COD->process_payment(67669)

1 /home/shinewholesale/public_html/wp-includes/rest-api/endpoints/class-wp-rest-controller.php(423): WC_POS_APIv2_Orders->update_payment_details(Array, Object(WC_Order), 'payment_details', Object(WP_REST_Request), 'shop_order')

2 /home/shinewholesale/public_html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-rest-crud-controller.php(198): WP_REST_Controller->update_additional_fields_for_object(Object(WC_Order), Object(WP_REST_Request))

3 /home/shinewholesale/public_html/wp-includes/rest-api/class-wp-rest-server.php(946): WC_REST_CRUD_Controller->create_item(Object(WP_REST_Request))

4 /home/shinewholesale/public_html/wp-includes/rest-api/class-wp-re in /home/shinewholesale/public_html/wp-content/plugins/woocommerce/includes/gateways/cod/class-wc-gateway-cod.php on line 285

2019-04-21T05:11:37+00:00 CRITICAL Uncaught Error: Call to a member function empty_cart() on null in /home/shinewholesale/public_html/wp-content/plugins/woocommerce/includes/gateways/bacs/class-wc-gateway-bacs.php:370 Stack trace:

0 /home/shinewholesale/public_html/wp-content/plugins/woocommerce-pos/includes/apiv2/class-wc-pos-orders.php(180): WC_Gateway_BACS->process_payment(67670)

1 /home/shinewholesale/public_html/wp-includes/rest-api/endpoints/class-wp-rest-controller.php(423): WC_POS_APIv2_Orders->update_payment_details(Array, Object(WC_Order), 'payment_details', Object(WP_REST_Request), 'shop_order')

2 /home/shinewholesale/public_html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-rest-crud-controller.php(198): WP_REST_Controller->update_additional_fields_for_object(Object(WC_Order), Object(WP_REST_Request))

3 /home/shinewholesale/public_html/wp-includes/rest-api/class-wp-rest-server.php(946): WC_REST_CRUD_Controller->create_item(Object(WP_REST_Request))

4 /home/shinewholesale/public_html/wp-includes/rest-api/class-wp in /home/shinewholesale/public_html/wp-content/plugins/woocommerce/includes/gateways/bacs/class-wc-gateway-bacs.php on line 370

2019-04-21T05:11:43+00:00 CRITICAL Uncaught Error: Call to a member function empty_cart() on null in /home/shinewholesale/public_html/wp-content/plugins/woocommerce/includes/gateways/cheque/class-wc-gateway-cheque.php:128 Stack trace:

0 /home/shinewholesale/public_html/wp-content/plugins/woocommerce-pos/includes/apiv2/class-wc-pos-orders.php(180): WC_Gateway_Cheque->process_payment(67671)

1 /home/shinewholesale/public_html/wp-includes/rest-api/endpoints/class-wp-rest-controller.php(423): WC_POS_APIv2_Orders->update_payment_details(Array, Object(WC_Order), 'payment_details', Object(WP_REST_Request), 'shop_order')

2 /home/shinewholesale/public_html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-rest-crud-controller.php(198): WP_REST_Controller->update_additional_fields_for_object(Object(WC_Order), Object(WP_REST_Request))

3 /home/shinewholesale/public_html/wp-includes/rest-api/class-wp-rest-server.php(946): WC_REST_CRUD_Controller->create_item(Object(WP_REST_Request))

4 /home/shinewholesale/public_html/wp-includes/rest-api/cl in /home/shinewholesale/public_html/wp-content/plugins/woocommerce/includes/gateways/cheque/class-wc-gateway-cheque.php on line 128

kilbot commented 5 years ago

Great! I'm glad you found a fix.

In WooCommerce 3.6 they restricted the classes loaded during the REST API lifecycle, this is going to be better for performance in the long run, but it will cause some Internal Server Errors in the short term as some plugins will be calling class methods that are no longer available.

kilbot commented 5 years ago

Thanks for the info about the Cheque and BACS gateways, I will apply a fix shortly.

doug-6sense commented 5 years ago

Hi Mate, I have one more question. Is their a way I can change the name of the payment gateway ID that POS assigns to the payment method used. I'm wanting to change the cod option to 30_day_account. The reason is we push our wholesale orders to XERO (it pushes the gateway ID as the reference) and cod is causing confusion for our staff when they process orders

kilbot commented 5 years ago

The easiest way would be to edit the COD class->id directly, ie: change this line. However, this would be blown away every time WooCommerce is updated - which could get tiresome.

A better solution would be to copy the COD logic and create a new Payment Gateway plugin.

doug-6sense commented 5 years ago

Thanks mate. I'll give the plugin creation a go. I had altered the WooCommerce but wasn't looking forward to do again every update.

doug-6sense commented 5 years ago

Hi Mate,

I'm trying to hide the plus button on out of stock items in the POS. I've tried wrapping the code in the tmpl-product.php file with a filter but it seems the in_stock option is not working for me.

{{#is in_stock 'true'}}

class="action">

{{/is}}

Any thoughts?