Plugin Directory

Changeset 3093942


Ignore:
Timestamp:
05/28/2024 01:21:23 PM (22 months ago)
Author:
Ecwid
Message:

v 6.12.13 files

Location:
ecwid-shopping-cart
Files:
3 deleted
3 edited
180 copied

Legend:

Unmodified
Added
Removed
  • ecwid-shopping-cart/tags/6.12.13/includes/class-ecwid-config.php

    r3025033 r3093942  
    106106        $result = false;
    107107        if ( file_exists( $filename ) ) {
    108             $result = @parse_ini_file( $filename );
     108            $config = @file_get_contents( $filename );
     109
     110            if ( empty( $config ) ) {
     111                return;
     112            }
     113
     114            $result = parse_ini_string( $config );
    109115        }
    110116
     
    223229        ecwid_invalidate_cache( true );
    224230    }
     231
     232    public static function copy_config_to_new_site( $new_site, $args ) { //phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
     233        $wl_config     = self::_get_wl_config();
     234        $common_config = self::_get_common_config();
     235
     236        $config_names = array_merge( $wl_config, $common_config );
     237        $config       = array();
     238
     239        foreach ( $config_names as $db_name => $ini_name ) {
     240            $config_value = EcwidPlatform::get( $db_name );
     241
     242            if ( ! empty( $config_value ) ) {
     243                $config[ $db_name ] = $config_value;
     244            }
     245        }
     246
     247        if ( ! empty( $config ) ) {
     248            return update_blog_option( $new_site->blog_id, EcwidPlatform::OPTION_ECWID_PLUGIN_DATA, $config );
     249        } else {
     250            return false;
     251        }
     252    }
    225253}
    226254
    227255add_action( 'admin_enqueue_scripts', array( 'Ecwid_Config', 'enqueue_styles' ) );
     256add_action( 'wp_initialize_site', 'Ecwid_Config::copy_config_to_new_site', 10, 2 );
  • ecwid-shopping-cart/tags/6.12.13/includes/gutenberg/class-ecwid-gutenberg-block-store.php

    r3010593 r3093942  
    148148                    $is_need_open_filter_page = true;
    149149                    $config_js[]              = 'window.ec.storefront.show_breadcrumbs=false';
    150                 }
     150                }//end if
    151151            }//end if
    152152
    153153            if ( isset( $attribute['is_storefront_api'] ) && $attribute['is_storefront_api'] && strpos( $name, 'chameleon' ) === false ) {
     154                if ( empty( $name ) ) {
     155                    continue;
     156                }
     157
    154158                if ( is_null( $value ) ) {
    155159                    $value = $attribute['default'];
     
    169173                    $store_page_data[ $name ] = $value;
    170174                }
    171             }
     175            }//end if
    172176        }//end foreach
    173177
  • ecwid-shopping-cart/tags/6.12.13/readme.txt

    r3059476 r3093942  
    152152
    153153== Changelog ==
     154= 6.12.13 - May 29, 2024 =
     155- Internal improvements and minor fixes for Gutenberg ecommerce block.
     156
    154157= 6.12.12 - Mar 27, 2024 =
    155158- Fixed a PHP error that could occur when adding a storefront via a shortcode without any parameters.
  • ecwid-shopping-cart/trunk/includes/class-ecwid-config.php

    r3025033 r3093942  
    106106        $result = false;
    107107        if ( file_exists( $filename ) ) {
    108             $result = @parse_ini_file( $filename );
     108            $config = @file_get_contents( $filename );
     109
     110            if ( empty( $config ) ) {
     111                return;
     112            }
     113
     114            $result = parse_ini_string( $config );
    109115        }
    110116
     
    223229        ecwid_invalidate_cache( true );
    224230    }
     231
     232    public static function copy_config_to_new_site( $new_site, $args ) { //phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed
     233        $wl_config     = self::_get_wl_config();
     234        $common_config = self::_get_common_config();
     235
     236        $config_names = array_merge( $wl_config, $common_config );
     237        $config       = array();
     238
     239        foreach ( $config_names as $db_name => $ini_name ) {
     240            $config_value = EcwidPlatform::get( $db_name );
     241
     242            if ( ! empty( $config_value ) ) {
     243                $config[ $db_name ] = $config_value;
     244            }
     245        }
     246
     247        if ( ! empty( $config ) ) {
     248            return update_blog_option( $new_site->blog_id, EcwidPlatform::OPTION_ECWID_PLUGIN_DATA, $config );
     249        } else {
     250            return false;
     251        }
     252    }
    225253}
    226254
    227255add_action( 'admin_enqueue_scripts', array( 'Ecwid_Config', 'enqueue_styles' ) );
     256add_action( 'wp_initialize_site', 'Ecwid_Config::copy_config_to_new_site', 10, 2 );
  • ecwid-shopping-cart/trunk/includes/gutenberg/class-ecwid-gutenberg-block-store.php

    r3010593 r3093942  
    148148                    $is_need_open_filter_page = true;
    149149                    $config_js[]              = 'window.ec.storefront.show_breadcrumbs=false';
    150                 }
     150                }//end if
    151151            }//end if
    152152
    153153            if ( isset( $attribute['is_storefront_api'] ) && $attribute['is_storefront_api'] && strpos( $name, 'chameleon' ) === false ) {
     154                if ( empty( $name ) ) {
     155                    continue;
     156                }
     157
    154158                if ( is_null( $value ) ) {
    155159                    $value = $attribute['default'];
     
    169173                    $store_page_data[ $name ] = $value;
    170174                }
    171             }
     175            }//end if
    172176        }//end foreach
    173177
  • ecwid-shopping-cart/trunk/readme.txt

    r3059476 r3093942  
    152152
    153153== Changelog ==
     154= 6.12.13 - May 29, 2024 =
     155- Internal improvements and minor fixes for Gutenberg ecommerce block.
     156
    154157= 6.12.12 - Mar 27, 2024 =
    155158- Fixed a PHP error that could occur when adding a storefront via a shortcode without any parameters.
Note: See TracChangeset for help on using the changeset viewer.