Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Claudio Sanches

    (@claudiosanches)

    You can use this in your theme functions.php:

    function custom_wc_mercadopago_args( $args ) {
    	$args['payment_methods'] = array(
    		'excluded_payment_types' => array(
    			array( 'id' => 'bank_transfer' ),
    			array( 'id' => 'ticket' )
    		)
    	);
    
    	return $args;
    }
    
    add_action( 'woocommerce_mercadopago_args', 'custom_wc_mercadopago_args' );
    

    You can change the IDs using: https://api.mercadolibre.com/payment_types

    Thread Starter realdeazucar

    (@realdeazucar)

    Hi Claudio. Thank you for the support

    I tried pasting the code into my theme’s functions.php and when saved and refreshed it kept the site from loading

    Then I created a child theme and pasted the code into that functions.php and it didn’t load either

    Lastly I entered the code into the plugin’s ……..gateway.php and got the same results

    Any thoughts?

    Thank you so very much for your help

    Plugin Author Claudio Sanches

    (@claudiosanches)

    You need try to exclude using the IDs, some ids will not work in your country. Then you have to try to delete what can.

    This may work:

    function custom_wc_mercadopago_args( $args ) {
    	$args['payment_methods'] = array(
    		'excluded_payment_types' => array(
    			array( 'id' => 'bank_transfer' ),
    		)
    	);
    
    	return $args;
    }
    
    add_action( 'woocommerce_mercadopago_args', 'custom_wc_mercadopago_args' );
    
    Thread Starter realdeazucar

    (@realdeazucar)

    Hey Claudio. It’s me again

    I found the IDs for Venezuela here

    Tried the code using those IDs but it keeps on not working. When I save the functions.php and refresh the site it does not load, not even an error message, just goes blank

    Plugin Author Claudio Sanches

    (@claudiosanches)

    You can see the error with the log option.

    But it happens several problems even trying to do that.
    Sometimes you add something that is not abilitado to your account and will break even.

    The MercadoPago works strangely with it.
    Why not have the plugin option to delete delivery methods.
    Is the user’s responsibility to try to add it as he could.

    Thanks Claudio your hack was really helpful for me ??

    Congratulation for this great plugin!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Eliminating payment methods from MP’ is closed to new replies.