> */ private static function sidecart_icon_options(): array { $options = []; $raw = function_exists( 'wooordercart_get_sidecarticons' ) ? wooordercart_get_sidecarticons() : []; if ( is_array( $raw ) ) { $index = 1; foreach ( $raw as $value ) { if ( ! is_scalar( $value ) ) { continue; } $options[] = [ 'value' => (string) $value, /* translators: %d: Basket icon number. */ 'label' => sprintf( __( 'Basket %d', 'ips-order-cart' ), $index ), 'previewClass' => (string) $value, ]; $index++; } } if ( empty( $options ) ) { $options = [ [ 'value' => 'ips-sidecart-icon-basket1', 'label' => __( 'Basket 1', 'ips-order-cart' ), 'previewClass' => 'ips-sidecart-icon-basket1', ], [ 'value' => 'ips-sidecart-icon-basket2', 'label' => __( 'Basket 2', 'ips-order-cart' ), 'previewClass' => 'ips-sidecart-icon-basket2', ], [ 'value' => 'ips-sidecart-icon-basket3', 'label' => __( 'Basket 3', 'ips-order-cart' ), 'previewClass' => 'ips-sidecart-icon-basket3', ], [ 'value' => 'ips-sidecart-icon-basket4', 'label' => __( 'Basket 4', 'ips-order-cart' ), 'previewClass' => 'ips-sidecart-icon-basket4', ], [ 'value' => 'ips-sidecart-icon-basket5', 'label' => __( 'Basket 5', 'ips-order-cart' ), 'previewClass' => 'ips-sidecart-icon-basket5', ], [ 'value' => 'ips-sidecart-icon-basket6', 'label' => __( 'Basket 6', 'ips-order-cart' ), 'previewClass' => 'ips-sidecart-icon-basket6', ], [ 'value' => 'ips-sidecart-icon-basket7', 'label' => __( 'Basket 7', 'ips-order-cart' ), 'previewClass' => 'ips-sidecart-icon-basket7', ], ]; } return $options; } /** * @return array */ private static function sidecart_menu_options(): array { $options = [ 'none' => __( 'None', 'ips-order-cart' ), ]; if ( function_exists( 'wp_get_nav_menus' ) ) { $menus = wp_get_nav_menus(); if ( is_array( $menus ) ) { foreach ( $menus as $menu ) { if ( isset( $menu->slug, $menu->name ) ) { $options[ (string) $menu->slug ] = (string) $menu->name; } } } } return $options; } /** * @return array */ private static function product_category_options(): array { $options = []; if ( function_exists( 'get_terms' ) ) { $terms = get_terms( [ 'taxonomy' => 'product_cat', 'hide_empty' => false, ] ); if ( ! is_wp_error( $terms ) && is_array( $terms ) ) { foreach ( $terms as $term ) { if ( isset( $term->term_id, $term->name ) ) { $options[ (string) $term->term_id ] = (string) $term->name; } } } } return $options; } /** * @return array> */ public static function sections(): array { $sections = (array) apply_filters( 'ipscmi_order_cart_option_sections', [ [ 'id' => 'payment_runtime', 'title' => __( 'Payment loading', 'ips-order-cart' ), 'description' => __( 'Store default for express payments in IPS checkout surfaces. Most stores can leave this unchanged.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'ips_payment_express_render_mode', 'section' => 'payment_runtime_settings_tabs', 'type' => 'select', 'label' => __( 'Default express payment loading', 'ips-order-cart' ), 'description' => __( 'Choose how IPS surfaces load express wallet buttons by default. Woo compatibility mode keeps provider output isolated when a direct adapter is not used.', 'ips-order-cart' ), 'default' => 'woo_native_shell', 'allowEmpty' => false, 'options' => [ 'woo_native_shell' => __( 'Woo compatibility mode', 'ips-order-cart' ), 'safe_inline' => __( 'Verified IPS adapters', 'ips-order-cart' ), ], ], [ 'key' => 'ips_payment_express_dedupe_wallets', 'section' => 'payment_runtime_settings_tabs', 'type' => 'toggle', 'label' => __( 'Deduplicate express wallets', 'ips-order-cart' ), 'description' => __( 'Keep this disabled to mirror Woo Blocks and provider rendering. Enable it only if IPS should hide duplicate wallet types by provider priority.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'ips_payment_trace_enabled', 'section' => 'payment_runtime_settings_tabs', 'type' => 'toggle', 'label' => __( 'Activate payment trace logging', 'ips-order-cart' ), 'description' => __( 'Writes dedicated IPS payment runtime traces to WooCommerce logs and the checkout monitoring view, independent of whether Sidecart or Checkout is active.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'ips_payment_trace_console_enabled', 'section' => 'payment_runtime_settings_tabs', 'type' => 'toggle', 'label' => __( 'Activate browser console trace', 'ips-order-cart' ), 'description' => __( 'Outputs the same payment runtime trace events to the browser console for local debugging.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'ips_payment_trace_max_events', 'section' => 'payment_runtime_settings_tabs', 'type' => 'number', 'label' => __( 'Stored payment trace events', 'ips-order-cart' ), 'description' => __( 'Maximum number of recent checkout and express trace events kept for the admin monitoring view.', 'ips-order-cart' ), 'default' => 150, 'min' => 20, 'max' => 500, ], ], ], [ 'id' => 'sidecart_general', 'title' => __( 'Activation', 'ips-order-cart' ), 'description' => __( 'Enable the sidecart for your store.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'enable_reactsidecart', 'section' => 'sidecart_general_tabs', 'type' => 'toggle', 'label' => __( 'Activate Sidecart', 'ips-order-cart' ), 'description' => __( 'Enable this option to activate the Sidecart.', 'ips-order-cart' ), 'default' => false, ], ], ], [ 'id' => 'sidecart_main_icon', 'title' => __( 'Basket Trigger', 'ips-order-cart' ), 'description' => __( 'Choose the trigger icon, size and counter appearance.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'sidecart_custom_image', 'section' => 'sidecart_main_settings_tabs', 'type' => 'icon-radio-grid', 'label' => __( 'Basket Icon', 'ips-order-cart' ), 'description' => __( 'Select the basket icon shown for the sidecart trigger.', 'ips-order-cart' ), 'default' => 'ips-sidecart-icon-basket1', 'options' => self::sidecart_icon_options(), ], [ 'key' => 'sidecart_basket_size', 'section' => 'sidecart_main_settings_tabs', 'type' => 'number', 'label' => __( 'Set Basket size', 'ips-order-cart' ), 'description' => __( 'Set Basket icon size.', 'ips-order-cart' ), 'default' => 30, 'min' => 0, 'max' => 30, ], [ 'key' => 'sidecart_basket_countersize', 'section' => 'sidecart_main_settings_tabs', 'type' => 'number', 'label' => __( 'Set Basket countersize', 'ips-order-cart' ), 'description' => __( 'Set Basket countersize.', 'ips-order-cart' ), 'default' => 30, 'min' => 0, 'max' => 40, ], [ 'key' => 'basket_count_pos', 'section' => 'sidecart_main_settings_tabs', 'type' => 'select', 'label' => __( 'Position Counter', 'ips-order-cart' ), 'description' => __( 'Select the position for the countnumber.', 'ips-order-cart' ), 'default' => 'topright', 'options' => [ 'topright' => __( 'Top Right', 'ips-order-cart' ), 'right' => __( 'Right', 'ips-order-cart' ), ], ], [ 'key' => 'color-basketicon-bg', 'section' => 'sidecart_main_settings_tabs', 'type' => 'color', 'label' => __( 'Basket Icon Color', 'ips-order-cart' ), 'description' => __( 'Set the color of the basket icon.', 'ips-order-cart' ), 'default' => '#000000', ], [ 'key' => 'color-basketroundicon-bg', 'section' => 'sidecart_main_settings_tabs', 'type' => 'color', 'label' => __( 'Basket Icon Counter Color', 'ips-order-cart' ), 'description' => __( 'Set the counter color of the basket icon.', 'ips-order-cart' ), 'default' => '#000000', ], [ 'key' => 'color-basketicon-font', 'section' => 'sidecart_main_settings_tabs', 'type' => 'color', 'label' => __( 'Basket Icon Font Color', 'ips-order-cart' ), 'description' => __( 'Set the font color of the basket icon.', 'ips-order-cart' ), 'default' => '#ffffff', ], ], ], [ 'id' => 'sidecart_main_menu', 'title' => __( 'Menu', 'ips-order-cart' ), 'description' => __( 'Control where the trigger appears in your menu.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'sidecart_cartmenupos_select', 'section' => 'sidecart_main_settings_tabs', 'type' => 'select', 'label' => __( 'Add to menu', 'ips-order-cart' ), 'description' => __( 'You can also use shortcode [ipscmi_order_cart] to generate the basket icon anywhere.', 'ips-order-cart' ), 'default' => 'none', 'options' => self::sidecart_menu_options(), ], [ 'key' => 'sidecart_menubasket_set', 'section' => 'sidecart_main_settings_tabs', 'type' => 'multiselect', 'label' => __( 'Show', 'ips-order-cart' ), 'description' => __( 'Select what is shown on the menu icon.', 'ips-order-cart' ), 'default' => [ 'icon' ], 'options' => [ 'icon' => __( 'Icon', 'ips-order-cart' ), 'subtotal' => __( 'Subtotal', 'ips-order-cart' ), 'count' => __( 'Count', 'ips-order-cart' ), ], ], ], ], [ 'id' => 'sidecart_main_behavior', 'title' => __( 'Behavior', 'ips-order-cart' ), 'description' => __( 'Set the core sidecart behavior and basic content.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'sidecart_ajaxset', 'section' => 'sidecart_main_settings_tabs', 'type' => 'toggle', 'label' => __( 'Ajax add to cart', 'ips-order-cart' ), 'description' => __( 'Add to cart without refreshing page.', 'ips-order-cart' ), 'default' => true, ], [ 'key' => 'sidecart_widthsize', 'section' => 'sidecart_main_settings_tabs', 'type' => 'number', 'label' => __( 'Set Sidecart width', 'ips-order-cart' ), 'description' => __( 'Set Sidecart width.', 'ips-order-cart' ), 'default' => 400, 'min' => 0, 'max' => 600, ], [ 'key' => 'sidecart_disable_auto_open', 'section' => 'sidecart_main_settings_tabs', 'type' => 'toggle', 'label' => __( 'Open the Sidecart automatically', 'ips-order-cart' ), 'description' => __( 'Open the Sidecart after adding a product.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'sidecart_shake_trigger_on_add', 'section' => 'sidecart_main_settings_tabs', 'type' => 'toggle', 'label' => __( 'Shake trigger instead', 'ips-order-cart' ), 'description' => __( 'When auto open is disabled, briefly animate the trigger or floating button after add to cart.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'sidecart_enable_smooth_animation', 'section' => 'sidecart_main_settings_tabs', 'type' => 'toggle', 'label' => __( 'Smooth sidecart animation', 'ips-order-cart' ), 'description' => __( 'Fade and slide the sidecart in and out instead of showing and hiding it instantly.', 'ips-order-cart' ), 'default' => true, ], [ 'key' => 'sidecart_animation_duration', 'section' => 'sidecart_main_settings_tabs', 'type' => 'number', 'label' => __( 'Animation duration', 'ips-order-cart' ), 'description' => __( 'Set the open and close animation duration in milliseconds.', 'ips-order-cart' ), 'default' => 400, 'min' => 0, 'max' => 1200, ], [ 'key' => 'sidecart_emptycart_text', 'section' => 'sidecart_main_settings_tabs', 'type' => 'text', 'label' => __( 'Empty Cart message', 'ips-order-cart' ), 'description' => __( 'Shown when the sidecart is empty.', 'ips-order-cart' ), 'default' => __( 'Your shopping cart is empty', 'ips-order-cart' ), ], ], ], [ 'id' => 'sidecart_main_shipping', 'title' => __( 'Free Shipping', 'ips-order-cart' ), 'description' => __( 'Free-shipping threshold, messaging and category mapping.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'sidecart_freeshipping_select', 'section' => 'sidecart_main_settings_tabs', 'type' => 'select', 'label' => __( 'Enable Free Shipping Progress Bar', 'ips-order-cart' ), 'description' => __( 'Enable Free Shipping progress bar to show customers how close they are to obtaining free shipping.', 'ips-order-cart' ), 'default' => 'none', 'options' => [ 'none' => __( 'None', 'ips-order-cart' ), 'custom' => __( 'Custom Free Shipping configuration', 'ips-order-cart' ), ], ], [ 'key' => 'sidecart_threshold_freeshipping', 'visibleWhen' => [ 'field' => 'sidecart_freeshipping_select', 'equals' => 'custom' ], 'section' => 'sidecart_main_settings_tabs', 'type' => 'number', 'label' => __( 'Free Shipping Threshold', 'ips-order-cart' ), 'description' => __( 'Optional display threshold. It must match the WooCommerce free shipping method; shipping availability always comes from WooCommerce.', 'ips-order-cart' ), 'default' => 1, 'min' => 0, 'max' => 500, ], [ 'key' => 'sidecart_freeshipping_nexttext', 'section' => 'sidecart_main_settings_tabs', 'type' => 'text', 'label' => __( 'Remaining Amount Message', 'ips-order-cart' ), 'description' => __( "The amount remaining to qualify for free shipping. Leave blank for the default message.", 'ips-order-cart' ), /* translators: %s: Formatted amount remaining for free shipping. */ 'default' => __( "You're '%s' away from free shipping!", 'ips-order-cart' ), ], [ 'key' => 'sidecart_freeshipping_successmessage', 'section' => 'sidecart_main_settings_tabs', 'type' => 'text', 'label' => __( 'Free Shipping Message', 'ips-order-cart' ), 'description' => __( 'The free shipping message. Leave blank for the default message.', 'ips-order-cart' ), 'default' => __( 'Congrats! You get free standard shipping.', 'ips-order-cart' ), ], [ 'key' => 'sidecart_freeshipping_autocheck', 'section' => 'sidecart_main_settings_tabs', 'type' => 'toggle', 'label' => __( 'Automatic free shipping check', 'ips-order-cart' ), 'description' => __( 'Automatically check whether free shipping is available for the current cart.', 'ips-order-cart' ), 'default' => false, ], ], ], [ 'id' => 'sidecart_main_floating_button', 'title' => __( 'Floating Button', 'ips-order-cart' ), 'description' => __( 'Display a floating trigger button for the sidecart.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'sidecart_enable_floating_button', 'section' => 'sidecart_main_settings_tabs', 'type' => 'toggle', 'label' => __( 'Enable floating cart button', 'ips-order-cart' ), 'description' => __( 'Show a floating sidecart trigger at the bottom right of the page.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'sidecart_floating_button_right', 'section' => 'sidecart_main_settings_tabs', 'type' => 'number', 'label' => __( 'Floating button right position', 'ips-order-cart' ), 'description' => __( 'Distance from the right viewport edge in pixels.', 'ips-order-cart' ), 'default' => 20, 'min' => 0, 'max' => 160, ], [ 'key' => 'sidecart_floating_button_bottom', 'section' => 'sidecart_main_settings_tabs', 'type' => 'number', 'label' => __( 'Floating button bottom position', 'ips-order-cart' ), 'description' => __( 'Distance from the bottom viewport edge in pixels.', 'ips-order-cart' ), 'default' => 20, 'min' => 0, 'max' => 200, ], [ 'key' => 'sidecart_hide_floating_button_empty_cart', 'section' => 'sidecart_main_settings_tabs', 'type' => 'toggle', 'label' => __( 'Hide floating button if cart is empty', 'ips-order-cart' ), 'description' => __( 'Do not show the floating cart button when the cart is empty.', 'ips-order-cart' ), 'default' => false, ], ], ], [ 'id' => 'sidecart_main_commerce', 'title' => __( 'Commerce', 'ips-order-cart' ), 'description' => __( 'Show or hide commerce-related information in the sidecart.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'sidecart_show_shipping_row', 'section' => 'sidecart_main_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show shipping row', 'ips-order-cart' ), 'description' => __( 'Display a compact shipping summary below the subtotal.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'sidecart_show_total_row', 'section' => 'sidecart_main_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show total row', 'ips-order-cart' ), 'description' => __( 'Display the order total in the sidecart totals block.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'sidecart_show_tax_rows', 'section' => 'sidecart_main_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show tax rows', 'ips-order-cart' ), 'description' => __( 'Display tax rows in the sidecart totals block.', 'ips-order-cart' ), 'default' => false, ], ], ], [ 'id' => 'sidecart_style_header', 'title' => __( 'Header', 'ips-order-cart' ), 'description' => __( 'Header icon, badge and background settings.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'ips-color-header-bg', 'section' => 'sidecart_style_settings_tabs', 'type' => 'color', 'label' => __( 'Header Background Color', 'ips-order-cart' ), 'description' => __( 'Set the background color of the header.', 'ips-order-cart' ), 'default' => '#ffffff', ], [ 'key' => 'sidecart_header_show_icon', 'section' => 'sidecart_style_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show header icon', 'ips-order-cart' ), 'description' => __( 'Display the cart icon in the sidecart header.', 'ips-order-cart' ), 'default' => true, ], [ 'key' => 'sidecart_header_icon', 'section' => 'sidecart_style_settings_tabs', 'type' => 'icon-radio-grid', 'label' => __( 'Header Icon', 'ips-order-cart' ), 'description' => __( 'Select the icon used in the sidecart header.', 'ips-order-cart' ), 'default' => 'ips-sidecart-icon-basket1', 'options' => self::sidecart_icon_options(), ], [ 'key' => 'sidecart_header_icon_size', 'section' => 'sidecart_style_settings_tabs', 'type' => 'number', 'label' => __( 'Header icon size', 'ips-order-cart' ), 'description' => __( 'Set the icon size for the sidecart header.', 'ips-order-cart' ), 'default' => 26, 'min' => 12, 'max' => 64, ], [ 'key' => 'sidecart_header_icon_position', 'section' => 'sidecart_style_settings_tabs', 'type' => 'select', 'label' => __( 'Header icon position', 'ips-order-cart' ), 'description' => __( 'Choose whether the header icon appears before or after the header text.', 'ips-order-cart' ), 'default' => 'left', 'options' => [ 'left' => __( 'Left', 'ips-order-cart' ), 'right' => __( 'Right', 'ips-order-cart' ), ], ], [ 'key' => 'sidecart_header_show_badge', 'section' => 'sidecart_style_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show header badge', 'ips-order-cart' ), 'description' => __( 'Display the cart count badge on the sidecart header icon.', 'ips-order-cart' ), 'default' => true, ], [ 'key' => 'sidecart_header_badge_size', 'section' => 'sidecart_style_settings_tabs', 'type' => 'number', 'label' => __( 'Header badge size', 'ips-order-cart' ), 'description' => __( 'Set the badge size for the sidecart header.', 'ips-order-cart' ), 'default' => 20, 'min' => 10, 'max' => 40, ], [ 'key' => 'sidecart_header_badge_position', 'section' => 'sidecart_style_settings_tabs', 'type' => 'select', 'label' => __( 'Header badge position', 'ips-order-cart' ), 'description' => __( 'Choose where the cart count badge should sit on the header icon.', 'ips-order-cart' ), 'default' => 'topright', 'options' => [ 'topright' => __( 'Top Right', 'ips-order-cart' ), 'topleft' => __( 'Top Left', 'ips-order-cart' ), 'bottomright' => __( 'Bottom Right', 'ips-order-cart' ), 'bottomleft' => __( 'Bottom Left', 'ips-order-cart' ), ], ], [ 'key' => 'sidecart_header_show_title', 'section' => 'sidecart_style_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show header title', 'ips-order-cart' ), 'description' => __( 'Display the sidecart title in the header.', 'ips-order-cart' ), 'default' => true, ], [ 'key' => 'sidecart_header_show_count', 'section' => 'sidecart_style_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show header count text', 'ips-order-cart' ), 'description' => __( 'Display the item count text in the sidecart header.', 'ips-order-cart' ), 'default' => true, ], [ 'key' => 'sidecart_header_alignment', 'section' => 'sidecart_style_settings_tabs', 'type' => 'select', 'label' => __( 'Header content alignment', 'ips-order-cart' ), 'description' => __( 'Align the header content inside the sidecart.', 'ips-order-cart' ), 'default' => 'left', 'options' => [ 'left' => __( 'Left', 'ips-order-cart' ), 'center' => __( 'Center', 'ips-order-cart' ), ], ], ], ], [ 'id' => 'sidecart_style_body', 'title' => __( 'Body & Items', 'ips-order-cart' ), 'description' => __( 'Configure the sidecart body area, item layout and content background color.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'sidecart_item_show_image', 'section' => 'sidecart_style_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show item image', 'ips-order-cart' ), 'description' => __( 'Display the product thumbnail in sidecart items.', 'ips-order-cart' ), 'default' => true, ], [ 'key' => 'sidecart_item_show_meta', 'section' => 'sidecart_style_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show item meta', 'ips-order-cart' ), 'description' => __( 'Display variation and meta information below the item title.', 'ips-order-cart' ), 'default' => true, ], [ 'key' => 'sidecart_item_show_after_data', 'section' => 'sidecart_style_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show additional item info', 'ips-order-cart' ), 'description' => __( 'Display compatibility or add-on information below the item meta.', 'ips-order-cart' ), 'default' => true, ], [ 'key' => 'sidecart_item_image_position', 'section' => 'sidecart_style_settings_tabs', 'type' => 'select', 'label' => __( 'Item image position', 'ips-order-cart' ), 'description' => __( 'Choose whether the item image appears before or after the item content.', 'ips-order-cart' ), 'default' => 'left', 'options' => [ 'left' => __( 'Left', 'ips-order-cart' ), 'right' => __( 'Right', 'ips-order-cart' ), ], ], [ 'key' => 'sidecart_item_image_size', 'section' => 'sidecart_style_settings_tabs', 'type' => 'number', 'label' => __( 'Item image size', 'ips-order-cart' ), 'description' => __( 'Set the image size for sidecart item thumbnails.', 'ips-order-cart' ), 'default' => 60, 'min' => 32, 'max' => 120, ], [ 'key' => 'sidecart_item_price_position', 'section' => 'sidecart_style_settings_tabs', 'type' => 'select', 'label' => __( 'Item price position', 'ips-order-cart' ), 'description' => __( 'Choose whether the item subtotal appears to the right or below the item content.', 'ips-order-cart' ), 'default' => 'right', 'options' => [ 'right' => __( 'Right', 'ips-order-cart' ), 'below' => __( 'Below content', 'ips-order-cart' ), ], ], [ 'key' => 'ips-color-content-bg', 'section' => 'sidecart_style_settings_tabs', 'type' => 'color', 'label' => __( 'Body Background Color', 'ips-order-cart' ), 'description' => __( 'Set the background color of the body.', 'ips-order-cart' ), 'default' => '#ffffff', ], ], ], [ 'id' => 'sidecart_style_footer', 'title' => __( 'Footer', 'ips-order-cart' ), 'description' => __( 'Configure footer buttons, slot content and background color.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'sidecart_footer_show_view_cart', 'section' => 'sidecart_style_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show view cart button', 'ips-order-cart' ), 'description' => __( 'Display the View cart button in the sidecart footer.', 'ips-order-cart' ), 'default' => true, ], [ 'key' => 'sidecart_footer_show_checkout', 'section' => 'sidecart_style_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show checkout button', 'ips-order-cart' ), 'description' => __( 'Display the Checkout button in the sidecart footer.', 'ips-order-cart' ), 'default' => true, ], [ 'key' => 'sidecart_footer_show_slot_content', 'section' => 'sidecart_style_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show footer slot content', 'ips-order-cart' ), 'description' => __( 'Display additional footer HTML injected by integrations or hooks.', 'ips-order-cart' ), 'default' => true, ], [ 'key' => 'sidecart_footer_show_border', 'section' => 'sidecart_style_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show footer border', 'ips-order-cart' ), 'description' => __( 'Display the top border that separates the footer from the content area.', 'ips-order-cart' ), 'default' => true, ], [ 'key' => 'sidecart_footer_button_order', 'section' => 'sidecart_style_settings_tabs', 'type' => 'select', 'label' => __( 'Footer button order', 'ips-order-cart' ), 'description' => __( 'Choose which button appears first in the sidecart footer.', 'ips-order-cart' ), 'default' => 'view_cart_first', 'options' => [ 'view_cart_first' => __( 'View cart first', 'ips-order-cart' ), 'checkout_first' => __( 'Checkout first', 'ips-order-cart' ), ], ], [ 'key' => 'sidecart_footer_layout', 'section' => 'sidecart_style_settings_tabs', 'type' => 'select', 'label' => __( 'Footer button layout', 'ips-order-cart' ), 'description' => __( 'Choose whether footer buttons are stacked or inline.', 'ips-order-cart' ), 'default' => 'stacked', 'options' => [ 'stacked' => __( 'Stacked', 'ips-order-cart' ), 'inline' => __( 'Inline', 'ips-order-cart' ), ], ], [ 'key' => 'sidecart_footer_view_cart_label', 'section' => 'sidecart_style_settings_tabs', 'type' => 'text', 'label' => __( 'View cart label', 'ips-order-cart' ), 'description' => __( 'Set the label for the View cart button.', 'ips-order-cart' ), 'default' => __( 'View cart', 'ips-order-cart' ), ], [ 'key' => 'sidecart_footer_checkout_label', 'section' => 'sidecart_style_settings_tabs', 'type' => 'text', 'label' => __( 'Checkout label', 'ips-order-cart' ), 'description' => __( 'Set the label for the Checkout button.', 'ips-order-cart' ), 'default' => __( 'Checkout', 'ips-order-cart' ), ], [ 'key' => 'sidecart_footer_show_continue_shopping', 'section' => 'sidecart_style_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show continue shopping button', 'ips-order-cart' ), 'description' => __( 'Display a button that closes the sidecart and lets customers continue browsing.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'sidecart_footer_continue_shopping_label', 'section' => 'sidecart_style_settings_tabs', 'type' => 'text', 'label' => __( 'Continue shopping label', 'ips-order-cart' ), 'description' => __( 'Set the label for the Continue shopping button.', 'ips-order-cart' ), 'default' => __( 'Continue shopping', 'ips-order-cart' ), ], [ 'key' => 'sidecart_footer_view_cart_bg', 'section' => 'sidecart_style_settings_tabs', 'type' => 'color', 'label' => __( 'View cart button background', 'ips-order-cart' ), 'description' => __( 'Set the background color of the View cart button.', 'ips-order-cart' ), 'default' => '#eef2f7', ], [ 'key' => 'sidecart_footer_view_cart_text', 'section' => 'sidecart_style_settings_tabs', 'type' => 'color', 'label' => __( 'View cart button text color', 'ips-order-cart' ), 'description' => __( 'Set the text color of the View cart button.', 'ips-order-cart' ), 'default' => '#111827', ], [ 'key' => 'sidecart_footer_checkout_bg', 'section' => 'sidecart_style_settings_tabs', 'type' => 'color', 'label' => __( 'Checkout button background', 'ips-order-cart' ), 'description' => __( 'Set the background color of the Checkout button.', 'ips-order-cart' ), 'default' => '#050505', ], [ 'key' => 'sidecart_footer_checkout_text', 'section' => 'sidecart_style_settings_tabs', 'type' => 'color', 'label' => __( 'Checkout button text color', 'ips-order-cart' ), 'description' => __( 'Set the text color of the Checkout button.', 'ips-order-cart' ), 'default' => '#ffffff', ], [ 'key' => 'ips-color-footer-bg', 'section' => 'sidecart_style_settings_tabs', 'type' => 'color', 'label' => __( 'Footer Background Color', 'ips-order-cart' ), 'description' => __( 'Set the background color of the footer.', 'ips-order-cart' ), 'default' => '#ffffff', ], ], ], [ 'id' => 'sidecart_style_shipping', 'title' => __( 'Free Shipping', 'ips-order-cart' ), 'description' => __( 'Configure the progress bar colors for free shipping messaging.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'sidecart_freeshipping_indicator_color', 'section' => 'sidecart_style_settings_tabs', 'type' => 'color', 'label' => __( 'Progress indicator color', 'ips-order-cart' ), 'description' => __( 'Set the color of the free shipping progress indicator.', 'ips-order-cart' ), 'default' => '#111827', ], [ 'key' => 'sidecart_freeshipping_track_color', 'section' => 'sidecart_style_settings_tabs', 'type' => 'color', 'label' => __( 'Progress track color', 'ips-order-cart' ), 'description' => __( 'Set the background color of the free shipping progress bar.', 'ips-order-cart' ), 'default' => '#eef2f7', ], ], ], [ 'id' => 'sidecart_express_payments', 'title' => __( 'Express payments', 'ips-order-cart' ), 'description' => __( 'Show supported wallet buttons in the IPS Sidecart.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'sidecart_enable_express_payments', 'section' => 'sidecart_main_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show express payments in the Sidecart', 'ips-order-cart' ), 'description' => __( 'Display verified wallet buttons when the cart and payment provider support them.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'sidecart_express_provider_policy', 'section' => 'sidecart_main_settings_tabs', 'type' => 'select', 'label' => __( 'Provider selection', 'ips-order-cart' ), 'description' => __( 'Limit Sidecart Express to providers that are known to work in the Sidecart.', 'ips-order-cart' ), 'default' => 'verified_only', 'options' => [ 'verified_only' => __( 'Verified providers', 'ips-order-cart' ), 'stripe_only' => __( 'Stripe only', 'ips-order-cart' ), ], ], [ 'key' => 'sidecart_express_render_mode', 'section' => 'sidecart_main_settings_tabs', 'type' => 'select', 'label' => __( 'Payment loading', 'ips-order-cart' ), 'description' => __( 'Use verified IPS Sidecart adapters first. Woo compatibility mode is mainly for provider checks when a direct Sidecart adapter is not enough.', 'ips-order-cart' ), 'default' => 'safe_inline', 'options' => [ 'safe_inline' => __( 'Verified IPS Sidecart adapters', 'ips-order-cart' ), 'woo_native_shell' => __( 'Woo compatibility mode', 'ips-order-cart' ), ], ], [ 'key' => 'sidecart_enable_woopayments_ece_bridge', 'section' => 'sidecart_main_settings_tabs', 'type' => 'toggle', 'label' => __( 'WooPayments wallets', 'ips-order-cart' ), 'description' => __( 'Allow Apple Pay, Google Pay and Amazon Pay from WooPayments through the verified IPS Sidecart bridge.', 'ips-order-cart' ), 'default' => true, ], ], ], [ 'id' => 'sidecart_style_baseframe', 'title' => __( 'Frame & Spacing', 'ips-order-cart' ), 'description' => __( 'Skeleton, frame color and padding.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'ipscmi-order-cart-sidecart-skeletoncolor', 'section' => 'sidecart_style_settings_tabs', 'type' => 'color', 'label' => __( 'Skeleton Color', 'ips-order-cart' ), 'description' => __( 'Set the skeleton loading color.', 'ips-order-cart' ), 'default' => '#f1f5f9', ], [ 'key' => 'color-cartframe-bg', 'section' => 'sidecart_style_settings_tabs', 'type' => 'color', 'label' => __( 'Cart Frame Color', 'ips-order-cart' ), 'description' => __( 'Set the background color of the background frame.', 'ips-order-cart' ), 'default' => '#f8fafc', ], [ 'key' => 'ips-baseframe-padding-left', 'section' => 'sidecart_style_settings_tabs', 'type' => 'number', 'label' => __( 'Frame padding left', 'ips-order-cart' ), 'description' => __( 'Size in px', 'ips-order-cart' ), 'default' => 5, ], [ 'key' => 'ips-baseframe-padding-right', 'section' => 'sidecart_style_settings_tabs', 'type' => 'number', 'label' => __( 'Frame padding right', 'ips-order-cart' ), 'description' => __( 'Size in px', 'ips-order-cart' ), 'default' => 0, ], [ 'key' => 'ips-baseframe-padding-top', 'section' => 'sidecart_style_settings_tabs', 'type' => 'number', 'label' => __( 'Frame padding top', 'ips-order-cart' ), 'description' => __( 'Size in px', 'ips-order-cart' ), 'default' => 0, ], [ 'key' => 'ips-baseframe-padding-bottom', 'section' => 'sidecart_style_settings_tabs', 'type' => 'number', 'label' => __( 'Frame padding bottom', 'ips-order-cart' ), 'description' => __( 'Size in px', 'ips-order-cart' ), 'default' => 0, ], [ 'key' => 'ips-content-padding-left', 'section' => 'sidecart_style_settings_tabs', 'type' => 'number', 'label' => __( 'Content padding left', 'ips-order-cart' ), 'description' => __( 'Size in px', 'ips-order-cart' ), 'default' => 0, ], [ 'key' => 'ips-content-padding-right', 'section' => 'sidecart_style_settings_tabs', 'type' => 'number', 'label' => __( 'Content padding right', 'ips-order-cart' ), 'description' => __( 'Size in px', 'ips-order-cart' ), 'default' => 0, ], ], ], [ 'id' => 'checkout_cart', 'title' => __( 'Cart', 'ips-order-cart' ), 'description' => __( 'Cart page layout settings. WooCommerce remains the source for cart data, totals and actions.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'enable_cart_page', 'section' => 'cart_page_settings_tabs', 'type' => 'toggle', 'label' => __( 'Activate Cart page layout', 'ips-order-cart' ), 'description' => __( 'Enable this option to activate the IPS cart page layout layer.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'ips_cart_page_layout', 'section' => 'cart_page_settings_tabs', 'type' => 'select', 'label' => __( 'Cart render mode', 'ips-order-cart' ), 'description' => __( 'Choose between the current WooCommerce cart and the IPS cart. The IPS cart requires the WooCommerce Cart block on the assigned cart page.', 'ips-order-cart' ), 'default' => 'ips_react_portal', 'allowEmpty' => false, 'options' => [ 'ips_php_template' => __( 'WooCommerce cart (current cart page)', 'ips-order-cart' ), 'ips_react_portal' => __( 'IPS Cart', 'ips-order-cart' ), ], ], [ 'key' => 'ips_cart_page_heading', 'section' => 'cart_page_settings_tabs', 'type' => 'text', 'label' => __( 'Cart heading', 'ips-order-cart' ), 'description' => __( 'Optional heading used by the IPS cart layout layer.', 'ips-order-cart' ), 'default' => __( 'Cart', 'ips-order-cart' ), ], [ 'key' => 'ips_cart_page_auto_update_quantities', 'section' => 'cart_page_settings_tabs', 'type' => 'toggle', 'label' => __( 'Auto-update cart quantities', 'ips-order-cart' ), 'description' => __( 'Automatically update the cart after quantity changes in the IPS cart.', 'ips-order-cart' ), 'default' => false, ], ], ], [ 'id' => 'checkout_thankyou', 'title' => __( 'Thank you page', 'ips-order-cart' ), 'description' => __( 'Thankyou page activation and headline.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'enable_thankyou', 'section' => 'thankyou_general_tabs', 'type' => 'toggle', 'label' => __( 'Activate Thankyou page', 'ips-order-cart' ), 'description' => __( 'Enable this option to activate the Thankyou page.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'thankyou_headline', 'section' => 'thankyou_general_tabs', 'type' => 'text', 'label' => __( 'Thankyou headline', 'ips-order-cart' ), 'description' => __( 'Enter your Thankyou headline text. It is displayed above the Thankyou page.', 'ips-order-cart' ), 'default' => __( 'Thank-you', 'ips-order-cart' ), ], [ 'key' => 'thankyou_render_mode', 'section' => 'thankyou_general_tabs', 'type' => 'select', 'label' => __( 'Thankyou render mode', 'ips-order-cart' ), 'description' => __( 'Choose between the classic IPS layout and the IPS portal page.', 'ips-order-cart' ), 'default' => 'corekit_react_portal', 'options' => [ 'corekit_php' => __( 'Classic IPS layout', 'ips-order-cart' ), 'corekit_react_portal' => __( 'IPS portal page', 'ips-order-cart' ), ], ], [ 'key' => 'thankyou_clear_cart_after_order', 'section' => 'thankyou_general_tabs', 'type' => 'toggle', 'label' => __( 'Clear cart after successful order', 'ips-order-cart' ), 'description' => __( 'Clear the WooCommerce cart when the IPS thankyou portal confirms a successful or accepted order. Failed or cancelled payments keep the cart available for retry.', 'ips-order-cart' ), 'default' => true, ], ], ], [ 'id' => 'checkout_main', 'title' => __( 'Checkout', 'ips-order-cart' ), 'description' => __( 'Checkout flow and summary behavior.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'enable_checkout', 'section' => 'checkout_settings_tabs', 'type' => 'toggle', 'label' => __( 'Activate Checkout', 'ips-order-cart' ), 'description' => __( 'Enable this option to activate the Checkout page.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'ips_checkout_render_mode', 'section' => 'checkout_settings_tabs', 'type' => 'select', 'label' => __( 'Checkout render mode', 'ips-order-cart' ), 'description' => __( 'Choose between the current WooCommerce checkout and the IPS checkout. The IPS checkout requires the WooCommerce Checkout block on the assigned checkout page.', 'ips-order-cart' ), 'default' => 'ips_react_portal', 'allowEmpty' => false, 'options' => [ 'legacy_react' => __( 'WooCommerce checkout (current checkout page)', 'ips-order-cart' ), 'ips_react_portal' => __( 'IPS Checkout', 'ips-order-cart' ), ], ], [ 'key' => 'ips-checkout-cartsummary-icon', 'section' => 'checkout_settings_tabs', 'type' => 'media-image', 'label' => __( 'Cart Summary Icon', 'ips-order-cart' ), 'default' => '', ], [ 'key' => 'ips-checkout-cartsummary-text', 'section' => 'checkout_settings_tabs', 'type' => 'text', 'label' => __( 'Cart Summary Text', 'ips-order-cart' ), 'description' => __( 'Enter your text. It is displayed under the basket.', 'ips-order-cart' ), 'default' => __( 'Sustainability is important to us!', 'ips-order-cart' ), ], [ 'key' => 'ips_checkout_mobile_summary_mode', 'section' => 'checkout_settings_tabs', 'type' => 'select', 'label' => __( 'Mobile order summary', 'ips-order-cart' ), 'description' => __( 'Keep the order summary open on mobile devices or let customers expand it when needed. Desktop checkout remains unchanged.', 'ips-order-cart' ), 'default' => 'collapsible', 'allowEmpty' => false, 'options' => [ 'expanded' => __( 'Always expanded', 'ips-order-cart' ), 'collapsible' => __( 'Collapsible on mobile', 'ips-order-cart' ), ], ], [ 'key' => 'ips_checkout_terms_mode', 'section' => 'checkout_settings_tabs', 'type' => 'select', 'label' => __( 'Terms acceptance', 'ips-order-cart' ), 'description' => __( 'Require an explicit terms checkbox or show a modern consent notice directly before the final purchase action. WooCommerce Germanized keeps ownership of its own legal consent controls.', 'ips-order-cart' ), 'default' => 'required_checkbox', 'allowEmpty' => false, 'options' => [ 'required_checkbox' => __( 'Required checkbox', 'ips-order-cart' ), 'inline_notice' => __( 'Consent notice without checkbox', 'ips-order-cart' ), ], ], [ 'key' => 'ips_checkout_direct_express_mode', 'section' => 'checkout_settings_tabs', 'type' => 'select', 'label' => __( 'Direct Express checkout', 'ips-order-cart' ), 'description' => __( 'Allow eligible Express wallets to use their documented completion flow with a compact linked legal notice, or require the final IPS review. Direct-only wallets that cannot return to the review step are then hidden. Detailed provider behavior is listed under Diagnose > Checkout status.', 'ips-order-cart' ), 'default' => 'provider_direct', 'allowEmpty' => false, 'options' => [ 'provider_direct' => __( 'Provider-specific Express behavior', 'ips-order-cart' ), 'require_review' => __( 'Require final IPS review', 'ips-order-cart' ), ], ], [ 'key' => 'ips_checkout_select_checkoutsteps', 'visibleWhen' => [ 'field' => 'ips_checkout_render_mode', 'equals' => 'legacy_react' ], 'section' => 'checkout_settings_tabs', 'type' => 'select', 'label' => __( 'Selected checkout steps', 'ips-order-cart' ), 'description' => __( 'The IPS checkout uses three steps with a final order review. WooCommerce controls the flow when its checkout is selected.', 'ips-order-cart' ), 'default' => 'select3', 'options' => [ 'select2' => __( 'Two step checkout (WooCommerce / legacy only)', 'ips-order-cart' ), 'select3' => __( 'Three steps checkout', 'ips-order-cart' ), ], ], [ 'key' => 'ips_checkout_summary_item_remove_enabled', 'section' => 'checkout_settings_tabs', 'type' => 'toggle', 'label' => __( 'Allow item removal in checkout summary', 'ips-order-cart' ), 'description' => __( 'Show the remove button for cart items inside the IPS checkout summary.', 'ips-order-cart' ), 'default' => true, ], [ 'key' => 'ips_checkout_summary_item_quantity_enabled', 'section' => 'checkout_settings_tabs', 'type' => 'toggle', 'label' => __( 'Allow item quantity changes in checkout summary', 'ips-order-cart' ), 'description' => __( 'Show quantity controls for cart items inside the IPS checkout summary.', 'ips-order-cart' ), 'default' => true, ], [ 'key' => 'ips_checkout_allow_woo_checkout_fallback_gateways', 'section' => 'checkout_settings_tabs', 'type' => 'toggle', 'label' => __( 'Allow Woo checkout exception for unsupported gateways', 'ips-order-cart' ), 'description' => __( 'Keep unsupported gateways hidden by default. Enable this option only if selected gateways should remain visible in the IPS portal with a clear Woo checkout-only note and exception path.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'ips_checkout_woo_fallback_gateway_ids', 'section' => 'checkout_settings_tabs', 'type' => 'multiselect', 'label' => __( 'Gateways allowed as Woo checkout exceptions', 'ips-order-cart' ), 'description' => __( 'Select the unsupported gateways that may stay visible inside the IPS portal with a Woo checkout-only note. All other unsupported gateways remain hidden.', 'ips-order-cart' ), 'default' => [], 'options' => [], ], [ 'key' => 'ips_checkout_portal_notices_enabled', 'section' => 'checkout_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show portal compatibility notices in checkout', 'ips-order-cart' ), 'description' => __( 'Displays selected gateway compatibility hints directly inside the visible IPS checkout. Keep this disabled for normal customer-facing checkouts and enable it only for shop-owner verification or development.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'ips_checkout_portal_detailed_notices_enabled', 'section' => 'checkout_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show detailed gateway context notices', 'ips-order-cart' ), 'description' => __( 'Adds detailed Woo context and roadmap notices for portal-ready gateways hidden by the current cart, subscription, currency, country or provider context. Requires portal compatibility notices to be enabled.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'enable_checkout_finalordercheck', 'section' => 'checkout_settings_tabs', 'type' => 'toggle', 'label' => __( 'Activate final order review', 'ips-order-cart' ), 'visibleWhen' => [ 'field' => 'ips_checkout_render_mode', 'equals' => 'legacy_react' ], 'description' => __( 'Enable this option to activate the final order review before handling payment. In portal mode this keeps terms, order notes and final submit on a separate review step.', 'ips-order-cart' ), 'default' => false, ], ], ], [ 'id' => 'checkout_style', 'title' => __( 'Style', 'ips-order-cart' ), 'description' => __( 'Checkout layout appearance settings.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'ips_checkout_frame_enabled', 'section' => 'checkout_style_settings_tabs', 'type' => 'toggle', 'label' => __( 'Show checkout section frame', 'ips-order-cart' ), 'description' => __( 'Display the outer border and shadow around the checkout flow sections.', 'ips-order-cart' ), 'default' => true, ], [ 'key' => 'ips_checkout_layout_density', 'section' => 'checkout_style_settings_tabs', 'type' => 'select', 'label' => __( 'Checkout layout density', 'ips-order-cart' ), 'description' => __( 'Choose how compact checkout sections and fields appear.', 'ips-order-cart' ), 'default' => 'compact', 'allowEmpty' => false, 'options' => [ 'elegant' => __( 'Elegant / Slim', 'ips-order-cart' ), 'compact' => __( 'Compact', 'ips-order-cart' ), 'comfortable' => __( 'Comfortable', 'ips-order-cart' ), ], ], [ 'key' => 'ips_checkout_layout_width', 'section' => 'checkout_style_settings_tabs', 'type' => 'select', 'label' => __( 'Checkout width', 'ips-order-cart' ), 'description' => __( 'Choose how wide the IPS checkout layout appears on desktop screens.', 'ips-order-cart' ), 'default' => 'default', 'allowEmpty' => false, 'options' => [ 'default' => __( 'Default', 'ips-order-cart' ), 'narrow' => __( 'Narrow', 'ips-order-cart' ), 'wide' => __( 'Wide', 'ips-order-cart' ), ], ], [ 'key' => 'ips_checkout_primary_action_color', 'section' => 'checkout_style_settings_tabs', 'type' => 'color', 'label' => __( 'Primary action color', 'ips-order-cart' ), 'description' => __( 'Brand color used for primary checkout buttons and active checkout steps.', 'ips-order-cart' ), 'default' => '#1a1a1a', ], [ 'key' => 'ips_portal_summary_panel_background', 'section' => 'checkout_style_settings_tabs', 'type' => 'color', 'label' => __( 'Summary panel background', 'ips-order-cart' ), 'description' => __( 'Background color for the right summary panel area in IPS portal layouts.', 'ips-order-cart' ), 'default' => '#f5f5f5', ], [ 'key' => 'ips_portal_summary_panel_background_surfaces', 'section' => 'checkout_style_settings_tabs', 'type' => 'multiselect', 'label' => __( 'Apply summary panel background to', 'ips-order-cart' ), 'description' => __( 'Choose which IPS portal pages use the configured summary panel background color.', 'ips-order-cart' ), 'default' => [ 'checkout', 'cart', 'thankyou' ], 'options' => [ 'checkout' => __( 'Checkout', 'ips-order-cart' ), 'cart' => __( 'Cart page', 'ips-order-cart' ), 'thankyou' => __( 'Thank-you page', 'ips-order-cart' ), ], ], ], ], [ 'id' => 'cartgate_settings', 'title' => __( 'Cart Gate', 'ips-order-cart' ), 'description' => __( 'Controls Cart Gate behavior, notices, and compatibility.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'enable_cartgate', 'section' => 'cartgate_general_tabs', 'type' => 'toggle', 'label' => __( 'Activate Cart Gate', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'cartgate_notice_auto_slot_single_product', 'section' => 'cartgate_general_tabs', 'type' => 'toggle', 'label' => __( 'Show notice slot on product pages', 'ips-order-cart' ), 'description' => __( 'Shows the Cart Gate notice slot before the add-to-cart form on single product pages. Manual shortcode slots still take priority.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'cartgate_notice_auto_slot_shop_archive', 'section' => 'cartgate_general_tabs', 'type' => 'toggle', 'label' => __( 'Show notice slot on shop and archive pages', 'ips-order-cart' ), 'description' => __( 'Shows the Cart Gate notice slot before product loops on shop, category, and tag archive pages. Manual shortcode slots still take priority.', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'prevent_cartgate_cart_merge', 'section' => 'cartgate_general_tabs', 'type' => 'toggle', 'label' => __( 'Prevent saved cart merge on shop pages', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'cartgate_merge_checkout', 'section' => 'cartgate_general_tabs', 'type' => 'toggle', 'label' => __( 'Prevent saved cart merge during checkout', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'load_cartgate_server_cart', 'section' => 'cartgate_general_tabs', 'type' => 'toggle', 'label' => __( 'Use server cart data for client checks', 'ips-order-cart' ), 'default' => false, ], [ 'key' => 'cartgate_client_precheck_first', 'section' => 'cartgate_general_tabs', 'type' => 'toggle', 'label' => __( 'Check rules before add-to-cart', 'ips-order-cart' ), 'description' => __( 'Checks supported cart rules before adding a product. The server also validates the rules.', 'ips-order-cart' ), 'default' => false, ], ], ], [ 'id' => 'localpickup_settings', 'title' => __( 'Local Pickup', 'ips-order-cart' ), 'description' => __( 'Enable pickup locations and selection during checkout.', 'ips-order-cart' ), 'fields' => [ [ 'key' => 'enable_localpickup', 'section' => 'localpickup_general_tabs', 'type' => 'toggle', 'label' => __( 'Activate Local Pickup', 'ips-order-cart' ), 'default' => false, ], ], ], ] ); if ( \IPSCMI\Order\Cart\Config\PackageProfile::from_runtime()->is_wordpress_org() ) { $sections = array_values( array_filter( $sections, static function ( array $section ): bool { return 'general' !== $section['id']; } ) ); } return $sections; } /** * @return array> */ public static function fields(): array { $fields = []; foreach ( self::sections() as $section ) { foreach ( $section['fields'] as $field ) { $fields[ $field['key'] ] = $field; } } return $fields; } /** * Historical Codestar keys that are intentionally kept outside the * customer-facing React schema. * * These values are seeded only when missing and are otherwise preserved. * This lets upgrades keep legacy data without reviving retired controls. * * @return array> */ public static function legacy_compatibility_fields(): array { return [ 'ips_wooadvancedcart_credentials' => [ 'key' => 'ips_wooadvancedcart_credentials', 'section' => 'generalsettings_cart_advanced_settings_tabs', 'type' => 'text', 'default' => '', 'status' => 'retired', 'persistence' => 'preserve_only', 'replacement' => 'none_public_runtime_removed', ], 'sidecart_header_variation' => [ 'key' => 'sidecart_header_variation', 'section' => 'sidecart_style_settings_tabs', 'type' => 'text', 'default' => 'headerview1', 'status' => 'retired', 'persistence' => 'preserve_only', 'replacement' => 'sidecart_header_*', ], 'sidecart_body_variation' => [ 'key' => 'sidecart_body_variation', 'section' => 'sidecart_style_settings_tabs', 'type' => 'text', 'default' => 'bodyview1', 'status' => 'retired', 'persistence' => 'preserve_only', 'replacement' => 'sidecart_item_*', ], 'sidecart_footer_variation' => [ 'key' => 'sidecart_footer_variation', 'section' => 'sidecart_style_settings_tabs', 'type' => 'text', 'default' => 'footerview1', 'status' => 'retired', 'persistence' => 'preserve_only', 'replacement' => 'sidecart_footer_*', ], 'ipsbasket-custom-icon' => [ 'key' => 'ipsbasket-custom-icon', 'section' => 'sidecart_main_settings_tabs', 'type' => 'media-image', 'default' => '', 'status' => 'retired', 'persistence' => 'preserve_only', 'replacement' => 'sidecart_custom_image', ], 'orderbumps_show' => [ 'key' => 'orderbumps_show', 'section' => 'orderbumps_main_settings_tabs', 'type' => 'toggle', 'default' => 'off', 'status' => 'retired', 'persistence' => 'preserve_only', 'replacement' => 'enable_orderbumps', ], 'sidecart_freeshipping_full_categorie' => [ 'key' => 'sidecart_freeshipping_full_categorie', 'section' => 'sidecart_main_settings_tabs', 'type' => 'multiselect', 'default' => [], 'status' => 'retired', 'persistence' => 'preserve_only', 'replacement' => 'woocommerce_shipping_rates', ], 'sidecart_express_position' => [ 'key' => 'sidecart_express_position', 'section' => 'sidecart_main_settings_tabs', 'type' => 'select', 'default' => 'after_totals_before_footer', 'status' => 'retired', 'persistence' => 'preserve_only', 'replacement' => 'fixed_after_totals_before_footer', ], 'ips_cartgate_selecttheme' => [ 'key' => 'ips_cartgate_selecttheme', 'section' => 'cartgate_general_tabs', 'type' => 'select', 'default' => 'theme0', 'status' => 'retired', 'persistence' => 'preserve_only', 'replacement' => 'ips_cartgate_runtime', ], 'ips_checkoutgate_selecttheme' => [ 'key' => 'ips_checkoutgate_selecttheme', 'section' => 'checkoutgate_general_tabs', 'type' => 'select', 'default' => 'theme0', 'status' => 'retired', 'persistence' => 'preserve_only', 'replacement' => 'woocommerce_and_ips_checkout', ], 'ips_localpickup_selecttheme' => [ 'key' => 'ips_localpickup_selecttheme', 'section' => 'localpickup_general_tabs', 'type' => 'select', 'default' => 'theme0', 'status' => 'retired', 'persistence' => 'preserve_only', 'replacement' => 'woocommerce_local_pickup', ], ]; } /** * @return array|null */ public static function field( string $key ): ?array { $fields = self::fields(); return $fields[ $key ] ?? null; } /** * @return array */ public static function defaults(): array { $defaults = []; foreach ( self::fields() as $key => $field ) { $defaults[ $key ] = $field['default'] ?? null; } return $defaults; } }