• Hello everyone,

    is it possible to just disable Paypal as a Payment Method during the checkout when a Customer has Products from more then 1 Vendor instead of disabling the function of adding Products to your Cart from several Vendors?

    We want to offer the other Payment methods aswell but with this addon they are forced to buy from one Vendor, even tho they could use Stripe as their Payment. Wouldnt it make more sense to check if there are Products from several vendors in the cart and if thats the case, disable Paypal as a Payment Method during Checkout?

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

    (@wclovers)

    Possible. Add this snippet to your site –

    add_filter( 'wcfmmp_is_disable_multivendor_checkout', function( $is_allow ) {
    	return 'no';
    }, 750 );
    add_filter( 'woocommerce_available_payment_gateways', function( $_available_gateways ) {
    	$vendors = array();
    	if( function_exists( 'is_checkout' ) && is_checkout() ) {
    		foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
    			$cart_product_id = $cart_item['product_id'];
    			$cart_product_author = wcfm_get_vendor_id_by_post( $cart_product_id );
    			if( $cart_product_author && function_exists( 'wcfm_is_vendor' ) && wcfm_is_vendor( $cart_product_author ) ) $vendors[$cart_product_author] = $cart_product_author;
    		}	
    		if( !empty( $vendors ) && ( count( $vendors ) > 1 ) ) {
    			unset( $_available_gateways['paypal'] );
    		}
    	}
    	return $_available_gateways;
    }, 700 );

    Add custom code(s) to your child theme’s functions.php
    In case you do not have child theme then add those using this plugin –?https://www.ads-software.com/plugins/code-snippets/

    Thread Starter mboeckly

    (@mboeckly)

    Is it still Paying the Vendor directly then?

    Thread Starter mboeckly

    (@mboeckly)

    And do i use this code with the Paypal direct payment Plugin or without it?

    Plugin Author WC Lovers

    (@wclovers)

    NO, it’s not depending upon WCFM Direct PayPal addon.

    Is it still Paying the Vendor directly then?
    – Yes, for PayPal payment.

    Thread Starter mboeckly

    (@mboeckly)

    Okay so i added the Code, it disables Paypal as soon as I have more then 1 Vendor but if i there is only 1 Vendor i still can’t pay because I get to a Paypal website that just says: “Unfortunately a system error has occurred. Please try again later”. I can see that there is a new unpaid Order in the Vendor Dashboard and the Vendor also added his paypal Email-Adress.

    What is the meaning of this Error Message? There is nothing in the logs

    Plugin Author WC Lovers

    (@wclovers)

    Where are you getting this message?

    At your site or at PayPal during payment?

    Thread Starter mboeckly

    (@mboeckly)

    At the Paypal site

    Plugin Author WC Lovers

    (@wclovers)

    Well, then PayPal account has some issues.

    Is vendor’s PayPal account is a business account?

    Thread Starter mboeckly

    (@mboeckly)

    It should be since they have their own Webshop and use it there aswell.

    Plugin Author WC Lovers

    (@wclovers)

    OK. Then please contact PayPal support.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Disable Paypal during Checkout’ is closed to new replies.