Iglobal_Main - Version 1.4.0

Version Notes

New Features:
Mobile responsive iframe
Send address info for logged in users to the checkout.
Send product country of manufacture to iGlobal

Improvements:
Removed extra ajax call to fetch config values
Allow disabling iframe while still using the iglobal checkout

Download this release

Release Info

Developer Matt Flamm
Extension Iglobal_Main
Version 1.4.0
Comparing to
See all releases


Code changes from version 1.3.1 to 1.4.0

app/code/community/Iglobal/Stores/Block/Link.php CHANGED
@@ -9,16 +9,9 @@ class Iglobal_Stores_Block_Link extends Mage_Checkout_Block_Onepage_Link
9
  {
10
  function getCheckoutUrl()
11
  {
12
- //$this->setTemplate('iglobal/checkout/onepage/link.phtml');
13
- //check if the country is international
14
- $countryCode = (isset($_COOKIE['igCountry']) ? $_COOKIE['igCountry'] : "");
15
- $domesticCountries = explode(",", Mage::getStoreConfig('general/country/ig_domestic_countries'));
16
- $isDomestic = in_array ($countryCode, $domesticCountries) ? true : false;
17
-
18
  //return the url
19
-
20
- if (Mage::getStoreConfig('iglobal_integration/igmat/welcome_mat_active') && Mage::getStoreConfig('iglobal_integration/apireqs/ice_toggle') && Mage::getStoreConfig('iglobal_integration/apireqs/use_iframe') && !$isDomestic){//!$isDomestic && Mage::getStoreConfig('iglobal_integration/apireqs/ice_toggle')){
21
- //return "if(!ig_isDomesticCountry()){window.location.replace (' " . $this->getUrl('iglobal/checkout', array('_secure'=>true)) . "');} else {window.location.replace ('" . $this->getUrl('checkout/onepage', array('_secure'=>true)) . "');}";
22
  return $this->getUrl('iglobal/checkout', array('_secure'=>true));
23
  } else {
24
  return $this->getUrl('checkout/onepage', array('_secure'=>true));
9
  {
10
  function getCheckoutUrl()
11
  {
 
 
 
 
 
 
12
  //return the url
13
+ if (Mage::getStoreConfig('iglobal_integration/igmat/welcome_mat_active')
14
+ && Mage::getStoreConfig('iglobal_integration/apireqs/ice_toggle')){
 
15
  return $this->getUrl('iglobal/checkout', array('_secure'=>true));
16
  } else {
17
  return $this->getUrl('checkout/onepage', array('_secure'=>true));
app/code/community/Iglobal/Stores/Helper/Data.php CHANGED
@@ -1,126 +1,217 @@
1
- <?php
2
-
3
- class Iglobal_Stores_Helper_Data extends Mage_Core_Helper_Abstract
4
- {
5
- /**
6
- * Path for config.
7
- */
8
- const XML_CONFIG_PATH = 'iglobal_integration/igjq/';
9
-
10
- /**
11
- * Name library directory.
12
- */
13
- const NAME_DIR_JS = 'iGlobal/jquery/';
14
-
15
- /**
16
- * List files for include.
17
- *
18
- * @var array
19
- */
20
- protected $_files = array(
21
- 'jquery.js',
22
- 'jquery.noconflict.js',
23
- );
24
-
25
- public function units2lbs($value, $unit='lbs')
26
- {
27
- $convert = array('kg' => 0.453592, 'oz' => 16, 'g' => 453.592, 'lbs' => 1, '' => 1);
28
- $value = round(floatval($value) / $convert[$unit], 2);
29
- if($value){
30
- return $value;
31
- }
32
- return null;
33
- }
34
-
35
- public function dim2inch($value, $dim='in')
36
- {
37
- $convert = array('cm' => 2.54, 'in' => 1, '' => 1);
38
- $value = ceil(floatval($value) / $convert[$dim]);
39
- if($value){
40
- return $value;
41
- }
42
- return null;
43
- }
44
-
45
- public function getDimensions($product, $item)
46
- {
47
- $dim = $product->getIgDemesionUnits();
48
- $weight = $product->getIgWeight();
49
- if (empty($weight))
50
- {
51
- $weight = $item->getWeight();
52
- }
53
- $dimensions = array(
54
- 'weight' => $this->units2lbs($weight, $product->getIgWeightUnits()),
55
- 'length' => $this->dim2inch($product->getIgLength(), $dim),
56
- 'width' => $this->dim2inch($product->getIgWidth(), $dim),
57
- 'height' => $this->dim2inch($product->getIgHeight(), $dim),
58
- );
59
- return $dimensions;
60
- }
61
-
62
- public function getItemDetails($item)
63
- {
64
- $product = $item->getProduct();
65
-
66
- //get options on the items
67
- $options = $product->getTypeInstance(true)->getOrderOptions($product);
68
- $optionList = "";
69
- if ($options && isset($options["options"])) {
70
- $optionList = "|";
71
- foreach ($options["options"] as $option) { //todo: add loops for $options[additional_options] and $options[attributes_info] to get all possible options
72
- $optionList = $optionList . $option["label"] . ':"' . $option["value"] . '"|';
73
- }
74
- }
75
-
76
- return array(
77
- 'productId' => $product->getId(),
78
- 'sku' => $product->getSku(),
79
- 'description' => $product->getName(),
80
- 'unitPrice' => $item->getPrice(),
81
- 'quantity' => $item->getQty(),
82
- 'itemURL' => $product->getProductUrl(),
83
- 'imageURL' => str_replace("http:", "https:", Mage::helper('catalog/image')->init($product, 'thumbnail')),
84
- 'itemDescriptionLong' => $optionList,
85
- ) + $this->getDimensions($product, $item);
86
-
87
- }
88
-
89
- /**
90
- * Check enabled.
91
- *
92
- * @return bool
93
- */
94
- public function isEnabled()
95
- {
96
- return (bool) $this->_getConfigValue('enabled', $store = '');
97
- }
98
-
99
- /**
100
- * Return path file.
101
- *
102
- * @param $file
103
- *
104
- * @return string
105
- */
106
- public function getJQueryPath($file)
107
- {
108
- return self::NAME_DIR_JS . $file;
109
- }
110
-
111
- /**
112
- * Return list files.
113
- *
114
- * @return array
115
- */
116
- public function getFiles()
117
- {
118
- return $this->_files;
119
- }
120
-
121
- protected function _getConfigValue($key, $store)
122
- {
123
- return Mage::getStoreConfig(self::XML_CONFIG_PATH . $key, $store = '');
124
- }
125
-
126
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Iglobal_Stores_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+ /**
6
+ * Path for config.
7
+ */
8
+ const XML_CONFIG_PATH = 'iglobal_integration/igjq/';
9
+
10
+ /**
11
+ * Name library directory.
12
+ */
13
+ const NAME_DIR_JS = 'iGlobal/jquery/';
14
+
15
+ /**
16
+ * List files for include.
17
+ *
18
+ * @var array
19
+ */
20
+ protected $_files = array(
21
+ 'jquery.js',
22
+ 'jquery.noconflict.js',
23
+ );
24
+
25
+ public function units2lbs($value, $unit='lbs')
26
+ {
27
+ $unit = ($unit ? $unit : "lbs");
28
+ $convert = array('kg' => 0.453592, 'oz' => 16, 'g' => 453.592, 'lbs' => 1);
29
+ $value = round(floatval($value) / $convert[$unit], 2);
30
+ if($value){
31
+ return $value;
32
+ }
33
+ return null;
34
+ }
35
+
36
+ public function dim2inch($value, $dim='in')
37
+ {
38
+ $dim = ($dim ? $dim : "in");
39
+ $convert = array('cm' => 2.54, 'in' => 1);
40
+ $value = ceil(floatval($value) / $convert[$dim]);
41
+ if($value){
42
+ return $value;
43
+ }
44
+ return null;
45
+ }
46
+
47
+ public function getDimensions($product, $item)
48
+ {
49
+ $dim = $product->getAttributeText('ig_dimension_units');
50
+ $weight = $product->getIgWeight();
51
+ if (empty($weight))
52
+ {
53
+ $weight = $item->getWeight();
54
+ }
55
+ $dimensions = array(
56
+ 'weight' => $this->units2lbs($weight, $product->getAttributeText('ig_weight_units')),
57
+ 'length' => $this->dim2inch($product->getIgLength(), $dim),
58
+ 'width' => $this->dim2inch($product->getIgWidth(), $dim),
59
+ 'height' => $this->dim2inch($product->getIgHeight(), $dim),
60
+ );
61
+ return $dimensions;
62
+ }
63
+
64
+ public function getItemDetails($item)
65
+ {
66
+ $product = $item->getProduct();
67
+ // reload the product to get all attributes
68
+ $product = $product->load($product->getId());
69
+ //get options on the items
70
+ $options = $product->getTypeInstance(true)->getOrderOptions($product);
71
+ $optionList = "";
72
+ if ($options && isset($options["options"])) {
73
+ $optionList = "|";
74
+ foreach ($options["options"] as $option) { //todo: add loops for $options[additional_options] and $options[attributes_info] to get all possible options
75
+ $optionList = $optionList . $option["label"] . ':"' . $option["value"] . '"|';
76
+ }
77
+ }
78
+
79
+ $details = array(
80
+ 'productId' => $product->getId(),
81
+ 'sku' => $product->getSku(),
82
+ 'description' => $product->getName(),
83
+ 'unitPrice' => $item->getPrice(),
84
+ 'quantity' => $item->getQty(),
85
+ 'itemURL' => $product->getProductUrl(),
86
+ 'imageURL' => str_replace("http:", "https:", Mage::helper('catalog/image')->init($product, 'thumbnail')),
87
+ 'itemDescriptionLong' => $optionList,
88
+ 'countryOfOrigin' => $product->getCountryOfManufacture(),
89
+ ) + $this->getDimensions($product, $item);
90
+ return $details;
91
+ }
92
+
93
+ /**
94
+ * Check enabled.
95
+ *
96
+ * @return bool
97
+ */
98
+ public function isEnabled()
99
+ {
100
+ return (bool) $this->_getConfigValue('enabled', $store = '');
101
+ }
102
+
103
+ /**
104
+ * Check if the country is domestic
105
+ * @return bool
106
+ */
107
+ public function isDomestic(){
108
+ $countryCode = (isset($_COOKIE['igCountry']) ? $_COOKIE['igCountry'] : "");
109
+ $domesticCountries = explode(",", Mage::getStoreConfig('general/country/ig_domestic_countries'));
110
+ return in_array($countryCode, $domesticCountries);
111
+ }
112
+
113
+ /**
114
+ * Create the iGlobal checkout url
115
+ * @param $tempCart
116
+ * @return string
117
+ */
118
+ public function getCheckoutUrl($tempCart){
119
+ $subdomain = (Mage::getStoreConfig('iglobal_integration/apireqs/igsubdomain') ? Mage::getStoreConfig('iglobal_integration/apireqs/igsubdomain') : "checkout");
120
+ $storeNumber = (Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid') ? Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid') : "3");
121
+ $countryCode = (isset($_COOKIE['igCountry']) ? $_COOKIE['igCountry'] : "");
122
+ $url = 'https://' . $subdomain . '.iglobalstores.com/?store=' . $storeNumber . '&tempCartUUID=' . $tempCart . '&country=' . $countryCode;
123
+
124
+
125
+ //grab customer info if logged in and carry over to iglobal checkout
126
+ if(Mage::getSingleton('customer/session')->isLoggedIn()){
127
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
128
+ $shipping_id = $customer->getDefaultShipping();
129
+
130
+ if($shipping_id){
131
+ $shipping_address = Mage::getModel('customer/address')->load($shipping_id);
132
+ }
133
+
134
+ $customer_params = '';
135
+
136
+ if(!$shipping_address){
137
+ $customer_params .= '&customerName=' . $customer['firstname'] . ' ' . $customer['lastname'];
138
+ $customer_params .= '&customerCompany=' . $customer['company'];
139
+ $customer_params .= '&customerEmail=' . $customer['email'];
140
+ $customer_params .= '&customerPhone=' . $customer['telephone'];
141
+ }else{
142
+ $customer_params .= '&customerName=' . $shipping_address['firstname'] . ' ' . $shipping_address['lastname'];
143
+ $customer_params .= '&customerCompany=' . $shipping_address['company'];
144
+ $customer_params .= '&customerEmail=' . $customer['email'];
145
+ $customer_params .= '&customerPhone=' . $shipping_address['telephone'];
146
+ $customer_params .= '&customerAddress1=' . $shipping_address->getStreet(1);
147
+ $customer_params .= '&customerAddress2=' . $shipping_address->getStreet(2);
148
+ $customer_params .= '&customerCity=' . $shipping_address['city'];
149
+ $customer_params .= '&customerState=' . $shipping_address['region'];
150
+ $customer_params .= '&customerCountry=' . $shipping_address['country_id'];
151
+ $customer_params .= '&customerZip=' . $shipping_address['postcode'];
152
+ }
153
+ $url .= $customer_params;
154
+ }
155
+ return $url;
156
+ }
157
+
158
+ /**
159
+ * Return path file.
160
+ *
161
+ * @param $file
162
+ *
163
+ * @return string
164
+ */
165
+ public function getJQueryPath($file)
166
+ {
167
+ return self::NAME_DIR_JS . $file;
168
+ }
169
+
170
+ /**
171
+ * Create a json string of the confg settings for the welcome mat.
172
+ * @return string
173
+ */
174
+ public function getJavascriptVars()
175
+ {
176
+ $data = array (
177
+ 'storeId' =>Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid'),
178
+ 'subdomain' => Mage::getStoreConfig('iglobal_integration/apireqs/igsubdomain'),
179
+ 'flag_parent' => Mage::getStoreConfig('iglobal_integration/igmat/flag_parent'),
180
+ 'flag_method' => Mage::getStoreConfig('iglobal_integration/igmat/flag_method'),
181
+ 'flag_code' => Mage::getStoreConfig('iglobal_integration/igmat/flag_code'),
182
+ 'domesticCountries' => Mage::getStoreConfig('general/country/ig_domestic_countries'),
183
+ 'storeLogo' => Mage::getStoreConfig('iglobal_integration/igmat/store_logo'),
184
+ 'cartUrl' => Mage::getUrl('checkout/cart'),
185
+ );
186
+ //figure out what countries are serviced
187
+ if (Mage::getStoreConfig('general/country/allow')) {
188
+ //define iGlobal serviced countries
189
+ $allCountries = array("AP"=>"APO/FPO","AF"=>"Afghanistan","AL"=>"Albania","DZ"=>"Algeria","AS"=>"American Samoa","AD"=>"Andorra","AO"=>"Angola","AI"=>"Anguilla","AG"=>"Antigua","AR"=>"Argentina","AM"=>"Armenia","AW"=>"Aruba","AU"=>"Australia","AT"=>"Austria","AZ"=>"Azerbaijan","BS"=>"Bahamas","BH"=>"Bahrain","BD"=>"Bangladesh","BB"=>"Barbados","BY"=>"Belarus","BE"=>"Belgium","BZ"=>"Belize","BJ"=>"Benin","BM"=>"Bermuda","BT"=>"Bhutan","BO"=>"Bolivia","BQ"=>"Bonaire","BA"=>"Bosnia & Herzegovina","BW"=>"Botswana","BR"=>"Brazil","VG"=>"Virgin Islands (British)","BN"=>"Brunei","BG"=>"Bulgaria","BF"=>"Burkina Faso","BI"=>"Burundi","KH"=>"Cambodia","CM"=>"Cameroon","CA"=>"Canada","IC"=>"Canary Islands","CV"=>"Cape Verde","KY"=>"Cayman Islands","CF"=>"Central African Republic","TD"=>"Chad","CL"=>"Chile","CN"=>"China - People's Republic of","CO"=>"Colombia","KM"=>"Comoros","CG"=>"Congo","CK"=>"Cook Islands","CR"=>"Costa Rica","HR"=>"Croatia","CW"=>"Curaçao","CY"=>"Cyprus","CZ"=>"Czech Republic","DK"=>"Denmark","DJ"=>"Djibouti","DM"=>"Dominica","DO"=>"Dominican Republic","TL"=>"Timor-Leste","EC"=>"Ecuador","EG"=>"Egypt","SV"=>"El Salvador","GQ"=>"Equatorial Guinea","ER"=>"Eritrea","EE"=>"Estonia","ET"=>"Ethiopia","FK"=>"Falkland Islands","FO"=>"Faroe Islands (Denmark)","FJ"=>"Fiji","FI"=>"Finland","FR"=>"France","GF"=>"French Guiana","GA"=>"Gabon","GM"=>"Gambia","GE"=>"Georgia","DE"=>"Germany","GI"=>"Gibraltar","GR"=>"Greece","GL"=>"Greenland (Denmark)","GD"=>"Grenada","GP"=>"Guadeloupe","GU"=>"Guam","GH"=>"Ghana","GT"=>"Guatemala","GG"=>"Guernsey","GN"=>"Guinea","GW"=>"Guinea-Bissau","GY"=>"Guyana","HT"=>"Haiti","HN"=>"Honduras","HK"=>"Hong Kong","HU"=>"Hungary","IS"=>"Iceland","IN"=>"India","ID"=>"Indonesia","IQ"=>"Iraq","IE"=>"Ireland - Republic Of","IL"=>"Israel","IT"=>"Italy","CI"=>"Ivory Coast","JM"=>"Jamaica","JP"=>"Japan","JE"=>"Jersey","JO"=>"Jordan","KZ"=>"Kazakhstan","KE"=>"Kenya","KI"=>"Kiribati","KR"=>"Korea","KW"=>"Kuwait","KG"=>"Kyrgyzstan","LA"=>"Laos","LV"=>"Latvia","LB"=>"Lebanon","LS"=>"Lesotho","LR"=>"Liberia","LT"=>"Lithuania","LI"=>"Liechtenstein","LU"=>"Luxembourg","MO"=>"Macau","MK"=>"Macedonia","MG"=>"Madagascar","MW"=>"Malawi","MY"=>"Malaysia","MV"=>"Maldives","ML"=>"Mali","MT"=>"Malta","MH"=>"Marshall Islands","MQ"=>"Martinique","MR"=>"Mauritania","MU"=>"Mauritius","YT"=>"Mayotte","MX"=>"Mexico","MD"=>"Moldova","FM"=>"Micronesia - Federated States of","MC"=>"Monaco","MN"=>"Mongolia","ME"=>"Montenegro","MS"=>"Montserrat","MA"=>"Morocco","MZ"=>"Mozambique","MM"=>"Myanmar","NA"=>"Namibia","NR"=>"Nauru","NP"=>"Nepal","NL"=>"Netherlands (Holland)","NV"=>"Nevis","NC"=>"New Caledonia","NZ"=>"New Zealand","NI"=>"Nicaragua","NE"=>"Niger","NG"=>"Nigeria","NU"=>"Niue Island","NF"=>"Norfolk Island","MP"=>"Northern Mariana Islands","NO"=>"Norway","OM"=>"Oman","PK"=>"Pakistan","PA"=>"Panama","PG"=>"Papua New Guinea","PY"=>"Paraguay","PW"=>"Palau","PE"=>"Peru","PH"=>"Philippines","PL"=>"Poland","PT"=>"Portugal","PR"=>"Puerto Rico","QA"=>"Qatar","RE"=>"Reunion","RO"=>"Romania","RU"=>"Russia","RW"=>"Rwanda","SM"=>"San Marino","ST"=>"Sao Tome & Principe","SA"=>"Saudi Arabia","SN"=>"Senegal","RS"=>"Serbia & Montenegro","SC"=>"Seychelles","SL"=>"Sierra Leone","SG"=>"Singapore","SK"=>"Slovakia","SI"=>"Slovenia","SB"=>"Solomon Islands","ZA"=>"South Africa","SS"=>"South Sudan","ES"=>"Spain","LK"=>"Sri Lanka","BL"=>"St. Barthelemy","EU"=>"St. Eustatius","KN"=>"St. Kitts and Nevis","LC"=>"St. Lucia","MF"=>"St. Maarten","VC"=>"St. Vincent","SD"=>"Sudan","SR"=>"Suriname","SZ"=>"Swaziland","SE"=>"Sweden","CH"=>"Switzerland","PF"=>"Tahiti","TW"=>"Taiwan","TJ"=>"Tajikistan","TZ"=>"Tanzania","TH"=>"Thailand","TG"=>"Togo","TO"=>"Tonga","TT"=>"Trinidad and Tobago","TN"=>"Tunisia","TR"=>"Turkey","TM"=>"Turkmenistan","TC"=>"Turks and Caicos Islands","TV"=>"Tuvalu","VI"=>"Virgin Islands (U.S.)","UG"=>"Uganda","UA"=>"Ukraine","AE"=>"United Arab Emirates","GB"=>"United Kingdom","US"=>"United States","UY"=>"Uruguay","UZ"=>"Uzbekistan","VU"=>"Vanuatu","VE"=>"Venezuela","VN"=>"Vietnam","VA"=>"Vatican City","WS"=>"Western Samoa","YE"=>"Yemen","ZM"=>"Zambia","ZW"=>"Zimbabwe");
190
+
191
+ //allowed country list
192
+ $allowedCountries = Mage::getStoreConfig('general/country/allow');
193
+ $allowedCountries = array_flip(explode("," , $allowedCountries));
194
+
195
+ //countries that are both allowed and iGlobal available
196
+ $servicedCountries = array_intersect_key ($allCountries, $allowedCountries);
197
+ $data['servicedCountries'] = $servicedCountries;
198
+ }
199
+ return Mage::helper('core')->jsonEncode($data);
200
+ }
201
+
202
+ /**
203
+ * Return list files.
204
+ *
205
+ * @return array
206
+ */
207
+ public function getFiles()
208
+ {
209
+ return $this->_files;
210
+ }
211
+
212
+ protected function _getConfigValue($key, $store)
213
+ {
214
+ return Mage::getStoreConfig(self::XML_CONFIG_PATH . $key, $store = '');
215
+ }
216
+
217
+ }
app/code/community/Iglobal/Stores/Helper/Url.php CHANGED
@@ -4,21 +4,11 @@ class Iglobal_Stores_Helper_Url extends Mage_Checkout_Helper_Url
4
 
5
  function getCheckoutUrl()
6
  {
7
- // check if the country is international
8
- // $countryCode = (isset($_COOKIE['igCountry']) ? $_COOKIE['igCountry'] : "");
9
- // $domesticCountries = explode(",", Mage::getStoreConfig('general/country/ig_domestic_countries'));
10
- // $isDomestic = in_array ($countryCode, $domesticCountries) ? 1 : 0;
11
-
12
  // return the url
13
  if (Mage::getStoreConfig('iglobal_integration/igmat/welcome_mat_active')
14
- && Mage::getStoreConfig('iglobal_integration/apireqs/ice_toggle')
15
- && Mage::getStoreConfig('iglobal_integration/apireqs/use_iframe')) {
16
- // check for welcome mat //!$isDomestic && Mage::getStoreConfig('iglobal_integration/apireqs/ice_toggle')){ // add checks for other admin configs
17
-
18
- // make this a javascript url
19
- return "javascript:if(!ig_isDomesticCountry()){window.location.replace (' " . $this->_getUrl('iglobal/checkout') . "');} else {window.location.replace ('" . $this->_getUrl('checkout/onepage') . "');}";
20
- //return "javascript:if(!ig_isDomesticCountry()){window.location.replace ('{$this->_getUrl('iglobal/checkout')}')return false;} else {window.location.replace ('{$this->_getUrl('checkout/onepage')}";
21
- //return $this->_getUrl('iglobal/checkout');
22
  } else {
23
  return $this->_getUrl('checkout/onepage');
24
  }
4
 
5
  function getCheckoutUrl()
6
  {
 
 
 
 
 
7
  // return the url
8
  if (Mage::getStoreConfig('iglobal_integration/igmat/welcome_mat_active')
9
+ && Mage::getStoreConfig('iglobal_integration/apireqs/ice_toggle')) {
10
+ // send them to the iglobal checkout
11
+ return $this->_getUrl('iglobal/checkout');
 
 
 
 
 
12
  } else {
13
  return $this->_getUrl('checkout/onepage');
14
  }
app/code/community/Iglobal/Stores/Model/International/International.php CHANGED
@@ -27,6 +27,8 @@ class Iglobal_Stores_Model_International_International extends Mage_Core_Model_A
27
  $response = $rest->createTempCart(array(
28
  "storeId" => Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid'),
29
  "referenceId" => $cart->getId(),
 
 
30
  "items" => $items,));
31
  return $response->tempCartUUID;
32
  }
27
  $response = $rest->createTempCart(array(
28
  "storeId" => Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid'),
29
  "referenceId" => $cart->getId(),
30
+ "externalConfirmationPageURL" => MAge::getUrl('iglobal/success', array('_secure'=> true)),
31
+ "misc6" => "iGlobal v".Mage::getConfig()->getModuleConfig("Iglobal_Stores")->version. ", Magento v".Mage::getVersion(),
32
  "items" => $items,));
33
  return $response->tempCartUUID;
34
  }
app/code/community/Iglobal/Stores/Model/Order.php CHANGED
@@ -316,6 +316,9 @@ class Iglobal_Stores_Model_Order extends Mage_Core_Model_Abstract
316
  } catch (Exception $e){
317
  $transaction_id = '34234234234';
318
  }
 
 
 
319
  $transaction = Mage::getModel('sales/order_payment_transaction');
320
  $transaction->setOrderPaymentObject($order->getPayment());
321
  $transaction->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
316
  } catch (Exception $e){
317
  $transaction_id = '34234234234';
318
  }
319
+ if(!$transaction_id) {
320
+ $transaction_id = '34234234234';
321
+ }
322
  $transaction = Mage::getModel('sales/order_payment_transaction');
323
  $transaction->setOrderPaymentObject($order->getPayment());
324
  $transaction->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
app/code/community/Iglobal/Stores/Model/Sales/Quote/Address/Total/Fee.php DELETED
@@ -1,34 +0,0 @@
1
- <?php
2
- if (version_compare(Mage::getVersion(), '1.8', '>=')) {
3
- class Iglobal_Stores_Model_Sales_Quote_Address_Total_Fee extends Mage_Sales_Model_Quote_Address_Total_Tax
4
- {
5
- public function collect(Mage_Sales_Model_Quote_Address $address)
6
- {
7
- $fee = Mage::registry('duty_tax');
8
- if ($fee) {
9
- // Do not override taxes if there is no duty_tax set.
10
- $this->_setAddress($address);
11
- $this->_setAmount($fee);
12
- $this->_setBaseAmount($fee);
13
- } else {
14
- parent::collect($address);
15
- }
16
- }
17
- }
18
- }else {
19
- class Iglobal_Stores_Model_Sales_Quote_Address_Total_Fee extends Mage_Tax_Model_Sales_Total_Quote_Tax
20
- {
21
- public function collect(Mage_Sales_Model_Quote_Address $address)
22
- {
23
- $fee = Mage::registry('duty_tax');
24
- if ($fee) {
25
- // Do not override taxes if there is no duty_tax set.
26
- $this->_setAddress($address);
27
- $this->_setAmount($fee);
28
- $this->_setBaseAmount($fee);
29
- } else {
30
- return parent::collect($address);
31
- }
32
- }
33
- }
34
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Iglobal/Stores/Model/Tax.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Iglobal_Stores_Model_Tax extends Mage_Sales_Model_Quote_Address_Total_Abstract
3
+ {
4
+ protected $_code = 'tax';
5
+ public function setCode($code)
6
+ {
7
+ // store the international fee in the tax field.
8
+ return $this;
9
+ }
10
+ public function collect(Mage_Sales_Model_Quote_Address $address)
11
+ {
12
+ if(Mage::getStoreConfig('iglobal_integration/apireqs/ice_toggle'))
13
+ {
14
+ $fee = Mage::registry('duty_tax');
15
+ if ($fee)
16
+ {
17
+ $this->_setAddress($address);
18
+ $this->_setAmount($fee);
19
+ $this->_setBaseAmount($fee);
20
+ }
21
+ }
22
+ return $this;
23
+ }
24
+ }
25
+
app/code/community/Iglobal/Stores/controllers/AjaxController.php CHANGED
@@ -33,55 +33,6 @@ class Iglobal_Stores_AjaxController extends Mage_Core_Controller_Front_Action
33
  }
34
 
35
  public function matdataAction () {
36
-
37
- $matData = array ();
38
- //storeID for mat
39
- if (Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid')) {
40
- $matData['storeId'] = Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid');
41
- }
42
-
43
- //flag placement parent
44
- if (Mage::getStoreConfig('iglobal_integration/igmat/flag_parent')) {
45
- $matData['flag_parent'] = Mage::getStoreConfig('iglobal_integration/igmat/flag_parent');
46
- }
47
-
48
- // flag placement method
49
- if (Mage::getStoreConfig('iglobal_integration/igmat/flag_method')) {
50
- $matData['flag_method'] = Mage::getStoreConfig('iglobal_integration/igmat/flag_method');
51
- }
52
-
53
- // flag placement code
54
- if (true || Mage::getStoreConfig('iglobal_integration/igmat/flag_code')) {
55
- $matData['flag_code'] = Mage::getStoreConfig('iglobal_integration/igmat/flag_code');
56
- }
57
-
58
- //figure out what countries are serviced
59
- if (Mage::getStoreConfig('general/country/allow')) {
60
- //define iGlobal serviced countries
61
- $allCountries = array("AP"=>"APO/FPO","AF"=>"Afghanistan","AL"=>"Albania","DZ"=>"Algeria","AS"=>"American Samoa","AD"=>"Andorra","AO"=>"Angola","AI"=>"Anguilla","AG"=>"Antigua","AR"=>"Argentina","AM"=>"Armenia","AW"=>"Aruba","AU"=>"Australia","AT"=>"Austria","AZ"=>"Azerbaijan","BS"=>"Bahamas","BH"=>"Bahrain","BD"=>"Bangladesh","BB"=>"Barbados","BY"=>"Belarus","BE"=>"Belgium","BZ"=>"Belize","BJ"=>"Benin","BM"=>"Bermuda","BT"=>"Bhutan","BO"=>"Bolivia","BQ"=>"Bonaire","BA"=>"Bosnia & Herzegovina","BW"=>"Botswana","BR"=>"Brazil","VG"=>"Virgin Islands (British)","BN"=>"Brunei","BG"=>"Bulgaria","BF"=>"Burkina Faso","BI"=>"Burundi","KH"=>"Cambodia","CM"=>"Cameroon","CA"=>"Canada","IC"=>"Canary Islands","CV"=>"Cape Verde","KY"=>"Cayman Islands","CF"=>"Central African Republic","TD"=>"Chad","CL"=>"Chile","CN"=>"China - People's Republic of","CO"=>"Colombia","KM"=>"Comoros","CG"=>"Congo","CK"=>"Cook Islands","CR"=>"Costa Rica","HR"=>"Croatia","CW"=>"Curaçao","CY"=>"Cyprus","CZ"=>"Czech Republic","DK"=>"Denmark","DJ"=>"Djibouti","DM"=>"Dominica","DO"=>"Dominican Republic","TL"=>"Timor-Leste","EC"=>"Ecuador","EG"=>"Egypt","SV"=>"El Salvador","GQ"=>"Equatorial Guinea","ER"=>"Eritrea","EE"=>"Estonia","ET"=>"Ethiopia","FK"=>"Falkland Islands","FO"=>"Faroe Islands (Denmark)","FJ"=>"Fiji","FI"=>"Finland","FR"=>"France","GF"=>"French Guiana","GA"=>"Gabon","GM"=>"Gambia","GE"=>"Georgia","DE"=>"Germany","GI"=>"Gibraltar","GR"=>"Greece","GL"=>"Greenland (Denmark)","GD"=>"Grenada","GP"=>"Guadeloupe","GU"=>"Guam","GH"=>"Ghana","GT"=>"Guatemala","GG"=>"Guernsey","GN"=>"Guinea","GW"=>"Guinea-Bissau","GY"=>"Guyana","HT"=>"Haiti","HN"=>"Honduras","HK"=>"Hong Kong","HU"=>"Hungary","IS"=>"Iceland","IN"=>"India","ID"=>"Indonesia","IQ"=>"Iraq","IE"=>"Ireland - Republic Of","IL"=>"Israel","IT"=>"Italy","CI"=>"Ivory Coast","JM"=>"Jamaica","JP"=>"Japan","JE"=>"Jersey","JO"=>"Jordan","KZ"=>"Kazakhstan","KE"=>"Kenya","KI"=>"Kiribati","KR"=>"Korea","KW"=>"Kuwait","KG"=>"Kyrgyzstan","LA"=>"Laos","LV"=>"Latvia","LB"=>"Lebanon","LS"=>"Lesotho","LR"=>"Liberia","LT"=>"Lithuania","LI"=>"Liechtenstein","LU"=>"Luxembourg","MO"=>"Macau","MK"=>"Macedonia","MG"=>"Madagascar","MW"=>"Malawi","MY"=>"Malaysia","MV"=>"Maldives","ML"=>"Mali","MT"=>"Malta","MH"=>"Marshall Islands","MQ"=>"Martinique","MR"=>"Mauritania","MU"=>"Mauritius","YT"=>"Mayotte","MX"=>"Mexico","MD"=>"Moldova","FM"=>"Micronesia - Federated States of","MC"=>"Monaco","MN"=>"Mongolia","ME"=>"Montenegro","MS"=>"Montserrat","MA"=>"Morocco","MZ"=>"Mozambique","MM"=>"Myanmar","NA"=>"Namibia","NR"=>"Nauru","NP"=>"Nepal","NL"=>"Netherlands (Holland)","NV"=>"Nevis","NC"=>"New Caledonia","NZ"=>"New Zealand","NI"=>"Nicaragua","NE"=>"Niger","NG"=>"Nigeria","NU"=>"Niue Island","NF"=>"Norfolk Island","MP"=>"Northern Mariana Islands","NO"=>"Norway","OM"=>"Oman","PK"=>"Pakistan","PA"=>"Panama","PG"=>"Papua New Guinea","PY"=>"Paraguay","PW"=>"Palau","PE"=>"Peru","PH"=>"Philippines","PL"=>"Poland","PT"=>"Portugal","PR"=>"Puerto Rico","QA"=>"Qatar","RE"=>"Reunion","RO"=>"Romania","RU"=>"Russia","RW"=>"Rwanda","SM"=>"San Marino","ST"=>"Sao Tome & Principe","SA"=>"Saudi Arabia","SN"=>"Senegal","RS"=>"Serbia & Montenegro","SC"=>"Seychelles","SL"=>"Sierra Leone","SG"=>"Singapore","SK"=>"Slovakia","SI"=>"Slovenia","SB"=>"Solomon Islands","ZA"=>"South Africa","SS"=>"South Sudan","ES"=>"Spain","LK"=>"Sri Lanka","BL"=>"St. Barthelemy","EU"=>"St. Eustatius","KN"=>"St. Kitts and Nevis","LC"=>"St. Lucia","MF"=>"St. Maarten","VC"=>"St. Vincent","SD"=>"Sudan","SR"=>"Suriname","SZ"=>"Swaziland","SE"=>"Sweden","CH"=>"Switzerland","PF"=>"Tahiti","TW"=>"Taiwan","TJ"=>"Tajikistan","TZ"=>"Tanzania","TH"=>"Thailand","TG"=>"Togo","TO"=>"Tonga","TT"=>"Trinidad and Tobago","TN"=>"Tunisia","TR"=>"Turkey","TM"=>"Turkmenistan","TC"=>"Turks and Caicos Islands","TV"=>"Tuvalu","VI"=>"Virgin Islands (U.S.)","UG"=>"Uganda","UA"=>"Ukraine","AE"=>"United Arab Emirates","GB"=>"United Kingdom","US"=>"United States","UY"=>"Uruguay","UZ"=>"Uzbekistan","VU"=>"Vanuatu","VE"=>"Venezuela","VN"=>"Vietnam","VA"=>"Vatican City","WS"=>"Western Samoa","YE"=>"Yemen","ZM"=>"Zambia","ZW"=>"Zimbabwe");
62
-
63
- //allowed country list
64
- $allowedCountries = Mage::getStoreConfig('general/country/allow');
65
- $allowedCountries = array_flip(explode("," , $allowedCountries));
66
-
67
- //countries that are both allowed and iGlobal available
68
- $servicedCountries = array_intersect_key ($allCountries, $allowedCountries);
69
- $matData['servicedCountries'] = $servicedCountries;
70
- }
71
-
72
- //domestic country list
73
- if (Mage::getStoreConfig('general/country/ig_domestic_countries')) {
74
- $matData['domesticCountries'] =Mage::getStoreConfig('general/country/ig_domestic_countries');
75
- }
76
-
77
-
78
- //store logo url
79
- if (Mage::getStoreConfig('iglobal_integration/igmat/store_logo')) {
80
- $matData['storeLogo'] = Mage::getStoreConfig('iglobal_integration/igmat/store_logo');
81
- }
82
-
83
- //Zend_Debug::dump($matData);
84
- $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($matData));
85
-
86
  }
87
  }
33
  }
34
 
35
  public function matdataAction () {
36
+ $this->getResponse()->setBody(Mage::helper('stores')->getJavascriptVars());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  }
38
  }
app/code/community/Iglobal/Stores/controllers/CheckoutController.php CHANGED
@@ -6,7 +6,13 @@ class Iglobal_Stores_CheckoutController extends Mage_Core_Controller_Front_Actio
6
  {
7
  public function indexAction()
8
  {
9
- //todo: add a check to see if they are domestic and then redirect to domestic checkout
 
 
 
 
 
 
10
  if (Mage::getStoreConfig('iglobal_integration/apireqs/force_login') && !Mage::getSingleton('customer/session')->isLoggedIn()) {
11
  Mage::getSingleton('customer/session')->setBeforeAuthUrl(Mage::getUrl('iglobal/checkout'));
12
  Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('customer/account/login'));
@@ -15,8 +21,7 @@ class Iglobal_Stores_CheckoutController extends Mage_Core_Controller_Front_Actio
15
  $cartQty = (int) Mage::getModel('checkout/cart')->getQuote()->getItemsQty();
16
  if (!$cartQty) {
17
  $this->_redirect('checkout/cart');
18
- die();
19
- //echo "The Cart is Empty";
20
  }
21
 
22
  $tempcart = Mage::getModel('stores/international_international');
@@ -27,20 +32,21 @@ class Iglobal_Stores_CheckoutController extends Mage_Core_Controller_Front_Actio
27
  }
28
 
29
  $cartId = $tempcart->getTempCartId();
30
-
31
- // echo out the html that will build the iframe
32
- $domCode = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>International Checkout</title> <style type="text/css"> body, html {margin: 0; padding: 0; height: 100%; overflow: hidden;} #content{position:absolute; left: 0; right: 0; bottom: 0; top: 0;} </style></head><body><div id="content"><iframe width="100%" height="100%" frameborder="0" src="';
33
- //this is where we build the url for the checkout
34
- $subdomain = (Mage::getStoreConfig('iglobal_integration/apireqs/igsubdomain') ? Mage::getStoreConfig('iglobal_integration/apireqs/igsubdomain') : "checkout");
35
- $storeNumber = (Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid') ? Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid') : "3");
36
- $countryCode = (isset($_COOKIE['igCountry']) ? $_COOKIE['igCountry'] : "");
37
-
38
- $iframeUrl = 'https://' . $subdomain . '.iglobalstores.com/?store=' . $storeNumber . '&tempCartUUID=' . $cartId . '&country=' . $countryCode;
39
-
40
- $domCode = $domCode . $iframeUrl . '"/></div></body></html>';
41
-
42
- echo $domCode;
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  }
45
 
46
  }
6
  {
7
  public function indexAction()
8
  {
9
+ //check to see if they are domestic and then redirect to domestic checkout
10
+ $helper = Mage::helper('stores');
11
+ if($helper->isDomestic()){
12
+ $this->_redirect('checkout/onepage');
13
+ return;
14
+ }
15
+
16
  if (Mage::getStoreConfig('iglobal_integration/apireqs/force_login') && !Mage::getSingleton('customer/session')->isLoggedIn()) {
17
  Mage::getSingleton('customer/session')->setBeforeAuthUrl(Mage::getUrl('iglobal/checkout'));
18
  Mage::app()->getFrontController()->getResponse()->setRedirect(Mage::getUrl('customer/account/login'));
21
  $cartQty = (int) Mage::getModel('checkout/cart')->getQuote()->getItemsQty();
22
  if (!$cartQty) {
23
  $this->_redirect('checkout/cart');
24
+ return;
 
25
  }
26
 
27
  $tempcart = Mage::getModel('stores/international_international');
32
  }
33
 
34
  $cartId = $tempcart->getTempCartId();
35
+ $url = $helper->getCheckoutUrl($cartId);
 
 
 
 
 
 
 
 
 
 
 
 
36
 
37
+ if(Mage::getStoreConfig('iglobal_integration/apireqs/use_iframe')) {
38
+ // echo out the html that will build the iframe
39
+ $domCode = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
40
+ $domCode .= '<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>International Checkout</title>';
41
+ $domCode .= '<style type="text/css"> body, html {margin: 0; padding: 0; height: 100%; overflow: hidden;} #content{position:absolute; left: 0; right: 0; bottom: 0; top: 0;} </style>';
42
+ $domCode .= '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
43
+ $domCode .= '</head><body>';
44
+ $domCode .= '<div id="content"><iframe width="100%" height="100%" frameborder="0" src="';
45
+ $domCode .= $url . '"/></div></body></html>';
46
+ echo $domCode;
47
+ } else {
48
+ $this->_redirectUrl($url);
49
+ }
50
  }
51
 
52
  }
app/code/community/Iglobal/Stores/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Iglobal_Stores>
5
- <version>1.1.1</version>
6
  <currencies>
7
  <AED></AED>
8
  <ARS>&amp;#8371;</ARS>
@@ -169,7 +169,7 @@
169
  </countries>
170
  </Iglobal_Stores>
171
  </modules>
172
- <admin>
173
  <routers>
174
  <stores>
175
  <use>admin</use>
@@ -179,16 +179,16 @@
179
  </args>
180
  </stores>
181
  </routers>
182
- </admin>
183
  <global>
184
  <sales>
185
  <quote>
186
  <totals>
187
- <tax>
188
- <class>stores/sales_quote_address_total_fee</class>
189
- <after>subtotal,shipping</after>
190
  <before>grand_total</before>
191
- </tax>
192
  </totals>
193
  </quote>
194
  </sales>
2
  <config>
3
  <modules>
4
  <Iglobal_Stores>
5
+ <version>1.4.0</version>
6
  <currencies>
7
  <AED></AED>
8
  <ARS>&amp;#8371;</ARS>
169
  </countries>
170
  </Iglobal_Stores>
171
  </modules>
172
+ <!--admin>
173
  <routers>
174
  <stores>
175
  <use>admin</use>
179
  </args>
180
  </stores>
181
  </routers>
182
+ </admin-->
183
  <global>
184
  <sales>
185
  <quote>
186
  <totals>
187
+ <fee>
188
+ <class>stores/tax</class>
189
+ <after>tax</after>
190
  <before>grand_total</before>
191
+ </fee>
192
  </totals>
193
  </quote>
194
  </sales>
app/design/frontend/base/default/template/iglobal/stores/igcincludes.phtml CHANGED
@@ -5,10 +5,9 @@
5
 
6
  //label the area of DOM
7
  echo '<!--Added for iGlobal-->';
8
-
9
  //set include for welcome mat
10
  if (Mage::getStoreConfig('iglobal_integration/igmat/welcome_mat_active')){ //welcome mat is on
11
-
12
  if (Mage::getStoreConfig('iglobal_integration/igmat/welcome_mat_script')){ //custom welcome mat js has been uploaded
13
 
14
  //include custom welcome mat
@@ -41,17 +40,54 @@
41
 
42
  //set includes for ICE and main
43
  if (Mage::getStoreConfig('iglobal_integration/apireqs/ice_toggle') && Mage::getStoreConfig('iglobal_integration/apireqs/use_ice')) { //&& ((false !== strpos($url,'cart')) || (false !== strpos($url,'checkout')))
44
-
45
  //include main js
46
- echo '<script type="text/javascript" src="https://checkout.iglobalstores.com/js/igc.cs.main.js"></script>';
47
-
48
- if (Mage::getStoreConfig('iglobal_integration/apireqs/ice')){
49
  //include custom ICE
50
- echo '<script type="text/javascript" src="'.Mage::getStoreConfig('iglobal_integration/apireqs/ice').'"></script>';
51
  } else {
52
  //include default ICE
53
- echo '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'iGlobal/igc.cs.magento_default_ice.js"></script>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  }
55
  }
56
-
57
  echo '<!--End of iGlobal-->';
5
 
6
  //label the area of DOM
7
  echo '<!--Added for iGlobal-->';
 
8
  //set include for welcome mat
9
  if (Mage::getStoreConfig('iglobal_integration/igmat/welcome_mat_active')){ //welcome mat is on
10
+ echo '<script type="text/javascript">var ig_vars=' . Mage::helper('stores')->getJavascriptVars() . ';</script>';
11
  if (Mage::getStoreConfig('iglobal_integration/igmat/welcome_mat_script')){ //custom welcome mat js has been uploaded
12
 
13
  //include custom welcome mat
40
 
41
  //set includes for ICE and main
42
  if (Mage::getStoreConfig('iglobal_integration/apireqs/ice_toggle') && Mage::getStoreConfig('iglobal_integration/apireqs/use_ice')) { //&& ((false !== strpos($url,'cart')) || (false !== strpos($url,'checkout')))
43
+
44
  //include main js
45
+ echo '<script type="text/javascript" src="https://checkout.iglobalstores.com/js/igc.cs.main.js"></script>';
46
+
47
+ if (Mage::getStoreConfig('iglobal_integration/apireqs/ice')) {
48
  //include custom ICE
49
+ echo '<script type="text/javascript" src="' . Mage::getStoreConfig('iglobal_integration/apireqs/ice') . '"></script>';
50
  } else {
51
  //include default ICE
52
+ echo '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'iGlobal/igc.cs.magento_default_ice.js"></script>';
53
+ }
54
+ //If logged in, pre-populate shopping cart with customer data
55
+ if (Mage::getSingleton('customer/session')->isLoggedIn()) {
56
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
57
+ $shipping_id = $customer->getDefaultShipping();
58
+
59
+ if ($shipping_id) {
60
+ $shipping_address = Mage::getModel('customer/address')->load($shipping_id);
61
+ }
62
+
63
+ $customer_data = '<script type="text/javascript">';
64
+
65
+ if (!$shipping_address) {
66
+ $customer_data .= '
67
+ var customerName="' . $customer['firstname'] . ' ' . $customer['lastname'] . '";
68
+ var customerCompany="' . $customer['company'] . '";
69
+ var customerEmail="' . $customer['email'] . '";
70
+ var customerPhone="' . $customer['telephone'] . '";
71
+ ';
72
+
73
+ } else {
74
+ $customer_data .= '
75
+ var customerName="' . $shipping_address['firstname'] . ' ' . $shipping_address['lastname'] . '";
76
+ var customerCompany="' . $shipping_address['company'] . '";
77
+ var customerEmail="' . $customer['email'] . '";
78
+ var customerPhone="' . $shipping_address['telephone'] . '";
79
+ var customerAddress1="' . $shipping_address->getStreet(1) . '";
80
+ var customerAddress2="' . $shipping_address->getStreet(2) . '";
81
+ var customerCity="' . $shipping_address['city'] . '";
82
+ var customerState="' . $shipping_address['region'] . '";
83
+ var customerCountry="' . $shipping_address['country_id'] . '";
84
+ var customerZip="' . $shipping_address['postcode'] . '";
85
+ ';
86
+ }
87
+
88
+ $customer_data .= '</script>';
89
+
90
+ echo $customer_data;
91
  }
92
  }
 
93
  echo '<!--End of iGlobal-->';
js/iGlobal/ig_welcome_mat_default.css CHANGED
@@ -22,7 +22,7 @@
22
  .headerOne { font-size: 30px; padding-left: 0.5em; color: #0068AC; /* Set the color of your choice here */ text-transform: uppercase; }
23
  .headerTwo { color: #999; margin-top: 7px; font-size: 12px; }
24
  .igModalBody { text-align: center; background-color: white; width: 100%; min-height: 320px; }
25
- .countryDropDownWrapper { width: 250px; min-height: 25px; -webkit-border-radius: 10px; border-radius: 10px; background: url(https://iglobalstores.com/images/downarrow.png) no-repeat 94% center; border: 2px solid #0068AC; /* Set the color of your choice here */ margin: 0 auto; padding: 0; cursor: pointer; }
26
  #countrySelect { position: relative; height: 35px; padding: 7px 10px; margin: 0px; font-size: 14px; line-height: 14px; color: #333 !important; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none; background: none !important; border: 0 !important; -webkit-appearance: none; -moz-appearance: window; appearance: none; ms-appearance: none; overflow: hidden; }
27
  select::-ms-expand { display: none; }
28
  ul.featureList { padding: 20px; margin: 0; -webkit-padding-start: 0; background-color: #999; color: #e8e8e8; }
22
  .headerOne { font-size: 30px; padding-left: 0.5em; color: #0068AC; /* Set the color of your choice here */ text-transform: uppercase; }
23
  .headerTwo { color: #999; margin-top: 7px; font-size: 12px; }
24
  .igModalBody { text-align: center; background-color: white; width: 100%; min-height: 320px; }
25
+ .countryDropDownWrapper { width: 250px; min-height: 25px; -webkit-border-radius: 10px; border-radius: 10px; border: 2px solid #0068AC; /* Set the color of your choice here */ margin: 0 auto; padding: 0; cursor: pointer; }
26
  #countrySelect { position: relative; height: 35px; padding: 7px 10px; margin: 0px; font-size: 14px; line-height: 14px; color: #333 !important; text-shadow: 0 1px 1px rgba(255, 255, 255, 0.75); cursor: pointer; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none; background: none !important; border: 0 !important; -webkit-appearance: none; -moz-appearance: window; appearance: none; ms-appearance: none; overflow: hidden; }
27
  select::-ms-expand { display: none; }
28
  ul.featureList { padding: 20px; margin: 0; -webkit-padding-start: 0; background-color: #999; color: #e8e8e8; }
js/iGlobal/ig_welcome_mat_default.js CHANGED
@@ -7,102 +7,32 @@
7
  //
8
 
9
  //default settings - these will be overwritten by any settings made in Magento
10
- var ig_storeId = 3;
11
  var ig_cookieDomain = window.location.hostname;// If you prefer, you can put your domain here, like so "yourdomain.com";
12
- var ig_countries = {"AL":"Albania","DZ":"Algeria","AS":"American Samoa","AD":"Andorra","AO":"Angola","AI":"Anguilla","AG":"Antigua","AR":"Argentina","AM":"Armenia","AW":"Aruba","AU":"Australia","AT":"Austria","AZ":"Azerbaijan","BS":"Bahamas","BH":"Bahrain","BD":"Bangladesh","BB":"Barbados","BE":"Belgium","BZ":"Belize","BJ":"Benin","BM":"Bermuda","BT":"Bhutan","BO":"Bolivia","BQ":"Bonaire, St. Eustatius & Saba","BA":"Bosnia & Herzegovina","BW":"Botswana","BR":"Brazil","BN":"Brunei","BG":"Bulgaria","BF":"Burkina Faso","BI":"Burundi","KH":"Cambodia","CM":"Cameroon","CA":"Canada","IC":"Canary Islands","CV":"Cape Verde","KY":"Cayman Islands","CF":"Central African Republic","TD":"Chad","CL":"Chile","CN":"China - People's Republic of","CO":"Colombia","KM":"Comoros","CG":"Congo","CK":"Cook Islands","CR":"Costa Rica","HR":"Croatia","CW":"Curaçao","CY":"Cyprus","CZ":"Czech Republic","DK":"Denmark","DJ":"Djibouti","DM":"Dominica","DO":"Dominican Republic","EC":"Ecuador","EG":"Egypt","SV":"El Salvador","GQ":"Equatorial Guinea","ER":"Eritrea","EE":"Estonia","ET":"Ethiopia","FK":"Falkland Islands","FO":"Faroe Islands (Denmark)","FJ":"Fiji","FI":"Finland","FR":"France","GF":"French Guiana","GA":"Gabon","GM":"Gambia","GE":"Georgia","DE":"Germany","GH":"Ghana","GI":"Gibraltar","GR":"Greece","GL":"Greenland (Denmark)","GD":"Grenada","GP":"Guadeloupe","GU":"Guam","GT":"Guatemala","GG":"Guernsey","GN":"Guinea","GW":"Guinea-Bissau","GY":"Guyana","HT":"Haiti","HN":"Honduras","HK":"Hong Kong","HU":"Hungary","IS":"Iceland","IN":"India","ID":"Indonesia","IE":"Ireland - Republic Of","IL":"Israel","IT":"Italy","CI":"Ivory Coast","JM":"Jamaica","JP":"Japan","JE":"Jersey","JO":"Jordan","KZ":"Kazakhstan","KE":"Kenya","KI":"Kiribati","KR":"Korea, Republic of (South Korea)","KW":"Kuwait","KG":"Kyrgyzstan","LA":"Laos","LV":"Latvia","LS":"Lesotho","LR":"Liberia","LI":"Liechtenstein","LT":"Lithuania","LU":"Luxembourg","MO":"Macau","MK":"Macedonia","MG":"Madagascar","MW":"Malawi","MY":"Malaysia","MV":"Maldives","ML":"Mali","MT":"Malta","MH":"Marshall Islands","MQ":"Martinique","MR":"Mauritania","MU":"Mauritius","YT":"Mayotte","MX":"Mexico","FM":"Micronesia - Federated States of","MD":"Moldova","MC":"Monaco","MN":"Mongolia","ME":"Montenegro","MS":"Montserrat","MA":"Morocco","MZ":"Mozambique","MM":"Myanmar","NA":"Namibia","NR":"Nauru, Republic of","NP":"Nepal","NL":"Netherlands (Holland)","NV":"Nevis","NC":"New Caledonia","NZ":"New Zealand","NI":"Nicaragua","NE":"Niger","NG":"Nigeria","NU":"Niue Island","NO":"Norway","OM":"Oman","PK":"Pakistan","PW":"Palau","PA":"Panama","PG":"Papua New Guinea","PY":"Paraguay","PE":"Peru","PH":"Philippines","PL":"Poland","PT":"Portugal","PR":"Puerto Rico","QA":"Qatar","RE":"Reunion","RO":"Romania","RU":"Russia","RW":"Rwanda","SM":"San Marino","ST":"Sao Tome & Principe","SA":"Saudi Arabia","SN":"Senegal","RS":"Serbia & Montenegro","SC":"Seychelles","SL":"Sierra Leone","SG":"Singapore","SK":"Slovakia","SI":"Slovenia","SB":"Solomon Islands","ZA":"South Africa","SS":"South Sudan","ES":"Spain","LK":"Sri Lanka","BL":"St. Barthelemy","EU":"St. Eustatius","KN":"St. Kitts and Nevis","LC":"St. Lucia","MF":"St. Maarten","VC":"St. Vincent","SR":"Suriname","SZ":"Swaziland","SE":"Sweden","CH":"Switzerland","PF":"Tahiti","TW":"Taiwan","TJ":"Tajikistan","TZ":"Tanzania","TH":"Thailand","TL":"Timor-Leste","TG":"Togo","TO":"Tonga","TT":"Trinidad and Tobago","TN":"Tunisia","TR":"Turkey","TM":"Turkmenistan","TC":"Turks and Caicos Islands","TV":"Tuvalu","UG":"Uganda","UA":"Ukraine","AE":"United Arab Emirates","GB":"United Kingdom","US":"United States","UY":"Uruguay","UZ":"Uzbekistan","VU":"Vanuatu","VE":"Venezuela","VN":"Vietnam","VG":"Virgin Islands (British)","VI":"Virgin Islands (U.S.)","WS":"Western Samoa","YE":"Yemen","ZM":"Zambia","ZW":"Zimbabwe"};
13
- var ig_domesticCountryCodes = ['US'];
14
- var ig_logoUrl = "http://iglobalstores.com/images/iglobal-stores.png";
15
- var ig_flagLocation = "body";
16
- var ig_flagMethod = "prepend";
17
- var ig_flagCode = '<div id="igFlag"></div>';
18
- var ajaxPath = '/iglobal/ajax/matdata';
19
- //ajaxPath = '/magento/index.php/iglobal/ajax/matdata'; //override used on some testing installs
20
-
21
- // Set internal JQuery Variable
22
  // Can set to existing $ on page, or can include Jquery here, and set igJq to jquery-no-conflict
23
- //
24
- igJq = jQuery; //Sets internal jquery variable to the existing $ on the page.
25
-
26
- //set my dynamic variables with ajax call to use Magento Configs.
27
- //countries are set in general>country options
28
- //other settings are in the iGlobal tab
29
- var ajaxResult = igJq.ajax({
30
- async: false,
31
- global: false,
32
- url: ajaxPath,
33
- //dataType: 'json',
34
- success: function(data){
35
-
36
- var ajaxResult = eval("(" + data + ")");
37
- //console.log(ajaxResult);
38
- //store ID
39
- if (ajaxResult.storeId && ajaxResult.storeId != "Your Store ID Goes Here"){
40
- // store ID is set
41
- ig_storeId = ajaxResult.storeId;
42
- }
43
-
44
- //flag placement parent
45
- if (ajaxResult.flag_parent){
46
- // store ID is set
47
- ig_flagLocation = ajaxResult.flag_parent;
48
- }
49
-
50
- // TODO: flag placement method
51
- if (ajaxResult.flag_method){
52
- // store ID is set
53
- ig_flagMethod = ajaxResult.flag_method;
54
- ig_flagMethod = ig_flagMethod.toLowerCase();
55
- }
56
-
57
- // TODO: flag placement code
58
- if (ajaxResult.flag_code){
59
- // store ID is set
60
- ig_flagCode = ajaxResult.flag_code;
61
- }
62
-
63
- //serviced country list
64
- if (ajaxResult.servicedCountries){
65
- // store ID is set
66
- ig_countries = ajaxResult.servicedCountries;
67
- }
68
-
69
-
70
- //domestic countries list
71
- if (ajaxResult.domesticCountries){
72
- // store ID is set
73
- ig_domestic = ajaxResult.domesticCountries;
74
- ig_domesticCountryCodes = ig_domestic.split(",")
75
- //console.log(ig_domesticCountryCodes);
76
- }
77
-
78
-
79
- //logo URL
80
- if (ajaxResult.storeLogo){
81
- // store ID is set
82
- ig_logoUrl = ajaxResult.storeLogo;
83
- }
84
-
85
- }
86
- });
87
-
88
-
89
-
90
 
91
  igJq(function(){
92
  if (ig_flagMethod == "prepend"){
93
- igJq(ig_flagLocation).prepend(ig_flagCode);
94
  }
95
  else if (ig_flagMethod == "append"){
96
- igJq(ig_flagLocation).append(ig_flagCode);
97
  }
98
  else if (ig_flagMethod == "before"){
99
- igJq(ig_flagLocation).before(ig_flagCode);
100
  }
101
  else if (ig_flagMethod == "after"){
102
- igJq(ig_flagLocation).after(ig_flagCode);
103
  }
104
  else {
105
- igJq(ig_flagLocation).prepend(ig_flagCode);
106
  }
107
  });
108
 
@@ -738,7 +668,7 @@ function ig_showTheSplash() {
738
  }
739
 
740
  function ig_createNestContents() {
741
- return '<img onclick="ig_showTheSplash();" src="https://d1vyngmisxigjx.cloudfront.net/images/flags/96x64/'+((ig_country)?ig_country.toUpperCase():'undefined')+'.png" class="igWelcomeFlagHeader" alt="Select your country." />';
742
  }
743
 
744
  function ig_placeNestHtml() {
7
  //
8
 
9
  //default settings - these will be overwritten by any settings made in Magento
10
+ var ig_storeId = ig_vars.storeId || 3;
11
  var ig_cookieDomain = window.location.hostname;// If you prefer, you can put your domain here, like so "yourdomain.com";
12
+ var ig_countries = ig_vars.servicedCountries || {"AL":"Albania","DZ":"Algeria","AS":"American Samoa","AD":"Andorra","AO":"Angola","AI":"Anguilla","AG":"Antigua","AR":"Argentina","AM":"Armenia","AW":"Aruba","AU":"Australia","AT":"Austria","AZ":"Azerbaijan","BS":"Bahamas","BH":"Bahrain","BD":"Bangladesh","BB":"Barbados","BE":"Belgium","BZ":"Belize","BJ":"Benin","BM":"Bermuda","BT":"Bhutan","BO":"Bolivia","BQ":"Bonaire, St. Eustatius & Saba","BA":"Bosnia & Herzegovina","BW":"Botswana","BR":"Brazil","BN":"Brunei","BG":"Bulgaria","BF":"Burkina Faso","BI":"Burundi","KH":"Cambodia","CM":"Cameroon","CA":"Canada","IC":"Canary Islands","CV":"Cape Verde","KY":"Cayman Islands","CF":"Central African Republic","TD":"Chad","CL":"Chile","CN":"China - People's Republic of","CO":"Colombia","KM":"Comoros","CG":"Congo","CK":"Cook Islands","CR":"Costa Rica","HR":"Croatia","CW":"Curaçao","CY":"Cyprus","CZ":"Czech Republic","DK":"Denmark","DJ":"Djibouti","DM":"Dominica","DO":"Dominican Republic","EC":"Ecuador","EG":"Egypt","SV":"El Salvador","GQ":"Equatorial Guinea","ER":"Eritrea","EE":"Estonia","ET":"Ethiopia","FK":"Falkland Islands","FO":"Faroe Islands (Denmark)","FJ":"Fiji","FI":"Finland","FR":"France","GF":"French Guiana","GA":"Gabon","GM":"Gambia","GE":"Georgia","DE":"Germany","GH":"Ghana","GI":"Gibraltar","GR":"Greece","GL":"Greenland (Denmark)","GD":"Grenada","GP":"Guadeloupe","GU":"Guam","GT":"Guatemala","GG":"Guernsey","GN":"Guinea","GW":"Guinea-Bissau","GY":"Guyana","HT":"Haiti","HN":"Honduras","HK":"Hong Kong","HU":"Hungary","IS":"Iceland","IN":"India","ID":"Indonesia","IE":"Ireland - Republic Of","IL":"Israel","IT":"Italy","CI":"Ivory Coast","JM":"Jamaica","JP":"Japan","JE":"Jersey","JO":"Jordan","KZ":"Kazakhstan","KE":"Kenya","KI":"Kiribati","KR":"Korea, Republic of (South Korea)","KW":"Kuwait","KG":"Kyrgyzstan","LA":"Laos","LV":"Latvia","LS":"Lesotho","LR":"Liberia","LI":"Liechtenstein","LT":"Lithuania","LU":"Luxembourg","MO":"Macau","MK":"Macedonia","MG":"Madagascar","MW":"Malawi","MY":"Malaysia","MV":"Maldives","ML":"Mali","MT":"Malta","MH":"Marshall Islands","MQ":"Martinique","MR":"Mauritania","MU":"Mauritius","YT":"Mayotte","MX":"Mexico","FM":"Micronesia - Federated States of","MD":"Moldova","MC":"Monaco","MN":"Mongolia","ME":"Montenegro","MS":"Montserrat","MA":"Morocco","MZ":"Mozambique","MM":"Myanmar","NA":"Namibia","NR":"Nauru, Republic of","NP":"Nepal","NL":"Netherlands (Holland)","NV":"Nevis","NC":"New Caledonia","NZ":"New Zealand","NI":"Nicaragua","NE":"Niger","NG":"Nigeria","NU":"Niue Island","NO":"Norway","OM":"Oman","PK":"Pakistan","PW":"Palau","PA":"Panama","PG":"Papua New Guinea","PY":"Paraguay","PE":"Peru","PH":"Philippines","PL":"Poland","PT":"Portugal","PR":"Puerto Rico","QA":"Qatar","RE":"Reunion","RO":"Romania","RU":"Russia","RW":"Rwanda","SM":"San Marino","ST":"Sao Tome & Principe","SA":"Saudi Arabia","SN":"Senegal","RS":"Serbia & Montenegro","SC":"Seychelles","SL":"Sierra Leone","SG":"Singapore","SK":"Slovakia","SI":"Slovenia","SB":"Solomon Islands","ZA":"South Africa","SS":"South Sudan","ES":"Spain","LK":"Sri Lanka","BL":"St. Barthelemy","EU":"St. Eustatius","KN":"St. Kitts and Nevis","LC":"St. Lucia","MF":"St. Maarten","VC":"St. Vincent","SR":"Suriname","SZ":"Swaziland","SE":"Sweden","CH":"Switzerland","PF":"Tahiti","TW":"Taiwan","TJ":"Tajikistan","TZ":"Tanzania","TH":"Thailand","TL":"Timor-Leste","TG":"Togo","TO":"Tonga","TT":"Trinidad and Tobago","TN":"Tunisia","TR":"Turkey","TM":"Turkmenistan","TC":"Turks and Caicos Islands","TV":"Tuvalu","UG":"Uganda","UA":"Ukraine","AE":"United Arab Emirates","GB":"United Kingdom","US":"United States","UY":"Uruguay","UZ":"Uzbekistan","VU":"Vanuatu","VE":"Venezuela","VN":"Vietnam","VG":"Virgin Islands (British)","VI":"Virgin Islands (U.S.)","WS":"Western Samoa","YE":"Yemen","ZM":"Zambia","ZW":"Zimbabwe"};
13
+ var ig_domesticCountryCodes = (ig_vars.domesticCountries || 'US').split(",");
14
+ var ig_logoUrl = ig_vars.storeLogo || "http://iglobalstores.com/images/iglobal-stores.png";
15
+ var ig_flagLocation = ig_vars.flag_parent || "body";
16
+ var ig_flagMethod = ig_vars.flag_method || "prepend";
17
+ var ig_flagCode = ig_vars.flag_code || '<div id="igFlag"></div>';
 
 
 
 
18
  // Can set to existing $ on page, or can include Jquery here, and set igJq to jquery-no-conflict
19
+ igJq = jQuery;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
  igJq(function(){
22
  if (ig_flagMethod == "prepend"){
23
+ igJq(ig_flagLocation).prepend(ig_flagCode);
24
  }
25
  else if (ig_flagMethod == "append"){
26
+ igJq(ig_flagLocation).append(ig_flagCode);
27
  }
28
  else if (ig_flagMethod == "before"){
29
+ igJq(ig_flagLocation).before(ig_flagCode);
30
  }
31
  else if (ig_flagMethod == "after"){
32
+ igJq(ig_flagLocation).after(ig_flagCode);
33
  }
34
  else {
35
+ igJq(ig_flagLocation).prepend(ig_flagCode);
36
  }
37
  });
38
 
668
  }
669
 
670
  function ig_createNestContents() {
671
+ return '<img onclick="ig_showTheSplash();" src="https://d1vyngmisxigjx.cloudfront.net/images/flags/96x64/'+((ig_country)?ig_country.toUpperCase():'US')+'.png" class="igWelcomeFlagHeader" alt="Select your country." />';
672
  }
673
 
674
  function ig_placeNestHtml() {
js/iGlobal/igc.cs.magento_default_ice.js CHANGED
@@ -1,203 +1,108 @@
1
- $igc =jQuery
2
-
3
-
4
- //These are the Key variables used in customizing this script. By changing these, many Magento themes will operate correctly with iGlobal technology. Some themes require further customization by defining the item details below.
5
- //identify the store
6
- var igStoreId = "3"; //this can be set by updating the "iGlobal Store ID Number" in Magento conficuration options
7
- var igSubdomain = "checkout"; //this can be set by updating the "iGlobal Hosted Checkout Subdomain" in Magento conficuration options
8
- var igCartUrl = "/checkout/cart";
9
- var ajaxPath = '/iglobal/ajax/icedata';
10
- //ajaxPath = '/magento/index.php/iglobal/ajax/icedata'; //override used on some testing installs
11
-
12
- $igc.post (
13
- ajaxPath,
14
- function(data){
15
-
16
- //console.log(data);
17
- var result = eval("(" + data + ")");
18
-
19
- if (result.storeId){
20
- // store ID is set
21
- igStoreId = result.storeId;
22
- }
23
-
24
- if (result.subdomain){
25
- // subdomain is set
26
- igSubdomain = result.subdomain;
27
- }
28
-
29
- if (result.cartUrl){
30
- // subdomain is set
31
- igCartUrl = result.cartUrl;
32
- }
33
-
34
- }
35
- );
36
- //}
37
-
38
- function igcCheckout() {
39
-
40
- igcGoToCheckout(igStoreId);
41
- }
42
-
43
- function getSelectedCountry() {
44
- return ig_country;
45
- }
46
-
47
- function getSubDomain() {
48
- return igSubdomain;
49
- }
50
-
51
- function igcGetItems() {
52
-
53
- var items = new Array();
54
- var itemRows = $igc(".igItemDetails");//products rows
55
-
56
- $igc(itemRows).each(function() {
57
- var qty = $igc(this).find('.igQty').text();
58
- var price = $igc(this).find('.igPrice').text();
59
- var imgURL = $igc(this).find('.igImage').text();
60
- var itemURL = $igc(this).find('.igUrl').text();
61
- var descTxt = '<span class="itemDescription">' + $igc(this).find('.igName').text() + '</span>';// + $igc(this).find('.igItemOptions').html();
62
- var sku = $igc(this).find('.igSku').text();
63
- var pid =$igc(this).find('.igID').text();
64
- if ($igc(this).find('.ig_itemWeight').text()){
65
- var weight = $igc(this).find('.ig_itemWeight').text();
66
- } else {
67
- var weight = $igc(this).find('.MageWeight').text();
68
- }
69
- var weight = $igc(this).find('.ig_itemWeight').text();
70
- var length = $igc(this).find('.ig_itemLength').text();
71
- var width = $igc(this).find('.ig_itemWidth').text();
72
- var height = $igc(this).find('.ig_itemHeight').text();
73
-
74
-
75
- if(qty){
76
- items.push({
77
- "itemDescription":$igc.trim(descTxt),
78
- "itemQuantity":$igc.trim(qty),
79
- "itemUnitPrice": $igc.trim(price),
80
- "itemURL": itemURL,
81
- "itemImageURL": imgURL,
82
- "itemSku": sku,
83
- "itemProductId": pid,
84
- "itemWeight": weight,
85
- "itemLength": length,
86
- "itemWidth": width,
87
- "itemHeight": height
88
- });
89
- }
90
- });
91
- return items;
92
- }
93
-
94
- var oldButton = "";
95
- var oldOnClick = "";
96
-
97
- function ig_recordOnClick () {
98
- //record click actions
99
- oldButton = $igc(':button[title="Proceed to Checkout"]'); //this is the jQuery selector for your checkout button
100
- oldOnClick = oldButton.attr('onclick'); //this is the attribute or click function that moves from the cart to checkout. defining this lets us move international customers to your iGlobal hosted checkout automatically.
101
- //console.log(oldOnClick);
102
- }
103
-
104
- //domestic configuration
105
-
106
- function ig_domesticActions () {
107
- $igc(oldButton).off(); // remove event handler if it was added by ig_internationalActions()
108
- //replace old onclick attr
109
- $igc(oldButton).attr('onclick',oldOnClick);
110
-
111
- //hide the shipping estimate and discount codes for int'l visitors
112
- $igc(".shipping").show();
113
- $igc(".discount").show();
114
- $igc('a[title="Checkout with Multiple Addresses"]').show();
115
- }
116
-
117
-
118
- //international configuration
119
-
120
- function ig_internationalActions () {
121
-
122
- //take over button
123
- $igc(oldButton).attr('onclick','');
124
- $igc(oldButton).click(function(){
125
- igcCheckout();
126
- });
127
- //hide the shipping estimate and discount codes for int'l visitors
128
- $igc(".shipping").hide();
129
- $igc(".discount").hide();
130
- $igc('a[title="Checkout with Multiple Addresses"]').hide();
131
-
132
- }
133
-
134
- //for when the country is changed
135
- function ig_ice_countryChanged() {
136
-
137
- if (window.location.href.indexOf("cart") != -1) {
138
-
139
- if ( !ig_isDomesticCountry() ){
140
-
141
- ig_internationalActions ();
142
-
143
- } else {
144
-
145
- ig_domesticActions ();
146
-
147
- }
148
- }
149
-
150
- if ((window.location.href.indexOf("checkout") != -1) && (window.location.href.indexOf("cart") == -1)) {
151
-
152
- if ( !ig_isDomesticCountry() ){
153
-
154
- alert('You are using the domestic checkout for an international order. Please return to your cart and checkout again.');
155
- window.location.replace(igCartUrl);
156
-
157
- }
158
- }
159
- }
160
-
161
-
162
- $igc(document).ready(function(){
163
-
164
-
165
- if ((window.location.href.indexOf("checkout") != -1) && (window.location.href.indexOf("cart") == -1)) {
166
-
167
- if ( !ig_isDomesticCountry() ){
168
-
169
- alert('You are using the domestic checkout for an international order. Please return to your cart and checkout again.');
170
- //window.location.replace(igCartUrl);
171
-
172
- }
173
- }
174
-
175
- //button logic
176
- if(!$igc("#welcome_mat_deactivated").length){ //welcome mat active, take button or set country
177
- if(ig_country){
178
-
179
- ig_recordOnClick();
180
-
181
- if(!ig_isDomesticCountry()){
182
-
183
- ig_internationalActions ();
184
-
185
- }
186
- } else {
187
- alert("Please select your country from the list, and click the Checkout button again.");
188
- ig_showTheSplash();
189
- return false;
190
- }
191
-
192
- } else {
193
- //add additional button b/c no welcome mat
194
- var igButton = $igc('<br /><img>').attr("src","https://checkout.iglobalstores.com/images/iglobal-button2.png").attr("class","igButton").css({cursor:"pointer"});
195
-
196
- $igc(".totals .checkout-types").append($igc("<li>").append(igButton));
197
-
198
- $igc(igButton).click(function() {
199
- igcCheckout();
200
- });
201
-
202
- }
203
- });
1
+ $igc = jQuery;
2
+
3
+ // These are the Key variables used in customizing this script.
4
+ // By changing these, many Magento themes will operate correctly with iGlobal technology.
5
+ // Some themes require further customization by defining the item details below.
6
+ var ig_storeId = ig_vars.storeId || 3;
7
+ var igSubdomain = ig_vars.subdomain || "checkout";
8
+ var igCartUrl = ig_vars.cartUrl || "/checkout/cart";
9
+
10
+ function igcCheckout() {
11
+
12
+ igcGoToCheckout(igStoreId);
13
+ }
14
+
15
+ function getSelectedCountry() {
16
+ return ig_country;
17
+ }
18
+
19
+ function getSubDomain() {
20
+ return igSubdomain;
21
+ }
22
+
23
+ function igcGetItems() {
24
+
25
+ var items = new Array();
26
+ var itemRows = $igc(".igItemDetails");//products rows
27
+
28
+ $igc(itemRows).each(function () {
29
+ var qty = $igc(this).find('.igQty').text();
30
+ var price = $igc(this).find('.igPrice').text();
31
+ var imgURL = $igc(this).find('.igImage').text();
32
+ var itemURL = $igc(this).find('.igUrl').text();
33
+ var descTxt = '<span class="itemDescription">' + $igc(this).find('.igName').text() + '</span>';// + $igc(this).find('.igItemOptions').html();
34
+ var sku = $igc(this).find('.igSku').text();
35
+ var pid = $igc(this).find('.igID').text();
36
+ if ($igc(this).find('.ig_itemWeight').text()) {
37
+ var weight = $igc(this).find('.ig_itemWeight').text();
38
+ } else {
39
+ var weight = $igc(this).find('.MageWeight').text();
40
+ }
41
+ var weight = $igc(this).find('.ig_itemWeight').text();
42
+ var length = $igc(this).find('.ig_itemLength').text();
43
+ var width = $igc(this).find('.ig_itemWidth').text();
44
+ var height = $igc(this).find('.ig_itemHeight').text();
45
+
46
+
47
+ if (qty) {
48
+ items.push({
49
+ "itemDescription": $igc.trim(descTxt),
50
+ "itemQuantity": $igc.trim(qty),
51
+ "itemUnitPrice": $igc.trim(price),
52
+ "itemURL": itemURL,
53
+ "itemImageURL": imgURL,
54
+ "itemSku": sku,
55
+ "itemProductId": pid,
56
+ "itemWeight": weight,
57
+ "itemLength": length,
58
+ "itemWidth": width,
59
+ "itemHeight": height
60
+ });
61
+ }
62
+ });
63
+ return items;
64
+ }
65
+
66
+ function ig_domesticActions() {
67
+ //show the shipping estimate for domestic visitors
68
+ $igc(".shipping").show();
69
+ $igc('a[title="Checkout with Multiple Addresses"]').show();
70
+ }
71
+
72
+
73
+ function ig_internationalActions() {
74
+ //hide the shipping estimate for int'l visitors
75
+ $igc(".shipping").hide();
76
+ $igc('a[title="Checkout with Multiple Addresses"]').hide();
77
+ }
78
+
79
+ //for when the country is changed
80
+ function ig_ice_countryChanged() {
81
+ if (window.location.href.indexOf("cart") != -1) {
82
+ if (!ig_isDomesticCountry()) {
83
+ ig_internationalActions();
84
+ } else {
85
+ ig_domesticActions();
86
+ }
87
+ }
88
+ }
89
+
90
+
91
+ $igc(document).ready(function () {
92
+ //button logic
93
+ if (!$igc("#welcome_mat_deactivated").length) { //welcome mat active, take button or set country
94
+ if (ig_country) {
95
+ ig_recordOnClick();
96
+ if (!ig_isDomesticCountry()) {
97
+ ig_internationalActions();
98
+ }
99
+ }
100
+ } else {
101
+ //add additional button b/c no welcome mat
102
+ var igButton = $igc('<br /><img>').attr("src", "https://checkout.iglobalstores.com/images/iglobal-button2.png").attr("class", "igButton").css({cursor: "pointer"});
103
+ $igc(".totals .checkout-types").append($igc("<li>").append(igButton));
104
+ $igc(igButton).click(function () {
105
+ igcCheckout();
106
+ });
107
+ }
108
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
package.xml CHANGED
@@ -1,14 +1,12 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Iglobal_Main</name>
4
- <version>1.3.1</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>-Code improved for faster loading&#xD;
10
- -Improved Logging&#xD;
11
- -Improved Tax Integration</summary>
12
  <description>International eCommerce Done Right&#xD;
13
  Thanks for checking out the iGlobal Stores extension for Magento Community Edition! This extension gives you access to the many features of iGlobal Stores services. For more information on this extension and iGlobal's services, please visit http://www.iglobalstores.com/magento&#xD;
14
  &#xD;
@@ -30,18 +28,18 @@ Your Payment Processor or Ours - Use your own payment processor or leverage the
30
  Before You Install&#xD;
31
  The iGlobal Stores extension will have limited use for stores that are not set up with an iGlobal Stores account. In order to accept orders internationally through iGlobal Stores, please contact us at 1-800-942-0721, at www.iglobalstores.com or at info@iglobalstores.com.</description>
32
  <notes>New Features:&#xD;
33
- Send applied discounts to checkout&#xD;
34
- Include product options in the description&#xD;
35
- Update order status from iGlobal Stores&#xD;
 
36
  &#xD;
37
  Improvements:&#xD;
38
- the order number is passed back as a reference to iglobal&#xD;
39
- Check for updated status from iGlobal Stores&#xD;
40
- </notes>
41
  <authors><author><name>Matt Flamm</name><user>mattflamm</user><email>matt@iglobalstores.com</email></author><author><name>Brian Olsen</name><user>brianolsen</user><email>brian@iglobalstores.com</email></author></authors>
42
- <date>2015-10-21</date>
43
- <time>16:33:02</time>
44
- <contents><target name="mageetc"><dir name="modules"><file name="Iglobal_Stores.xml" hash="56839ad045b6a99f97564de63ebed700"/><file name="Iglobal_Ship.xml" hash="6d40f1c84e29bb7d8b70eadd77a03917"/></dir></target><target name="magecommunity"><dir name="Iglobal"><dir name="Ship"><dir name="Block"><file name="Ship.php" hash="a802b4d42e72997ec4ab466dec75b743"/></dir><dir name="Helper"><file name="Data.php" hash="fe9f074c1cb74260fa134efa94eb67c9"/></dir><dir name="Model"><dir name="Carrier"><file name="Excellence.php" hash="d1814260e342346b74d7ff3543499d4f"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="3355a75caf30f4ff96499da3d8a4102a"/></dir><dir name="etc"><file name="config.xml" hash="adecbc76332ffb4b0f8918d3166c655c"/><file name="system.xml" hash="fea6b2ed9b7fdf5748cb57e53fe1301b"/></dir></dir><dir name="Stores"><dir name="Block"><file name="Ajax.php" hash="5d288c6bc298db3bdc86adcdd036bdd6"/><file name="Cart.php" hash="a162e67a8c445b911dd25897e4d886a3"/><file name="Includes.php" hash="8214ef5eae6a83e2909f8ebeee6ea1f7"/><file name="Link.php" hash="e3fa83ebece58a1c869ac8aa001536ec"/></dir><dir name="Helper"><file name="Configoptions.php" hash="b129e55b21f845a20d6e7fdb3b532be3"/><file name="Data.php" hash="8ad8a075070c35cebd073456cf2c125c"/><file name="Url.php" hash="89bd9bbc4628dd545c72f19db69a7dd8"/></dir><dir name="Model"><file name="Configoptions.php" hash="56a5c17a3e71079ecf574fd4a0e69011"/><dir name="International"><file name="International.php" hash="6073b26ff3ccb9f58dc8d098b22f1144"/></dir><file name="Observer.php" hash="9b1aaebfc83c9aca25f4d711f10fede5"/><file name="Order.php" hash="b4ae326cb965b646a4b5aa4a0b0f45a9"/><dir name="Payment"><file name="Iglobal.php" hash="9ac8f8d81b8f8d547831ad6db8a1c7fc"/><file name="Iglobalcreditcard.php" hash="f2f5cf4507a128fadc95071951ca2a41"/><file name="Iglobalpaypal.php" hash="3a566289db82b177ce6b52ce205728f6"/></dir><dir name="Resource"><file name="Setup.php" hash="f725924af461644af75a455210097a53"/></dir><file name="Rest.php" hash="0b3fd2a4bffc0a4a5e8aca28ad3fce5f"/><dir name="Sales"><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Fee.php" hash="c28dc3156230c3ad452ebfeede2de244"/></dir></dir></dir></dir><dir name="Service"><file name="Quote.php" hash="bae0e5a710b9e3aa1427bb78a08fbfd8"/></dir></dir><dir name="controllers"><file name="AjaxController.php" hash="3169062e850efd55749ae8033676bf2d"/><file name="CheckoutController.php" hash="d4d981aeb5d04458d669ea1366463f31"/><file name="SuccessController.php" hash="ed6df1368ce185de7bf6c557e55d2339"/></dir><dir name="etc"><file name="adminhtml.xml" hash="7f10c9724b1294a506df47cf569bc9e6"/><file name="config.xml" hash="6e2755e84b3e1fad8ba6ee3b5df75774"/><file name="system.xml" hash="a69d4f11b37f4ea3197978240cbe5eda"/></dir><dir name="sql"><dir name="iglobal_stores_setup"><file name="mysql4-install-0.1.0.php" hash="72c543090fe27608e582d22494b65d75"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="51e83dd266d7b232d42f03cac66350df"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="4dc024ad63d7a7ea20697ddef4b60a29"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="51e83dd266d7b232d42f03cac66350df"/><file name="mysql4-upgrade-0.1.3-1.0.0.php" hash="829b7c08d5bce22b5c1750a3d72e21ca"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="iglobal.xml" hash="6df6f5f0aceab891d0cd13061a3b5e55"/></dir><dir name="template"><dir name="iglobal"><dir name="sales"><dir name="order"><dir name="view"><file name="info.phtml" hash="06280040dd9521efcd36c12779648108"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="iglobal.xml" hash="d49680762997b0480aaaeae331dc4695"/></dir><dir name="template"><dir name="iglobal"><dir name="checkout"><dir name="cart"><dir name="item"><dir name="configure"><file name="updatecart.phtml" hash="9eaac8c650b6986db7c0a5005966c4ee"/></dir></dir></dir><dir name="onepage"><file name="link.phtml" hash="12a68b6580f9441bc0400b72c66b8358"/></dir></dir><dir name="stores"><file name="cart.phtml" hash="6afb67cae6995499ad5d13bbf56b1b0a"/><file name="igcincludes.phtml" hash="43f0bf839553fce75626ee5fa822260d"/></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="iGlobal"><file name="ig_welcome_mat_default.css" hash="f095c20844c8ee158b704be69d4dc2bf"/><file name="ig_welcome_mat_default.js" hash="d9a9d16ced35769cffd27bb2cf2de4db"/><file name="igc.cs.magento_default_ice.js" hash="45fe3cfd5f55e4a96132fa77c034bc33"/><dir><dir name="jquery"><file name="jquery.js" hash="6903c661e9db496b11e737478528318f"/><file name="jquery.noconflict.js" hash="09bfdd3b964eb2b17b5d6caa1d20a607"/></dir></dir></dir></dir></target></contents>
45
  <compatible/>
46
- <dependencies><required><php><min>5.3.0</min><max>7.0.7</max></php></required></dependencies>
47
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Iglobal_Main</name>
4
+ <version>1.4.0</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Leverage iGlobal Stores' technology for international eCommerce</summary>
 
 
10
  <description>International eCommerce Done Right&#xD;
11
  Thanks for checking out the iGlobal Stores extension for Magento Community Edition! This extension gives you access to the many features of iGlobal Stores services. For more information on this extension and iGlobal's services, please visit http://www.iglobalstores.com/magento&#xD;
12
  &#xD;
28
  Before You Install&#xD;
29
  The iGlobal Stores extension will have limited use for stores that are not set up with an iGlobal Stores account. In order to accept orders internationally through iGlobal Stores, please contact us at 1-800-942-0721, at www.iglobalstores.com or at info@iglobalstores.com.</description>
30
  <notes>New Features:&#xD;
31
+ Mobile responsive iframe&#xD;
32
+ Send address info for logged in users to the checkout.&#xD;
33
+ Send product country of manufacture to iGlobal&#xD;
34
+ &#xD;
35
  &#xD;
36
  Improvements:&#xD;
37
+ Removed extra ajax call to fetch config values&#xD;
38
+ Allow disabling iframe while still using the iglobal checkout</notes>
 
39
  <authors><author><name>Matt Flamm</name><user>mattflamm</user><email>matt@iglobalstores.com</email></author><author><name>Brian Olsen</name><user>brianolsen</user><email>brian@iglobalstores.com</email></author></authors>
40
+ <date>2015-12-07</date>
41
+ <time>22:35:46</time>
42
+ <contents><target name="mageetc"><dir name="modules"><file name="Iglobal_Stores.xml" hash="56839ad045b6a99f97564de63ebed700"/><file name="Iglobal_Ship.xml" hash="6d40f1c84e29bb7d8b70eadd77a03917"/></dir></target><target name="magecommunity"><dir name="Iglobal"><dir name="Ship"><dir name="Block"><file name="Ship.php" hash="a802b4d42e72997ec4ab466dec75b743"/></dir><dir name="Helper"><file name="Data.php" hash="fe9f074c1cb74260fa134efa94eb67c9"/></dir><dir name="Model"><dir name="Carrier"><file name="Excellence.php" hash="d1814260e342346b74d7ff3543499d4f"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="3355a75caf30f4ff96499da3d8a4102a"/></dir><dir name="etc"><file name="config.xml" hash="adecbc76332ffb4b0f8918d3166c655c"/><file name="system.xml" hash="fea6b2ed9b7fdf5748cb57e53fe1301b"/></dir></dir><dir name="Stores"><dir name="Block"><file name="Ajax.php" hash="5d288c6bc298db3bdc86adcdd036bdd6"/><file name="Cart.php" hash="a162e67a8c445b911dd25897e4d886a3"/><file name="Includes.php" hash="8214ef5eae6a83e2909f8ebeee6ea1f7"/><file name="Link.php" hash="69b0efcc8d2ffd6ca9daed407260d793"/></dir><dir name="Helper"><file name="Configoptions.php" hash="b129e55b21f845a20d6e7fdb3b532be3"/><file name="Data.php" hash="aa6a697c4382dd36680c592228e57a5d"/><file name="Url.php" hash="e430471ab463e1fc7812c4a96d5f3208"/></dir><dir name="Model"><file name="Configoptions.php" hash="56a5c17a3e71079ecf574fd4a0e69011"/><dir name="International"><file name="International.php" hash="c0d897eafe1fe60f725147c5e8789131"/></dir><file name="Observer.php" hash="9b1aaebfc83c9aca25f4d711f10fede5"/><file name="Order.php" hash="42558f6c350618879c00fdf5583797c2"/><dir name="Payment"><file name="Iglobal.php" hash="9ac8f8d81b8f8d547831ad6db8a1c7fc"/><file name="Iglobalcreditcard.php" hash="f2f5cf4507a128fadc95071951ca2a41"/><file name="Iglobalpaypal.php" hash="3a566289db82b177ce6b52ce205728f6"/></dir><dir name="Resource"><file name="Setup.php" hash="f725924af461644af75a455210097a53"/></dir><file name="Rest.php" hash="0b3fd2a4bffc0a4a5e8aca28ad3fce5f"/><dir name="Service"><file name="Quote.php" hash="bae0e5a710b9e3aa1427bb78a08fbfd8"/></dir><file name="Tax.php" hash="9645d04415913bea333b5aba99b1909c"/></dir><dir name="controllers"><file name="AjaxController.php" hash="62228ca95872788a18256bbf20839a07"/><file name="CheckoutController.php" hash="dc79a1b3d6734051ea0081f272432911"/><file name="SuccessController.php" hash="ed6df1368ce185de7bf6c557e55d2339"/></dir><dir name="etc"><file name="adminhtml.xml" hash="7f10c9724b1294a506df47cf569bc9e6"/><file name="config.xml" hash="4acf4539f3e24e0af387c69832dd651e"/><file name="system.xml" hash="a69d4f11b37f4ea3197978240cbe5eda"/></dir><dir name="sql"><dir name="iglobal_stores_setup"><file name="mysql4-install-0.1.0.php" hash="72c543090fe27608e582d22494b65d75"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="51e83dd266d7b232d42f03cac66350df"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="4dc024ad63d7a7ea20697ddef4b60a29"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="51e83dd266d7b232d42f03cac66350df"/><file name="mysql4-upgrade-0.1.3-1.0.0.php" hash="829b7c08d5bce22b5c1750a3d72e21ca"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="iglobal.xml" hash="6df6f5f0aceab891d0cd13061a3b5e55"/></dir><dir name="template"><dir name="iglobal"><dir name="sales"><dir name="order"><dir name="view"><file name="info.phtml" hash="06280040dd9521efcd36c12779648108"/></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="iglobal.xml" hash="d49680762997b0480aaaeae331dc4695"/></dir><dir name="template"><dir name="iglobal"><dir name="checkout"><dir name="cart"><dir name="item"><dir name="configure"><file name="updatecart.phtml" hash="9eaac8c650b6986db7c0a5005966c4ee"/></dir></dir></dir><dir name="onepage"><file name="link.phtml" hash="12a68b6580f9441bc0400b72c66b8358"/></dir></dir><dir name="stores"><file name="cart.phtml" hash="6afb67cae6995499ad5d13bbf56b1b0a"/><file name="igcincludes.phtml" hash="43752aafba25bc795f9f708c0d470181"/></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="iGlobal"><file name="ig_welcome_mat_default.css" hash="b71a0e407204ad9c8c2158910c3600a7"/><file name="ig_welcome_mat_default.js" hash="3406af1dd7347050f19cd755aae21e62"/><file name="igc.cs.magento_default_ice.js" hash="eb2507a442883dda09975301455877a7"/><dir><dir name="jquery"><file name="jquery.js" hash="6903c661e9db496b11e737478528318f"/><file name="jquery.noconflict.js" hash="09bfdd3b964eb2b17b5d6caa1d20a607"/></dir></dir></dir></dir></target></contents>
43
  <compatible/>
44
+ <dependencies><required><php><min>5.2.0</min><max>7.0.7</max></php></required></dependencies>
45
  </package>