• Resolved Gondezz

    (@masgan)


    How to disable cutom payment gateway for language with woocommerce multilingual

    like this code

    https://wpml.org/forums/topic/different-payments-gateways-for-different-languages/

    function wpml_filter_gateways($gateways){
    if(ICL_LANGUAGE_CODE == ‘fr’) //Checks if the selected language is French.
    unset($gateways[‘paypal’]); //”remove” paypal

    return $gateways; //returns the other payment methods.
    }
    add_filter(‘woocommerce_available_payment_gateways’,’wpml_filter_gateways’,1);

    in function theme . how i get custom language tag/string from custom gateway to put this on the function theme for specific language ? help me please.

    Thanks sir

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Richard Muvirimi

    (@tygalive)

    sorry for the late response

    in the plugin files look into includes/custom-gateway-blueprint.php
    there is an id field which is created by using plugin custom post type and id (line 24)

    so using your code would be something along the lines

    unset($gateways[‘woocg-post-1’]);

    where 1 is the post id

    Plugin Author Richard Muvirimi

    (@tygalive)

    also look into this filter woocommerce_payment_gateways as that’s where they are added

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hi , Please help me to disable custom payment gateway for specific Language’ is closed to new replies.