Hi,
Please use this codes –
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, 'dokan_profile_settings', true );
$payment_mode = isset( $vendor_data['payment']['method'] ) ? esc_attr( $vendor_data['payment']['method'] ) : '' ;
$paypal_email = isset( $vendor_data['payment']['paypal']['email'] ) ? esc_attr( $vendor_data['payment']['paypal']['email'] ) : '' ;
$stripe_user_id = get_user_meta( $vendor_id, '_stripe_connect_access_key', true );
if( !$payment_mode || ( ( $payment_mode == 'stripe' ) && !$stripe_user_id ) || ( ( $payment_mode == 'paypal' ) && !$paypal_email ) ) {
if( isset( $wp->query_vars['wcfm-products-manage'] ) ) {
wcfm_restriction_message_show( __( "Payment account not yet setup!", "wc-fronend-manager" ), false, true );
}
$is_allow = false;
}
}
return $is_allow;
}, 750 );
add_filter( 'wcfm_is_allow_pm_add_products', function( $is_allow ) {
global $wp, $WCFM, $wpdb;
if( $is_allow && function_exists( 'wcfm_is_vendor' ) && wcfm_is_vendor() ) {
$vendor_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );
$dps_shipping_enable = get_user_meta( $vendor_id, '_dps_shipping_enable', true );
$dps_country_rates = get_user_meta( $vendor_id, '_dps_country_rates', true );
$sql = "SELECT * FROM {$wpdb->prefix}dokan_shipping_zone_methods WHERE <code>seller_id</code>={$vendor_id}";
$results = $wpdb->get_results( $sql );
if( empty($results) && ( !$dps_shipping_enable || ( $dps_shipping_enable && ( $dps_shipping_enable != 'yes' ) ) || ( $dps_shipping_enable && ( $dps_shipping_enable == 'yes' ) && empty( $dps_country_rates ) ) ) ) {
$is_allow = false;
if( isset( $wp->query_vars['wcfm-products-manage'] ) ) {
wcfm_restriction_message_show( __( "Please setup your store shipping before to add product!", "wc-fronend-manager" ), false, true );
}
}
}
return $is_allow;
}, 60 );
Thank You