'; 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 ''; affiliates_footer(); }