1.0 ) { $options[Affiliates_WPEC::REFERRAL_RATE] = 1.0; } else if ( $options[Affiliates_WPEC::REFERRAL_RATE] < 0 ) { $options[Affiliates_WPEC::REFERRAL_RATE] = 0.0; } } $options[Affiliates_WPEC::AUTO_ADJUST_ON_INCOMPLETE_SALE] = !empty( $_POST[Affiliates_WPEC::AUTO_ADJUST_ON_INCOMPLETE_SALE] ); $options[Affiliates_WPEC::AUTO_ADJUST_ON_ORDER_RECEIVED] = !empty( $_POST[Affiliates_WPEC::AUTO_ADJUST_ON_ORDER_RECEIVED] ); $options[Affiliates_WPEC::AUTO_ADJUST_ON_ACCEPTED_PAYMENT] = !empty( $_POST[Affiliates_WPEC::AUTO_ADJUST_ON_ACCEPTED_PAYMENT] ); $options[Affiliates_WPEC::AUTO_ADJUST_ON_JOB_DISPATCHED] = !empty( $_POST[Affiliates_WPEC::AUTO_ADJUST_ON_JOB_DISPATCHED] ); $options[Affiliates_WPEC::AUTO_ADJUST_ON_CLOSED_ORDER] = !empty( $_POST[Affiliates_WPEC::AUTO_ADJUST_ON_CLOSED_ORDER] ); $options[Affiliates_WPEC::AUTO_ADJUST_ON_DECLINED_PAYMENT] = !empty( $_POST[Affiliates_WPEC::AUTO_ADJUST_ON_DECLINED_PAYMENT] ); $options[Affiliates_WPEC::USAGE_STATS] = !empty( $_POST[Affiliates_WPEC::USAGE_STATS] ); } update_option( Affiliates_WPEC::PLUGIN_OPTIONS, $options ); } $referral_rate = isset( $options[Affiliates_WPEC::REFERRAL_RATE] ) ? $options[Affiliates_WPEC::REFERRAL_RATE] : Affiliates_WPEC::REFERRAL_RATE_DEFAULT; $on_incomplete_sale = isset( $options[Affiliates_WPEC::AUTO_ADJUST_ON_INCOMPLETE_SALE] ) ? $options[Affiliates_WPEC::AUTO_ADJUST_ON_INCOMPLETE_SALE] : Affiliates_WPEC::AUTO_ADJUST_DEFAULT; $on_order_received = isset( $options[Affiliates_WPEC::AUTO_ADJUST_ON_ORDER_RECEIVED] ) ? $options[Affiliates_WPEC::AUTO_ADJUST_ON_ORDER_RECEIVED] : Affiliates_WPEC::AUTO_ADJUST_DEFAULT; $on_accepted_payment = isset( $options[Affiliates_WPEC::AUTO_ADJUST_ON_ACCEPTED_PAYMENT] ) ? $options[Affiliates_WPEC::AUTO_ADJUST_ON_ACCEPTED_PAYMENT] : Affiliates_WPEC::AUTO_ADJUST_DEFAULT; $on_job_dispatched = isset( $options[Affiliates_WPEC::AUTO_ADJUST_ON_JOB_DISPATCHED] ) ? $options[Affiliates_WPEC::AUTO_ADJUST_ON_JOB_DISPATCHED] : Affiliates_WPEC::AUTO_ADJUST_DEFAULT; $on_closed_order = isset( $options[Affiliates_WPEC::AUTO_ADJUST_ON_CLOSED_ORDER] ) ? $options[Affiliates_WPEC::AUTO_ADJUST_ON_CLOSED_ORDER] : Affiliates_WPEC::AUTO_ADJUST_DEFAULT; $on_declined_payment = isset( $options[Affiliates_WPEC::AUTO_ADJUST_ON_DECLINED_PAYMENT] ) ? $options[Affiliates_WPEC::AUTO_ADJUST_ON_DECLINED_PAYMENT] : Affiliates_WPEC::AUTO_ADJUST_DEFAULT; $usage_stats = isset( $options[Affiliates_WPEC::USAGE_STATS] ) ? $options[Affiliates_WPEC::USAGE_STATS] : Affiliates_WPEC::USAGE_STATS_DEFAULT; echo '

' . __( 'Affiliates WP e-Commerce Integration', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '

' . __( 'Referral Rate', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; if ( class_exists( 'Affiliates_Referral' ) ) { $output .= '

'; $output .= __( 'The referral rate settings are as determined in Affiliates > Settings.', AFF_WPEC_PLUGIN_DOMAIN ); $output .= '

'; } else { $output .= '

'; $output .= ''; $output .= ' '; $output .= ''; $output .= '

'; $output .= '

'; $output .= __( 'The referral rate determines the referral amount based on the net sale made.', AFF_WPEC_PLUGIN_DOMAIN ); $output .= '

'; $output .= '

'; $output .= __( 'Example: Set the referral rate to 0.1 if you want your affiliates to get a 10% commission on each sale.', AFF_WPEC_PLUGIN_DOMAIN ); $output .= '

'; $output .= '

'; $output .= ''; $output .= __( 'Get additional features with Affiliates Pro or Affiliates Enterprise.', AFF_WPEC_PLUGIN_DOMAIN ); $output .= ''; $output .= '

'; } $output .= '

' . __( 'Auto-adjustments of referrals', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; $output .= '

' . __( 'The default referral status as determined in Options applies unless the following are enabled.', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; $output .= '

' . __( 'Incomplete sales', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; $output .= '

'; $output .= ''; $output .= ' '; $output .= ''; $output .= '

'; $output .= '

' . __( 'The referrals related to the order will be marked as pending, unless they are closed.', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; $output .= '

' . __( 'Received orders', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; $output .= '

'; $output .= ''; $output .= ' '; $output .= ''; $output .= '

'; $output .= '

' . __( 'The referrals related to the order will be marked as pending, unless they are closed.', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; $output .= '

' . __( 'Accepted payment', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; $output .= '

'; $output .= ''; $output .= ' '; $output .= ''; $output .= '

'; $output .= '

' . __( 'The referrals related to the order will automatically be accepted, unless they are closed.', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; $output .= '

' . __( 'Job dispatched', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; $output .= '

'; $output .= ''; $output .= ' '; $output .= ''; $output .= '

'; $output .= '

' . __( 'The referrals related to the order will automatically be accepted, unless they are closed.', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; $output .= '

' . __( 'Orders closed', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; $output .= '

'; $output .= ''; $output .= ' '; $output .= ''; $output .= '

'; $output .= '

' . __( 'The referrals related to the order will automatically be accepted, unless they are closed.', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; $output .= '

' . __( 'Declined payment', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; $output .= '

'; $output .= ''; $output .= ' '; $output .= ''; $output .= '

'; $output .= '

' . __( 'The referrals related to the order will be rejected automatically, unless they are closed.', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; $output .= '

' . __( 'Usage stats', AFF_WPEC_PLUGIN_DOMAIN ) . '

'; $output .= '

'; $output .= ''; $output .= ' '; $output .= ''; $output .= '
'; $output .= '' . __( 'This will allow the plugin to help in computing how many installations are actually using it. No personal or site data is transmitted, this simply embeds an icon on the bottom of the Affiliates admin pages, so that the number of visits to these can be counted. This is useful to help prioritize development.', AFF_WPEC_PLUGIN_DOMAIN ) . ''; $output .= '

'; $output .= '

'; $output .= wp_nonce_field( self::SET_ADMIN_OPTIONS, self::NONCE, true, false ); $output .= ''; $output .= '

'; $output .= '
'; $output .= ''; echo $output; affiliates_footer(); } /** * Add a notice to the footer that the integration is active. * @param string $footer */ public static function affiliates_footer( $footer ) { $options = get_option( Affiliates_WPEC::PLUGIN_OPTIONS , array() ); $usage_stats = isset( $options[Affiliates_WPEC::USAGE_STATS] ) ? $options[Affiliates_WPEC::USAGE_STATS] : Affiliates_WPEC::USAGE_STATS_DEFAULT; return ( $usage_stats ? '
' . '

' . "" . __( "Powered by Affiliates WP e-Commerce Integration.", AFF_WPEC_PLUGIN_DOMAIN ) . '

' . '
' : '' ) . $footer; } } Affiliates_WPEC_Admin::init();