Home Forums WoodMart support forum WordPress database error for Unknown column

WordPress database error for Unknown column

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #551555

    supp0rt
    Participant

    Hello,

    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 UPDATEprefix_woodmart_wishlist_productsSETon_sale= '1' WHEREproduct_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

    • This topic was modified 1 year, 1 month ago by supp0rt.
    • This topic was modified 1 year, 1 month ago by supp0rt.
    #551889

    Artem Temos
    Keymaster

    Hello,

    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 Builder

    Thank you in advance.

    #552426

    supp0rt
    Participant

    Hello,

    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

    #552466

    Artem Temos
    Keymaster

    Could you please clarify where we can see these errors in your logs now?

    #552480

    supp0rt
    Participant

    Yes of course. wp-content/debug.log.

    Let me know if you know anything else.

    Best Regards

    #552773

    Artem Temos
    Keymaster

    Your database table was corrupted, but we fixed it. Please, test it from your end now.

    #552809

    supp0rt
    Participant

    Thank 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

    #552815

    Artem Temos
    Keymaster

    Try 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.

    #553689

    supp0rt
    Participant

    Excuse 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.
    #553754

    Artem Temos
    Keymaster

    Great, we are glad to hear that. Feel free to contact us if you have any further questions.

Viewing 10 posts - 1 through 10 (of 10 total)

The topic ‘WordPress database error for Unknown column’ is closed to new replies.