• Hello friends, after the update, all the conditional options disappeared, no matter how hard I try to solve it, I have no success, could you help me with this matter please, thank you very much.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support crodriguez1991

    (@crodriguez1991)

    Hello there,

    I hope you’re doing well

    Could you update to the latest 4.0.1 version? We fixed a problem with the conditional logic option on addons and it should allow you to see the conditional logic again.

    If not, could you provide me some information ( some screenshots ) where I can see the problem and try to reproduce it.

    I’m looking forward your response.

    Have a good day.

    We are having the same issue. I have updated to 4.0.1 and my fields are not there. We only use these fields on variable products. On version 2.2.4, I had a tab on the left under Advanced in the Product Data section called Product Add-Ons. Under here, it shows my Groups, I could manage this group or Manage all groups. I could set the fields to show here. Both opened in a pop up within the single product admin.

    Now this tab is not there on version 4.0.1.

    Plugin Support Iván Sosa

    (@ivansosa)

    Hello @user9876789,

    The blocks and their add-ons are managed now in the main plugin panel with all the settings. (YITH > Product Add-ons & Extra Options > Options blocks)

    Have a nice day!

    Plugin updates should not cause existing functionality to break – it should either be backwards compatible or you should give decent warning at the top for weeks before the update to indicate this is going to break existing options.

    This isn’t a small change by any means, we have hundreds of products with extra options on, are we just expected to recreate them all?

    If so that is a terrible, terrible update and should not have been released without giving customers time to migrate over.

    Plugin Support Iván Sosa

    (@ivansosa)

    Hi there,

    We have done several tests on the local installation and the update has always been successful (even the conditional logic).

    Anyways, we created the following code in order to regenerate the tables and execute the migration process again.

    Add this custom code in the functions.php of your active theme:

    if ( ! function_exists( 'yith_wapo_check_db_400' ) ) {
        function yith_wapo_check_db_400() {
    
            // Add ?yith_addons=1 to the URL inside the admin panel will execute all the code.
            if ( isset( $_GET['yith_addons'] ) ) {
    
                global $wpdb;
                require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    
                $blocks_table = $wpdb->prefix . 'yith_wapo_blocks';
                $assoc_table = $wpdb->prefix . 'yith_wapo_blocks_assoc';
    
                $charset_collate = $wpdb->get_charset_collate();
    
                // 1. BLOCKS TABLE - START
                $sql_blocks = "CREATE TABLE {$wpdb->prefix}yith_wapo_blocks (
                            id                  INT(3) NOT NULL AUTO_INCREMENT,
                            user_id             BIGINT(20),
                            vendor_id           BIGINT(20),
                            settings            LONGTEXT,
                            priority            DECIMAL(9,5),
                            visibility          INT(1),
                            creation_date       TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
                            last_update         TIMESTAMP,
                            name                varchar(255) NOT NULL,
                            product_association varchar(255),
                            exclude_products    tinyint(1) NOT NULL,
                            user_association    varchar(255),
                            exclude_users       tinyint(1) NOT NULL,
                            PRIMARY KEY (id)
                        ) $charset_collate;";
    
                if ( function_exists( 'maybe_create_table' ) ) {
                    maybe_create_table( $blocks_table, $sql_blocks );
                }
    
                // CREATE COLUMNS FOR BLOCKS TABLE.
                $blocks_columns = array(
                    'name'                => 'ALTER TABLE ' . $blocks_table . ' ADD name varchar(255) NOT NULL;',
                    'product_association' => 'ALTER TABLE ' . $blocks_table . ' ADD product_association varchar(255);',
                    'exclude_products'    => 'ALTER TABLE ' . $blocks_table . ' ADD exclude_products tinyint(1) NOT NULL;',
                    'user_association'    => 'ALTER TABLE ' . $blocks_table . ' ADD user_association varchar(255);',
                    'exclude_users'       => 'ALTER TABLE ' . $blocks_table . ' ADD exclude_users tinyint(1) NOT NULL;',
                );
    
                foreach ( $blocks_columns as $block_column => $block_statement ){
                    if ( function_exists( 'maybe_add_column' ) ) {
                        maybe_add_column($blocks_table, $block_column, $block_statement);
                    }
                }
    
                // BLOCKS TABLE - END
    
                // 2. BLOCKS ASSOC TABLE - START
    
                $sql_associations = "CREATE TABLE {$wpdb->prefix}yith_wapo_blocks_assoc (
                            rule_id bigint(20) NOT NULL,
                            object varchar(255) NOT NULL,
                            type varchar(50) NOT NULL,
                            KEY type (type),
                            KEY object (object)
                        ) $charset_collate;";
    
                if ( function_exists( 'maybe_create_table' ) ) {
                    maybe_create_table($assoc_table, $sql_associations);
                }
    
                // CREATE COLUMNS FOR ASSOCIATION TABLE.
                $assoc_columns = array(
                    'rule_id' => 'ALTER TABLE ' . $assoc_table . ' ADD rule_id varchar(255) NOT NULL;',
                    'object'  => 'ALTER TABLE ' . $assoc_table . ' ADD object varchar(255) NOT NULL;',
                    'type'    => 'ALTER TABLE ' . $assoc_table . ' ADD type varchar(50) NOT NULL;',
                );
    
                foreach ( $assoc_columns as $assoc_column => $assoc_statement ){
                    if ( function_exists( 'maybe_add_column' ) ) {
                        maybe_add_column($assoc_table, $assoc_column, $assoc_statement);
                    }
                }
    
                // BLOCKS ASSOC TABLE - END
    
                // 3. UPDATE OPTION - START
                update_option( 'yith_wapo_db_update_scheduled_for', '2.0.0' );
                update_option( 'yith_wapo_db_version_option', '2.0.0' );
                //UPDATE OPTION - END
    
            }
        }
        add_action( 'admin_init', 'yith_wapo_check_db_400' );
    }

    Then try to visit your site adding the following url

    https://yoursite.com/wp-admin/admin.php?page=yith_wapo_panel&yith_addon=1

    Note: you need to change yoursite.com and add your domain.

    <b>Note 2</b>: I suggest you execute the code on a staging site before setting it on production. In this way, you’ll prevent generating problems on your production site.

    Please, try it and let me know.

    Have a nice day!

    Hello, is there a way for me to send some screenshots to a member of the support team? I’m looking at doing the above, but before I do, I have two sites with the same version of the plugin on (2.24.0) but they look totally different, both are using default WP themes and I wanted to see if someone from the support team had any ideas why they look so different.

    Hello, I have tried the above solution today on a local copy of my site. I added the code to functions.php – then I upgraded the plugin to the latest version and went to /wp-admin/admin.php?page=yith…etc. Doing this created all the required blocks under Options Blocks.

    Unfortunately I still have some issues.

    1 – it has pulled through which products the option block should be on – but when I go to that product it is not on there. I have to go into each optin block and save it for the options to show on the product.

    2 – I had set maximum character limits on inputs but upon upgrading these character limits haven’t pulled through. The toggle for ‘Limit input characters’ is turned off. Please can you edit the upgrade script to include these max charactters?

    3 – Visually there are some differences in the front end and I can’t see any settings to put this back how it was:

    • There is a white background on the fields, I want to remove this – there’s a field in the back end to set the background colour but I can’t set this as transparent.
    • There is a new table with product price and order table – how do I hide this in the settings?

    Hello, can you come back to me on my points above please?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Options completely disappeared on my entire site’ is closed to new replies.