Can vendors select their preferred payment options?

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Multi Vendor Marketplace Plugin | WCFM Marketplace Forums WC Marketplace Can vendors select their preferred payment options?

Viewing 3 reply threads
  • Author
    Posts
    • #52610
      Rishi
      Guest

      hi, is it possible for the vendors to choose their preferred payment options for the products in their store?

      Some vendors might want to use only cash or deliver or some might want to use cod and credit cards.

      Thanks

    • #52662
      WCFM Forum
      Keymaster

      Hi,

      Do you want to restrict one vendor purchase at a time?

      Otherwise this will not work!

      between, by default there is no such function but can be implemented using custom development ..

      Thank You

    • #54128
      Pras
      Guest

      How do you restrict to one vendor purchase at a time?

      Thank you

    • #54185
      WCFM Forum
      Keymaster

      Hi,

      Please add this code snippet to your child theme’s functions.php –

      add_action( 'woocommerce_add_to_cart_validation', function( $is_allow, $product_id, $quantity ) {
      	$product = get_post( $product_id );
      	$product_author = $product->post_author;
      
      	//Iterating through each cart item
      	foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
      		$cart_product_id = $cart_item['product_id'];
      		$cart_product = get_post( $cart_product_id );
      		$cart_product_author = $cart_product->post_author;
      		if( $cart_product_author != $product_author ) {
      			$is_allow = false;
      			break;
      		}
      	}
      
      	if( !$is_allow ){
      		// We display an error message
      		wc_clear_notices();
      		wc_add_notice( __( "Well, you already have some item in your cart. First checkout with those and then purchase other items!", "wcfm-ecogear" ), 'error' );
      	}
      	
      	return $is_allow;
      }, 10, 3 );

      Thank you

Viewing 3 reply threads
  • The topic ‘Can vendors select their preferred payment options?’ is closed to new replies.