isset( $_GET['products_choice'] ) ? sanitize_text_field( wp_unslash( $_GET['products_choice'] ) ) : '', 'catalog_done' => isset( $_GET['catalog_done'] ) ? sanitize_text_field( wp_unslash( $_GET['catalog_done'] ) ) : '', 'setup_only' => isset( $_GET['setup_only'] ) ? sanitize_text_field( wp_unslash( $_GET['setup_only'] ) ) : '', ); // phpcs:enable WordPress.Security.NonceVerification.Recommended $setup_step = Torlann_Store_Setup::current_step(); $values = Torlann_Store_Setup::form_values(); $catalog_mode = $values['catalog_mode'] ?? 'purchase'; $carriers = Torlann_Carriers::for_country( $values['shop_country'] ?: 'FR' ); $rates = is_array( $values['shipping_rates'] ?? null ) ? $values['shipping_rates'] : array(); $shop_for_ship = sanitize_text_field( (string) ( $values['shop_country'] ?: 'FR' ) ); if ( ! empty( $rates ) ) { $allowed = Torlann_Carriers::for_country( $shop_for_ship ); foreach ( $rates as $rate_row ) { $cid = sanitize_key( $rate_row['carrier_id'] ?? '' ); if ( $cid && ! isset( $allowed[ $cid ] ) ) { $rates = Torlann_Carriers::adapt_shipping_methods_for_country( $rates, $shop_for_ship ); $settings_ship = Torlann_Settings::get(); if ( isset( $settings_ship['shipping'] ) && is_array( $settings_ship['shipping'] ) ) { $settings_ship['shipping']['methods'] = $rates; update_option( 'torlann_settings', $settings_ship, false ); if ( class_exists( 'Torlann_Shipping' ) ) { Torlann_Shipping::clear_cache(); } } break; } } } if ( empty( $rates ) ) { $rates = array( Torlann_Store_Setup::default_shipping_rate( Torlann_Store_Setup::is_demo_mode() ) ); } $setup_meta = Torlann_Store_Setup::get_setup(); $catalog_path_chosen = (string) ( $setup_meta['catalog_path'] ?? '' ); $offer_is_services = 'services' === Torlann_Store_Setup::offer_type(); $show_products_choice = ( 'boutique' === $setup_step && '' === $catalog_path_chosen ) || ( 'boutique' === $setup_step && ! empty( $tl_setup_query_args['products_choice'] ) ); $hide_setup_footer = $show_products_choice; $setup_form_args = array( 'page' => 'torlann-agent' ); if ( ! empty( $tl_setup_query_args['catalog_done'] ) ) { $setup_form_args['catalog_done'] = '1'; } if ( ! empty( $tl_setup_query_args['setup_only'] ) ) { $setup_form_args['setup_only'] = '1'; } $setup_form_action = add_query_arg( $setup_form_args, admin_url( 'admin.php' ) ); $stepper_catalog_mode = ( 'boutique' === $setup_step ) ? $catalog_mode : null; $wizard_progress = Torlann_Store_Setup::wizard_progress( null, $stepper_catalog_mode ); $wizard_intro = Torlann_Store_Setup::wizard_step_intro( $setup_step ); $shop_country_code = $values['shop_country'] ?: Torlann_Shop_Country::wizard_default(); $shop_country_label = Torlann_Market::country_catalog()[ $shop_country_code ] ?? $shop_country_code; $wizard_market_id = class_exists( 'Torlann_Market_Registry' ) ? Torlann_Market_Registry::id_for_country( $shop_country_code ) : 'fr'; $can_siret = ! class_exists( 'Torlann_Market_Registry' ) || Torlann_Market_Registry::shop_can( 'company.siret', $wizard_market_id ); $can_siret_lk = ! class_exists( 'Torlann_Market_Registry' ) || Torlann_Market_Registry::shop_can( 'company.siret_lookup', $wizard_market_id ); $can_rcs = ! class_exists( 'Torlann_Market_Registry' ) || Torlann_Market_Registry::shop_can( 'company.rcs', $wizard_market_id ); $legal_open = ! empty( $values['company_siret'] ) || ! empty( $values['company_vat_number'] ) || ! empty( $values['company_legal_form'] ) || ! empty( $values['company_rcs'] ); ?>

$sell_regions_csv ); $shop_country = $regions_country; $field_name_prefix = 'market'; $regions_field = 'sell_regions'; $wizard = true; $select_id_override = 'tl-wizard-sell-region-add'; include TORLANN_PATH . 'admin/views/partials/shipping-regions-picker.php'; ?>

style="margin:0 0 12px;">

style="margin:0 0 12px;">