projectnami
projectnami copied to clipboard
Woo Commerce Product Categories
Setup: Clean install of Project Nami install (Web App) with Woo Commerce and their Shopping theme. Everything seems to work except product categories.
Repro:
- 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.
- Create another new category. Now both categories are displayed.
- 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.
Anything in the PHP error log which might shed some light on this?
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.
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:
Looks like a problem with the CAST in the ORDER BY clause. Will investigate.
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