get_wizard_config() ); } /** * Get the wizard configuration * * @return array */ public function get_wizard_config() { return [ 'plugin_slug' => 'affiliates-for-woocommerce', 'plugin_file' => 'affiliates-for-woocommerce/functions.php', 'dashboard_page' => 'ddwcaf-dashboard', 'redirect_url' => admin_url( 'admin.php?page=ddwcaf-dashboard' ), 'brand' => [ 'name' => esc_html__( 'Affiliates', 'affiliates-for-woocommerce' ), 'description' => esc_html__( "Welcome to Affiliates for WooCommerce! Let's quickly set up your affiliate network so you can start growing your sales.", 'affiliates-for-woocommerce' ), 'logo' => '', ], 'steps' => [ 'welcome' => [ 'label' => esc_html__( 'Welcome', 'affiliates-for-woocommerce' ), 'view_callback' => [ $this, 'welcome_view' ], ], 'general' => [ 'label' => esc_html__( 'General Settings', 'affiliates-for-woocommerce' ), 'title' => esc_html__( 'Basic Configuration', 'affiliates-for-woocommerce' ), 'description' => esc_html__( 'Start by enabling the affiliate system and defining your base settings.', 'affiliates-for-woocommerce' ), 'view_callback' => [ $this, 'general_settings_view' ], 'save_callback' => [ $this, 'save_fields' ], ], 'referrals' => [ 'label' => esc_html__( 'Referral Settings', 'affiliates-for-woocommerce' ), 'title' => esc_html__( 'Referral Tracking', 'affiliates-for-woocommerce' ), 'description' => esc_html__( 'Define how referrals are tracked and how long the cookies should last.', 'affiliates-for-woocommerce' ), 'view_callback' => [ $this, 'referral_settings_view' ], 'save_callback' => [ $this, 'save_fields' ], ], 'commissions' => [ 'label' => esc_html__( 'Commissions', 'affiliates-for-woocommerce' ), 'title' => esc_html__( 'Commission Rates', 'affiliates-for-woocommerce' ), 'description' => esc_html__( 'Set the default commission structure for your affiliates.', 'affiliates-for-woocommerce' ), 'view_callback' => [ $this, 'commissions_settings_view' ], 'save_callback' => [ $this, 'save_fields' ], ], 'ready' => [ 'label' => esc_html__( 'Ready!', 'affiliates-for-woocommerce' ), 'ready_title' => esc_html__( 'Congratulations! Your affiliate network is ready.', 'affiliates-for-woocommerce' ), 'ready_description' => esc_html__( 'You can always adjust these settings and configure more advanced rules from the plugin dashboard.', 'affiliates-for-woocommerce' ), ], ], ]; } /** * Welcome view * * @return void */ public function welcome_view() { ?>

ID ] = $page->post_title; } } ?>
'ddwcaf-enabled', 'label' => esc_html__( 'Enable Affiliate System', 'affiliates-for-woocommerce' ), 'type' => 'checkbox', 'value' => get_option( '_ddwcaf_enabled', 'yes' ), 'name' => '_ddwcaf_enabled', 'description' => esc_html__( 'Toggle the entire affiliate system on or off.', 'affiliates-for-woocommerce' ), ], [ 'id' => 'ddwcaf-affiliate-dashboard-page-id', 'label' => esc_html__( 'Affiliate Dashboard Page', 'affiliates-for-woocommerce' ), 'type' => 'select', 'options' => $pages_options, 'value' => get_option( '_ddwcaf_affiliate_dashboard_page_id' ), 'name' => '_ddwcaf_affiliate_dashboard_page_id', 'description' => esc_html__( 'Select the page that will be used as the affiliate dashboard.', 'affiliates-for-woocommerce' ), ], ]; foreach ( $fields as $field ) { DDFW_Form_Field::display_form_field( $field ); } ?>
'ddwcaf-query-variable-name', 'label' => esc_html__( 'URL Parameter', 'affiliates-for-woocommerce' ), 'type' => 'text', 'value' => get_option( '_ddwcaf_query_variable_name', 'ref' ), 'name' => '_ddwcaf_query_variable_name', 'placeholder' => esc_html__( 'Default: ref', 'affiliates-for-woocommerce' ), 'description' => sprintf( esc_html__( 'The query string used to identify a referral (e.g., %s?ref=123).', 'affiliates-for-woocommerce' ), site_url() ), ], [ 'id' => 'ddwcaf-referral-cookie-expires', 'label' => esc_html__( 'Cookie Life (Days)', 'affiliates-for-woocommerce' ), 'type' => 'text', 'value' => get_option( '_ddwcaf_referral_cookie_expires', 7 ), 'name' => '_ddwcaf_referral_cookie_expires', 'description' => esc_html__( 'How long the tracking cookie remains active. Leave empty for session-only tracking.', 'affiliates-for-woocommerce' ), ], ]; foreach ( $fields as $field ) { DDFW_Form_Field::display_form_field( $field ); } ?>
'ddwcaf-default-commission-rate', 'label' => esc_html__( 'Default Commission (%)', 'affiliates-for-woocommerce' ), 'type' => 'number', 'value' => get_option( '_ddwcaf_default_commission_rate', 10 ), 'name' => '_ddwcaf_default_commission_rate', 'custom_attributes' => [ 'min' => 0, 'max' => 100 ], 'description' => esc_html__( 'The default percentage awarded for successful referrals. This can be overridden by specific rules or per-affiliate settings.', 'affiliates-for-woocommerce' ), ], ]; foreach ( $fields as $field ) { DDFW_Form_Field::display_form_field( $field ); } ?>