WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce SagePay Direct Payment Gateway
Currency switcher (2 posts)

  1. jvarela
    Member
    Posted 11 months 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?

    Cheers!
    Javi.

    http://wordpress.org/extend/plugins/sagepay-direct-for-woocommerce-payment-gateway/

  2. swicks
    Member
    Plugin Author

    Posted 11 months 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

Reply

You must log in to post.

About this Plugin

About this Topic