BuddyDev

Search

[Resolved] BP member types pro not working

  • Participant
    Level: Initiated
    Posts: 2
    Martin on #37330

    Hello,

    I’m using BP member types pro together with ultimate membership pro to assign member type after users signs up for a subsription. It was working well until recently. My assumption is that with ultimate membership pro update, bp member types pro plugin lost compatibility to auto assign membership types. When I click ‘premium member’ in membership level in the section added by your plugin and save the level, member type is not saved. I would like to have this fixed because new users are not able to complete their profiles now, if membership type is not changed automatically right after registration. This is causing real issues as users are cancelling their premium membershi when they dont see fields to complete their profiles.

    Kindly assit,

    Thank you,

    Martin

  • Keymaster
    (BuddyDev Team)
    Posts: 24211
    Brajesh Singh on #37334

    Hi Martin,
    Thank you for using the plugin and reporting the issue.

    Our team will look into it and assist you on Tuesday(we are closed on Monday due to Holi).

    Regards
    Brajesh

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #37392

    Hello Martin,

    Sorry for the delayed reply. I am looking into it and will update you at Day end.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #37394

    Hello Martin,

    Please try to use the following code. It seems they are not handling array datatype while saving meta info of level.

    
    
    /**
     * Save meta
     *
     * @param int   $level_id Level id.
     * @param array $posted_data Posted data.
     */
    function buddydev_save_level_member_types( $level_id, $posted_data ) {
    
    	if ( ! isset( $posted_data['bp_member_types'] ) ) {
    		return;
    	}
    
    	\Indeed\Ihc\Db\Memberships::deleteOneMeta( $level_id, 'bp_member_types' );
    
    	\Indeed\Ihc\Db\Memberships::saveMeta( $level_id, 'bp_member_types', maybe_serialize( $posted_data['bp_member_types'] ) );
    }
    
    add_action( 'ihc_admin_edit_save_level_after_submit_form', 'buddydev_save_level_member_types', 10, 2 );
    
    

    Please make sure to save each level once and then check.

    Regards
    Ravi

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #37401

    Hello Martin,

    Please ignore my above message. I have updated the code in the plugin. Please upgrade and give it a shot.

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 2
    Martin on #37426

    This seems to work! The checkbox now remains checked. Amazing support, thanks a lot Ravi 🙂

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2935
    Ravi on #37433

    Hello Martin,

    Thank you for the acknowledgment. I am glad that I could help.

    Regards
    Ravi

The topic ‘ [Resolved] BP member types pro not working’ is closed to new replies.

This topic is: resolved