'; echo __( 'User Registration', 'affiliates' ); echo ''; echo '

'; echo __( 'Here you can enable the built-in User Registration integration which allows to grant commissions to affiliates when they refer new users.', 'affiliates' ); echo '

'; // save if ( isset( $_POST['action'] ) && $_POST['action'] == 'save' ) { if ( isset( $_POST['affiliates-user-registraton-admin'] ) && wp_verify_nonce( $_POST['affiliates-user-registraton-admin'], 'save' ) ) { delete_option( 'aff_user_registration_enabled' ); if ( !empty( $_POST['enabled'] ) ) { add_option( 'aff_user_registration_enabled', 'yes', '', 'no' ); } if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) { delete_option( 'aff_customer_registration_enabled' ); if ( !empty( $_POST['customer_enabled'] ) ) { add_option( 'aff_customer_registration_enabled', 'yes', '', 'no' ); } } if ( AFFILIATES_PLUGIN_NAME != 'affiliates' ) { delete_option( 'aff_user_registration_base_amount' ); if ( !empty( $_POST['base_amount'] ) ) { $base_amount = floatval( $_POST['base_amount'] ); if ( $base_amount < 0 ) { $base_amount = 0; } add_option( 'aff_user_registration_base_amount', $base_amount, '', 'no' ); } } delete_option( 'aff_user_registration_amount' ); if ( !empty( $_POST['amount'] ) ) { $amount = floatval( $_POST['amount'] ); if ( $amount < 0 ) { $amount = 0; } add_option( 'aff_user_registration_amount', $amount, '', 'no' ); } delete_option( 'aff_user_registration_currency' ); if ( !empty( $_POST['currency'] ) ) { add_option( 'aff_user_registration_currency', $_POST['currency'], '', 'no' ); } delete_option( 'aff_user_registration_referral_status' ); if ( !empty( $_POST['status'] ) ) { add_option( 'aff_user_registration_referral_status', $_POST['status'], '', 'no' ); } } } $user_registration_enabled = get_option( 'aff_user_registration_enabled', 'no' ); if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) { $customer_registration_enabled = get_option( 'aff_customer_registration_enabled', 'no' ); } if ( AFFILIATES_PLUGIN_NAME != 'affiliates' ) { $user_registration_base_amount = get_option( 'aff_user_registration_base_amount', '' ); } $user_registration_amount = get_option( 'aff_user_registration_amount', '0' ); $user_registration_currency = get_option( 'aff_user_registration_currency', Affiliates::DEFAULT_CURRENCY ); $user_registration_referral_status = get_option( 'aff_user_registration_referral_status', get_option( 'aff_default_referral_status', AFFILIATES_REFERRAL_STATUS_ACCEPTED ) ); echo ''; echo '
'; echo '
'; // enable echo '
'; echo ''; echo '
'; // enable customer if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) { echo '
'; echo ''; echo ' '; echo ''; echo __( 'If the user registration integration should create referrals for new customers that register at checkout, this option should be enabled.', 'affiliates' ); echo ''; echo '
'; } // base amount if ( AFFILIATES_PLUGIN_NAME != 'affiliates' ) { echo '
'; echo ''; echo ''; echo __( 'When an affiliate refers a new user, a referral is recorded, granting the affiliate an amount in the chosen currency. The amount is calculated taking this base amount into account. For example, if a general referral rate is set, the referral amount equals this base amount multipied by the referral rate.', 'affiliates' ); echo ' '; echo __( 'If set, this Base Amount takes precedence over the Amount.', 'affiliates' ); if ( AFFILIATES_PLUGIN_NAME == 'affiliates-enterprise' ) { echo ' '; echo __( 'If multi-tiered referrals are enabled and level rates are not relative, this Base Amount must be used instead of the Amount.', 'affiliates' ); } echo ''; echo '
'; } // amount echo '
'; echo ''; echo ''; echo __( 'When an affiliate refers a new user, a referral is recorded, granting the affiliate this amount in the chosen currency.', 'affiliates' ); echo ''; echo '
'; // currency $currency_select = ''; echo '
'; echo ''; echo '
'; $status_descriptions = array( AFFILIATES_REFERRAL_STATUS_ACCEPTED => __( 'Accepted', 'affiliates' ), AFFILIATES_REFERRAL_STATUS_CLOSED => __( 'Closed', 'affiliates' ), AFFILIATES_REFERRAL_STATUS_PENDING => __( 'Pending', 'affiliates' ), AFFILIATES_REFERRAL_STATUS_REJECTED => __( 'Rejected', 'affiliates' ), ); $status_select = ""; echo '
'; echo ''; echo '

'; echo __( 'The status for referrals that record commissions when affiliates refer new users.', 'affiliates' ); echo '

'; echo '
'; echo '

'; echo __( 'Recommended choices for the referral status are Accepted and Pending.', 'affiliates' ); echo '

'; echo ''; echo '
'; wp_nonce_field( 'save', 'affiliates-user-registraton-admin', true, true ); echo ''; echo ''; echo '
'; echo '
'; echo '
'; affiliates_footer(); }