Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Commit

Permalink
Merge pull request #6 from nicobea/paypal-checkout-locale
Browse files Browse the repository at this point in the history
Add a new Gateways class to handle the locale code of Paypal checkout
  • Loading branch information
Hyyan Abo Fakher committed Jun 24, 2015
2 parents b98afc1 + 9526f08 commit 34b8fb2
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
51 changes: 51 additions & 0 deletions src/Hyyan/WPI/Gateways.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

/**
* This file is part of the hyyan/woo-poly-integration plugin.
* (c) Hyyan Abo Fakher <tiribthea4hyyan@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Hyyan\WPI;

/**
* Gateways
*
* Handle Payment Gateways
*
* @author Nicolas Joannès <nic@cobea.be>
*/
class Gateways
{


/**
* Construct object
*/
public function __construct()
{
add_filter('woocommerce_paypal_args', array($this, 'setPaypalLocalCode'));

}


/**
* Set the PayPal checkout locale code
*
* @param array $args the current paypal request args array
*
* @return void
*/
public function setPaypalLocalCode($args)
{
$lang = pll_current_language('locale');
$args['locale.x'] = $lang;

return $args;

}


}
1 change: 1 addition & 0 deletions src/Hyyan/WPI/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ protected function registerCore()
new Reports();
new Widgets\SearchWidget();
new Widgets\LayeredNav();
new Gateways();
}

}

0 comments on commit 34b8fb2

Please sign in to comment.