WooCommerce SagePay Direct Payment Gateway
Currency switcher (2 posts)

  1. jvarela
    Posted 2 years ago #

    Hi I'm using the plugin and it works fine. But I need as a requirement for my website to allow users to pay in different currencies. For this purpose I installed a plugin called woocommerce-aelia-currencyswitcher.

    Your plugin pick the currency from an array in the plugin, rather than ussing the one passed with the order, which I can handle with the currencyswitcher plugin...

    Any ideas about how can I bug the currency in ds-sagepay-direct.php to allow the gateway to pick the currency switched when the order is placed?



  2. swicks
    Plugin Author

    Posted 2 years ago #

    H, sorry I'm not familiar with this currencyswitcher plugin - what you could do is insert a filter into the sagepay plugin just before the parameter array is changed to a string (~line 565).

    $this->params = apply_filters("sagepay_direct_params", $this->params);

    add filter into your currencyswitcher plugin similar to this...

    add_filter('sagepay_direct_params', array($this, 'sagepay_direct_params'));

    Handle the currency change within the function similar to this...

    public function sagepay_direct_params($params)
                //manipulate params
                $params['Currency'] = 'EUR';
                return $params;

    hope that help

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic