Home Forums WoodMart support forum Urgent Issue with Wishlist Functionality

Urgent Issue with Wishlist Functionality

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #581179

    son0002
    Participant

    My website’s wishlist feature is experiencing a critical error. I’ve included the error log below for your reference. Could you please assess whether this can be resolved with a patch or if a different solution is required?

    #581201

    Artem Temos
    Keymaster

    Hello,

    Please disable any plugins not directly related to our theme and provide us with your admin access details. We will log in to your dashboard 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.

    #581227

    son0002
    Participant

    most likely the database table might have been accidentally deleted or corrupted, what would the solution be in this case? do l need manually recreating the missing table.

    #581264

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to fix this. You need to refresh your website once and then remove the code.

    add_action(
    	'init',
    	function () {
    		require_once ABSPATH . 'wp-admin/includes/upgrade.php';
    		global $wpdb;
    
    		$wishlists_table_name          = $wpdb->prefix . 'woodmart_wishlists';
    		$wishlists_products_table_name = $wpdb->prefix . 'woodmart_wishlist_products';
    		$default_wishlist_name         = esc_html__( 'My wishlist', 'woodmart' );
    
    		maybe_create_table(
    			$wishlists_table_name,
    			"CREATE TABLE {$wishlists_table_name} (
    				ID INT( 11 ) NOT NULL AUTO_INCREMENT,
    				user_id INT( 11 ) NOT NULL,
    				wishlist_group varchar( 255 ) DEFAULT '{$default_wishlist_name}' NOT NULL,
    				date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    				PRIMARY KEY  ( ID )
    			) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"
    		);
    
    		maybe_create_table(
    			$wishlists_products_table_name,
    			"CREATE TABLE {$wishlists_products_table_name} (
    				ID int( 11 ) NOT NULL AUTO_INCREMENT,
    				product_id varchar( 255 ) NOT NULL,
    				wishlist_id int( 11 ) NULL,
    				date_added timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    				on_sale boolean NOT NULL,
    				PRIMARY KEY  ( ID ),
    				KEY ( product_id )
    			) DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;"
    		);
    	}
    );
Viewing 4 posts - 1 through 4 (of 4 total)