Multi Vendor Marketplace Plugin | WCFM Marketplace › Forums › WC Marketplace › Can vendors select their preferred payment options?
- This topic has 3 replies, 2 voices, and was last updated 5 years, 1 month ago by WCFM Forum.
Viewing 3 reply threads
- AuthorPosts
- March 14, 2019 at 1:47 pm #52610RishiGuest
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
- March 14, 2019 at 4:58 pm #52662WCFM ForumKeymaster
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
- March 23, 2019 at 5:02 am #54128PrasGuest
How do you restrict to one vendor purchase at a time?
Thank you
- March 23, 2019 at 12:16 pm #54185WCFM ForumKeymaster
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
- AuthorPosts
Viewing 3 reply threads
- The topic ‘Can vendors select their preferred payment options?’ is closed to new replies.