This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ip = $_SERVER["REMOTE_ADDR"];//cant use helper, not loaded yet | |
$location = file_get_contents('http://api.ipinfodb.com/v3/ip-city/?key=<api_key>&format=json&ip='.$ip.''); | |
$location = json_decode($location); | |
$country = $location->countryCode; | |
if(strcmp($country,'CA') == 0) { | |
$mageRunType = 'store'; | |
$mageRunCode = 'en_ca'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'google-api-php-client/src/Google_Client.php'; | |
require_once 'google-api-php-client/src/contrib/Google_PlusService.php'; | |
require_once 'google-api-php-client/src/contrib/Google_Oauth2Service.php'; | |
// Set your cached access token. Remember to replace $_SESSION with a | |
// real database or memcached. | |
session_start(); | |
$client = new Google_Client(); |
NewerOlder