Title: Registration behavior error
Last modified: April 17, 2024

---

# Registration behavior error

 *  Resolved [wpsupacc](https://wordpress.org/support/users/wpsupacc/)
 * (@wpsupacc)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/registration-behavior-error/)
 * When a woocommerce user is logged in to his/her account and goes to the affiliate
   dashboard link, a message will automatically appear: You are not enrolled in 
   our affiliate program. Please fill out the form below to apply.
 * The registration form will then be displayed automatically.
   This is undesirable
   because we impose conditions on registration.
 * We use the registration short link for this and build around it. That works well.
   Therefore, this behavior on the account dashboard is undesirable.
 * How to stop this ?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [wpsupacc](https://wordpress.org/support/users/wpsupacc/)
 * (@wpsupacc)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/registration-behavior-error/#post-17694727)
 * We are currently a free user and if this is resolved we would like to become 
   a paying customer.
 *  Plugin Author [iova.mihai](https://wordpress.org/support/users/iovamihai/)
 * (@iovamihai)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/registration-behavior-error/#post-17696546)
 * Hey [@wpsupacc](https://wordpress.org/support/users/wpsupacc/),
 * Thank you for reaching out! I’m afraid that this system is integrated and the
   way it works cannot be modified easily.
 * However, as a workaround, you could redirect users that are logged-in, but are
   not affiliates, from the affiliate account page to another page, maybe the registration
   page via this code snippet:
 *     ```wp-block-code
       function slicewp_custom_template_redirect_non_affiliate() {
   
       	if ( ! function_exists( 'slicewp' ) ) {
       		return;
       	}
   
       	if ( ! is_page() ) {
       		return;
       	}
   
       	if ( ! is_user_logged_in() ) {
       		return;
       	}
   
       	if ( get_the_ID() != slicewp_get_setting( 'page_affiliate_account', 0 ) ) {
       		return;
       	}
   
       	$affiliate = slicewp_get_affiliate_by_user_id( get_current_user_id() );
   
       	if ( ! is_null( $affiliate ) ) {
       		return;
       	}
   
       	wp_redirect( 'https://yourwebsite.com/some-page/' );
       	die();
   
       }
       add_action( 'template_redirect', 'slicewp_custom_template_redirect_non_affiliate', 100 );
       ```
   
 * Please copy the code and add it to your website. If you’re not sure how to add
   code snippets to your site, you can use the Code Snippets plugin ([https://wordpress.org/plugins/code-snippets/](https://wordpress.org/plugins/code-snippets/)).
 * Also, please make sure to replace the “[https://yourwebsite.com/some-page/&#8221](https://yourwebsite.com/some-page/&#8221);
   link to a link from your website.
 * Thank you and best wishes,
 * Mihai
 *  Thread Starter [wpsupacc](https://wordpress.org/support/users/wpsupacc/)
 * (@wpsupacc)
 * [2 years, 1 month ago](https://wordpress.org/support/topic/registration-behavior-error/#post-17697594)
 * Thank you Mihai, I’m going to investigate whether this works for us. The topic
   may be closed.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Registration behavior error’ is closed to new replies.

 * ![](https://ps.w.org/slicewp/assets/icon-256x256.png?rev=2432848)
 * [Affiliate Program Suite — SliceWP Affiliates](https://wordpress.org/plugins/slicewp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/slicewp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/slicewp/)
 * [Active Topics](https://wordpress.org/support/plugin/slicewp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/slicewp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/slicewp/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [wpsupacc](https://wordpress.org/support/users/wpsupacc/)
 * Last activity: [2 years, 1 month ago](https://wordpress.org/support/topic/registration-behavior-error/#post-17697594)
 * Status: resolved