Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Woo Commerce Product Categories #380

Open
mileaminute opened this issue Nov 18, 2019 · 5 comments

Comments

@mileaminute
Copy link

@mileaminute mileaminute commented Nov 18, 2019

Setup: Clean install of Project Nami install (Web App) with Woo Commerce and their Shopping theme. Everything seems to work except product categories.

Repro:

  1. Select Products\Categories and Add New Category (this is the ending url: wp-admin/edit-tags.php?taxonomy=product_cat&post_type=product). This works correctly and the categories are display in the list on right of screen.
  2. Create another new category. Now both categories are displayed.
  3. Move to another page and return and the list now longer shows items created (but # of items is accurate).

So the data is being stored in database, but somehow I can't retrieve. Another anomaly is when I try to add a product (not category). I don't see any categories shown under All Categories. But I can navigate to Most Used and will see several that I created.

Sidenote: Posts categories work correctly.

@patrickebates

This comment has been minimized.

Copy link
Member

@patrickebates patrickebates commented Nov 18, 2019

Anything in the PHP error log which might shed some light on this?

@mileaminute

This comment has been minimized.

Copy link
Author

@mileaminute mileaminute commented Nov 19, 2019

I was able to pull this with debug enabled:

WordPress database error: [[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Incorrect syntax near the keyword 'as'. Code - 156]
SELECT DISTINCT t., tt. FROM wp_terms AS t LEFT JOIN wp_termmeta ON ( t.term_id = wp_termmeta.term_id AND wp_termmeta.meta_key='order') INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('product_cat') AND (( wp_termmeta.meta_key = 'order' OR wp_termmeta.meta_key IS NULL ) ) ORDER BY CAST(wp_termmeta.meta_value, as, numeric) ASC

I reinstalled again just to be sure. And I didn't make any changes, just went straight to creating a product category. It's a basic Project Nami install. I also didn't activate the plug ins that came with it. Just installed Woo Commerce. Theme is default.

Other info - tags seem to work fine. Also when I click on Name then all the categories show up.

wp1
wp2

@mileaminute

This comment has been minimized.

Copy link
Author

@mileaminute mileaminute commented Nov 19, 2019

I also found that the on the other page I referenced earlier ("I don't see any categories shown under All Categories. But I can navigate to Most Used and will see several that I created." the same error shows up:

wp3

@patrickebates

This comment has been minimized.

Copy link
Member

@patrickebates patrickebates commented Nov 19, 2019

Looks like a problem with the CAST in the ORDER BY clause. Will investigate.

@mileaminute

This comment has been minimized.

Copy link
Author

@mileaminute mileaminute commented Nov 20, 2019

In case this provides any more clues, selecting WooCommerce from the left nav bar, and choosing status displays this message:

PHP Fatal error: Uncaught Error: Call to undefined function mysql_get_server_info() in D:\home\site\wwwroot\wp-content\plugins\woocommerce\includes\wc-core-functions.php:2255
Stack trace:
#0 D:\home\site\wwwroot\wp-content\plugins\woocommerce\packages\woocommerce-rest-api\src\Controllers\Version2\class-wc-rest-system-status-v2-controller.php(641): wc_get_server_database_version()
#1 D:\home\site\wwwroot\wp-content\plugins\woocommerce\packages\woocommerce-rest-api\src\Controllers\Version2\class-wc-rest-system-status-v2-controller.php(569): WC_REST_System_Status_V2_Controller->get_environment_info()
#2 D:\home\site\wwwroot\wp-content\plugins\woocommerce\packages\woocommerce-rest-api\src\Controllers\Version2\class-wc-rest-system-status-v2-controller.php(75): WC_REST_System_Status_V2_Controller->get_item_mappings()
#3 D:\home\site\wwwroot\wp-includes\rest-api\class-wp-rest-server.php(946): WC_REST_System_Status_V2_Controller->get_items(Object(WP_REST_Request))
#4 D:\home\site\wwwroot\wp-includes\rest-api.php(429): WP_REST_Server- in D:\home\site\wwwroot\wp-content\plugins\woocommerce\includes\wc-core-functions.php on line 2255

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.