Home › Forums › WoodMart support forum › WordPress database error for Unknown column
WordPress database error for Unknown column
- This topic has 9 replies, 2 voices, and was last updated 1 year ago by
Artem Temos.
-
AuthorPosts
-
March 22, 2024 at 8:01 pm #551555
supp0rtParticipantHello,
Recently I was doing some debugging on another problem and I came across these errors below:
1. WordPress database error Unknown column 'on_sale' in 'where clause' for query SELECT product_id FROM prefix_wishlist_products WHERE on_sale = 1 made by do_action_ref_array('woodmart_wishlist_register_on_sales_products'), WP_Hook->do_action, WP_Hook->apply_filters, XTS\WC_Wishlist\Send_On_Sales_Products->register_on_sales_products, XTS\WC_Wishlist\Send_On_Sales_Products->get_product_id_which_on_sale
2. WordPress database error Unknown column 'on_sale' in 'field list' for query UPDATE
prefix_woodmart_wishlist_productsSET
on_sale= '1' WHERE
product_id= '1212' made by do_action_ref_array('woodmart_wishlist_register_on_sales_products'), WP_Hook->do_action, WP_Hook->apply_filters, XTS\WC_Wishlist\Send_On_Sales_Products->register_on_sales_products, XTS\WC_Wishlist\Send_On_Sales_Products->update_on_sale_for_product
Can this be fixed? Are there any settings that I might set wrong and cause this error?
Best Regards
March 25, 2024 at 10:03 am #551889
Artem TemosKeymasterHello,
Please disable any plugins that are not directly related to our website’s theme and provide us with your admin and FTP access details. We will log in to your account and investigate the issue. Please ensure that you only keep the following plugins that are necessary for our theme to work correctly:
– WoodMart core
– WooCommerce
– Elementor/WPBakery Page BuilderThank you in advance.
March 26, 2024 at 4:01 pm #552426
supp0rtParticipantHello,
Below in the Extra information tab, you will find what you requested. Also, every plugin is deactivated except for the ones you requested.
Best Regards
March 26, 2024 at 5:57 pm #552466
Artem TemosKeymasterCould you please clarify where we can see these errors in your logs now?
March 26, 2024 at 6:26 pm #552480
supp0rtParticipantYes of course. wp-content/debug.log.
Let me know if you know anything else.
Best Regards
March 27, 2024 at 3:43 pm #552773
Artem TemosKeymasterYour database table was corrupted, but we fixed it. Please, test it from your end now.
March 27, 2024 at 5:30 pm #552809
supp0rtParticipantThank you for the fix on this one. Can you inform me about the change so I can pass it to the live site?
Best Regards
March 27, 2024 at 5:44 pm #552815
Artem TemosKeymasterTry to add the following PHP code snippet to the child theme functions.php file to fix this
add_action( 'init', function() { global $wpdb; $wpdb->query( "ALTER TABLE $wpdb->woodmart_products_table ADD on_sale boolean NOT NULL DEFAULT 0" ); } );
IMPORTANT: Remove the code once the issue is fixed.
March 31, 2024 at 6:31 pm #553689
supp0rtParticipantExcuse my late response on the matter.
I did the update on the table and now the column on_sale is there. Thank you for the solution on this one.
You may close the ticket.
Best Regards
-
This reply was modified 1 year ago by
supp0rt.
April 1, 2024 at 9:30 am #553754
Artem TemosKeymasterGreat, we are glad to hear that. Feel free to contact us if you have any further questions.
-
This reply was modified 1 year ago by
-
AuthorPosts
The topic ‘WordPress database error for Unknown column’ is closed to new replies.
- You must be logged in to create new topics. Login / Register