• Dear support team,

    Is there any options to Restrict existing customer/User from the Coupon box discount?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support mivtt

    (@mivtt)

    Hi,

    With the existing users, you can use the Disable for logged-in users option to not display the coupon box popup since their email address was collected and avoid giving a discount. See this: https://ibb.co/yqYSp2m

    Best regards.

    Thread Starter gunadurai

    (@gunadurai)

    Hi Mivtt,

    Thanks for replay, i already know this feature and enabled. But what i want my customer already register via https://www.thesstudioonline.com/my-account before we implement this coupon box plugin.

    Registered via https://www.thesstudioonline.com/my-account we already gave some discount they already used coupons we want to restrict these user when subscribe via coupon box plugin.

    Hope you understand now

    Plugin Support mivtt

    (@mivtt)

    Hi,

    Thank you for your further information.

    Please add these custom snippets into the function PHP file of your theme, after saving, go to our plugin > the Email Subscribe, take notice whether all emails of the existing customers have been synced in the list yet, if it’s done, then please delete the custom snippets. Once the emails of the existing customers are enlisted, our plugin will notify them that their email has been subscribed whenever they try to subscribe again via the coupon box popup.

    add_action( 'admin_footer', function () {
    	$users = get_users( [] );
    
    	foreach ( $users as $user ) {
    		$email = $user->user_email;
    
    		$emails_args = array(
    			'post_type'      => 'wcb',
    			'posts_per_page' => - 1,
    			'title'          => $email,
    		);
    
    		$the_query = new WP_Query( $emails_args );
    		if ( $the_query->have_posts() ) {
    			continue;
    		}
    		$my_post = array(
    			'post_title'  => $email,
    			'post_type'   => 'wcb',
    			'post_status' => 'publish',
    		);
    		$post_id = wp_insert_post( $my_post );
    		echo '<pre>' . print_r( $post_id, true ) . '</pre>';
    	}
    } );

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Restrict existing user’ is closed to new replies.