'title', 'id' => 'aisp_otools_general_section', 'title' => __( 'General Settings', 'aisp-order-tools-for-woocommerce' ), 'desc' => __( 'Configure manual payment capabilities for admins.', 'aisp-order-tools-for-woocommerce' ), ], [ 'title' => __( 'Safe Admin Checkout', 'aisp-order-tools-for-woocommerce' ), 'type' => 'title', 'id' => 'aisp_otools_safe_admin_title', 'desc' => __( 'Prevent accidental reuse of old carts or addresses when creating frontend admin orders.', 'aisp-order-tools-for-woocommerce' ), ], [ 'title' => __( 'Enable Safe Admin Checkout Mode', 'aisp-order-tools-for-woocommerce' ), 'desc' => __( 'Show a confirmation popup when an admin starts a frontend order while a cart or session already exists.', 'aisp-order-tools-for-woocommerce' ), 'id' => 'aisp_otools_enable_safe_admin_checkout', 'type' => 'checkbox', 'default' => 'yes', ], [ 'title' => __( 'Allow payment for "On hold, Pending or Failed" orders', 'aisp-order-tools-for-woocommerce' ), 'desc' => __( 'Enable this to allow admins to pay for orders with "On hold", "Pending" or "Failed" status.', 'aisp-order-tools-for-woocommerce' ), 'id' => 'aisp_otools_allow_on_hold_payment', 'type' => 'checkbox', 'default' => 'no', ], [ 'title' => __( 'Enable admin custom items', 'aisp-order-tools-for-woocommerce' ), 'desc' => __( 'Automatically creates two hidden products: one taxable and one non-taxable, used for admin manual adjustments.', 'aisp-order-tools-for-woocommerce' ), 'id' => 'aisp_otools_add_custom_item', 'type' => 'checkbox', 'default' => 'no', ], [ 'title' => __( 'Base product name', 'aisp-order-tools-for-woocommerce' ), 'id' => 'aisp_otools_custom_item_base_name', 'type' => 'text', 'default' => __( 'Custom Item', 'aisp-order-tools-for-woocommerce' ), 'desc_tip'=> __( 'Used to generate two hidden versions: “(Taxable)” and “(No tax)”. The plugin will manage the two labels automatically.', 'aisp-order-tools-for-woocommerce' ), ], [ 'type' => 'sectionend', 'id' => 'aisp_otools_general_section', ], [ 'type' => 'title', 'id' => 'aisp_otools_admin_redirect_section', 'title' => __( 'Admin Post-Order Redirect', 'aisp-order-tools-for-woocommerce' ), 'desc' => __( 'After placing a frontend order as admin, redirect to a more useful destination instead of the customer confirmation page.', 'aisp-order-tools-for-woocommerce' ), ], [ 'title' => __( 'Enable admin redirect after checkout', 'aisp-order-tools-for-woocommerce' ), 'desc' => __( 'Redirect admin users to a backend page after a frontend order is completed.', 'aisp-order-tools-for-woocommerce' ), 'id' => 'aisp_otools_enable_admin_redirect', 'type' => 'checkbox', 'default' => 'yes', ], [ 'title' => __( 'Redirect destination', 'aisp-order-tools-for-woocommerce' ), 'id' => 'aisp_otools_admin_redirect_destination', 'type' => 'select', 'default' => 'order', 'options' => [ 'order' => __( 'Order page', 'aisp-order-tools-for-woocommerce' ), 'order_list' => __( 'Orders list', 'aisp-order-tools-for-woocommerce' ), 'dashboard' => __( 'WP Dashboard', 'aisp-order-tools-for-woocommerce' ), ], ], [ 'type' => 'sectionend', 'id' => 'aisp_otools_admin_redirect_section', ], ]; $stock_enabled = wc_string_to_bool( get_option( 'woocommerce_manage_stock' ) ); $settings[] = [ 'type' => 'title', 'id' => 'aisp_otools_hold_stock_section', 'title' => __( 'Unpaid Order Timeout', 'aisp-order-tools-for-woocommerce' ), 'desc' => __( 'Configure automatic cancellation of unpaid orders.', 'aisp-order-tools-for-woocommerce' ), ]; if ( $stock_enabled ) { $settings[] = [ 'title' => __( 'Pending order timeout (days)', 'aisp-order-tools-for-woocommerce' ), 'desc' => __( 'Automatically cancel unpaid orders after this delay.', 'aisp-order-tools-for-woocommerce' ), 'id' => 'aisp_otools_pending_timeout_days', 'type' => 'number', 'default' => 4, 'custom_attributes' => [ 'min' => 0, 'step' => 1, ], 'desc_tip' => __( 'This value is synced with WooCommerce inventory hold stock duration.', 'aisp-order-tools-for-woocommerce' ), 'class' => 'aisp-otools-number-small', ]; } else { $settings[] = [ 'type' => 'aisp_html', 'id' => 'aisp_otools_stock_disabled_notice', 'html' => '

⚠ ' . __( 'Stock management is disabled. Automatic cancellation of unpaid orders is inactive.', 'aisp-order-tools-for-woocommerce' ) . '
' . __( 'Enable it in WooCommerce → Settings → Products → Inventory to activate this feature.', 'aisp-order-tools-for-woocommerce' ) . '

', ]; } $settings[] = [ 'type' => 'sectionend', 'id' => 'aisp_otools_hold_stock_section', ]; return apply_filters( 'aisp_otools_phoneorder_settings', $settings ); } }