• Resolved fernandobrenes

    (@fernandobrenes)


    Hi,

    I would like to accomplish the same behaviour described here:

    Stripe Gateway

    Could you please let me know what needs to be modified here:

    add_filter( ‘wcfm_is_allow_pm_add_products’, function( $is_allow ) {
    if( wcfm_is_vendor() ) {
    $vendor_id = apply_filters( ‘wcfm_current_vendor_id’, get_current_user_id() );
    $vendor_data = get_user_meta( $vendor_id, ‘wcfmmp_profile_settings’, true );
    $payment_mode = isset( $vendor_data[‘payment’][‘method’] ) ? esc_attr( $vendor_data[‘payment’][‘method’] ) : ” ;
    $stripe_user_id = get_user_meta( $vendor_id, ‘stripe_user_id’, true );
    if( !$payment_mode || !$stripe_user_id ) {
    wcfm_restriction_message_show( “Stripe account not yet setup!” );
    $is_allow = false;
    }
    }
    return $is_allow;
    }, 750 );

    Thank you,
    Best Regards

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

Viewing 1 replies (of 1 total)
  • Plugin Author WC Lovers

    (@wclovers)

    Hi,

    Please use this code –

    add_filter( 'wcfm_is_allow_pm_add_products', function( $is_allow ) {
      global $wp;
      if( wcfm_is_vendor() ) {
      	$vendor_id   = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );
      	$vendor_data = get_user_meta( $vendor_id, 'wcfmmp_profile_settings', true );
      	$payment_mode = isset( $vendor_data['payment']['method'] ) ? esc_attr( $vendor_data['payment']['method'] ) : '' ;
      	$stripe_user_id = get_user_meta( $vendor_id, 'stripe_user_id', true );
      	if( !$payment_mode || !$stripe_user_id ) {
      		if( isset( $wp->query_vars['wcfm-products-manage'] ) ) {
      			wcfm_restriction_message_show( "Stripe account not yet setup!" );
      		}
      		$is_allow = false;
      	}
      }
    	return $is_allow;
    }, 750 );

    Thank You

Viewing 1 replies (of 1 total)
  • The topic ‘Make Payment Gateway Required’ is closed to new replies.