Iglobal_Main - Version 1.0.5

Version Notes

-now significantly happier spending time with tables
-some defaults have changed. A violation of the meaning of default
-a couple minor bug fixes

Download this release

Release Info

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


Code changes from version 1.0.4 to 1.0.5

app/code/community/Iglobal/Stores/controllers/SuccessController.php CHANGED
@@ -12,8 +12,10 @@ class Iglobal_Stores_SuccessController extends Mage_Core_Controller_Front_Action
12
  //Mage::log('in the try', null, 'iglobal.log');
13
 
14
  $quote = Mage::getSingleton('checkout/session')->getQuote()->setStoreId(Mage::app()->getStore()->getId());//if more than one store, then this should be set dynamically
15
-
16
- $orderExists = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchRow("SELECT `entity_id` FROM `sales_flat_order` WHERE `ig_order_number` = '{$_order}'");
 
 
17
 
18
  if(!$_order || $orderExists) header('Location: /');
19
 
@@ -26,7 +28,7 @@ class Iglobal_Stores_SuccessController extends Mage_Core_Controller_Front_Action
26
  $quote->setFeeAmount($data['dutyTaxesTotal']);
27
 
28
  $_name = explode(' ', $data['name'], 2);
29
- if ($data['testOrder'] = true) {
30
  $name_first = "TEST ORDER! DO NOT SHIP! - " . array_shift($_name);
31
  $name_last = array_pop($_name);
32
  } else {
@@ -37,7 +39,7 @@ class Iglobal_Stores_SuccessController extends Mage_Core_Controller_Front_Action
37
  $quote->setCustomerFirstname($name_first);
38
  $quote->setCustomerLastname($name_last);
39
 
40
- $street = $data['address2'] ? implode(' ', array($data['address1'], $data['address2'])) : $data['address1'];
41
 
42
  // to fix error with countries w/o zip codes
43
  if (is_array($data['zip'])){
@@ -53,37 +55,45 @@ class Iglobal_Stores_SuccessController extends Mage_Core_Controller_Front_Action
53
  'city' => $data['city'],
54
  'postcode' => $igcZipCode,
55
  'telephone' => $data['phone'],
 
56
  'country_id' => $data['countryCode'],
 
57
  );
58
 
59
- $_nameBilling = explode(' ', $data['billingName'], 2);
60
- if ($data['testOrder'] = true) {
61
- $name_first_billing = "TEST ORDER! DO NOT SHIP! - " . array_shift($_nameBilling);
62
- $name_last_billing = array_pop($_nameBilling);
63
- } else {
64
- $name_first_billing = array_shift($_nameBilling);
65
- $name_last_billing = array_pop($_nameBilling);
66
- }
67
-
68
-
69
- $streetBilling = $data['billingAddress2'] ? implode(' ', array($data['billingAddress1'], $data['billingAddress2'])) : $data['billingAddress1'];
70
-
71
- // to fix error with countries w/o zip codes
72
- if (is_array($data['billingZip'])){
73
- $igcZipCodeBilling = ' ';
74
- }else {
75
- $igcZipCodeBilling = $data['billingZip'];
76
  }
77
-
78
- $billingAddressData = array(
79
- 'firstname' => $name_first_billing,
80
- 'lastname' => $name_last_billing,
81
- 'street' => $streetBilling,
82
- 'city' => $data['billingCity'],
83
- 'postcode' => $igcZipCodeBilling,
84
- 'telephone' => $data['billingPhone'],
85
- 'country_id' => $data['billingCountryCode'],
86
- );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
 
88
  /*
89
  // code to pull available shipping methods pulls all available shipping methods and makes an array. used if you want to use merchants avaialable methods instead of iglobal custom method.
@@ -274,13 +284,13 @@ class Iglobal_Stores_SuccessController extends Mage_Core_Controller_Front_Action
274
  $order->save();
275
  }
276
 
277
- if ($data['testOrder'] = true) {
278
  //Set the international_order flag and the ig_order_number on the order
279
- $query = $query = "UPDATE `sales_flat_order` SET `international_order` = 1, `ig_order_number` = '{$_order}', `iglobal_test_order` = 1 WHERE `entity_id` = '{$id}'";
280
  Mage::getSingleton('core/resource')->getConnection('core_write')->query($query);
281
  } else {
282
  //Set the international_order flag and the ig_order_number on the order
283
- $query = "UPDATE `sales_flat_order` SET `international_order` = 1, `ig_order_number` = '{$_order}' WHERE `entity_id` = '{$id}'";
284
  Mage::getSingleton('core/resource')->getConnection('core_write')->query($query);
285
  }
286
 
12
  //Mage::log('in the try', null, 'iglobal.log');
13
 
14
  $quote = Mage::getSingleton('checkout/session')->getQuote()->setStoreId(Mage::app()->getStore()->getId());//if more than one store, then this should be set dynamically
15
+ $table = "sales_flat_order";
16
+ $tableName = Mage::getSingleton("core/resource")->getTableName($table);
17
+ $existsQuery = "SELECT `entity_id` FROM `" . $tableName. "` WHERE `ig_order_number` = '{$_order}'";
18
+ $orderExists = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchRow($existsQuery);
19
 
20
  if(!$_order || $orderExists) header('Location: /');
21
 
28
  $quote->setFeeAmount($data['dutyTaxesTotal']);
29
 
30
  $_name = explode(' ', $data['name'], 2);
31
+ if ($data['testOrder'] == "true") {
32
  $name_first = "TEST ORDER! DO NOT SHIP! - " . array_shift($_name);
33
  $name_last = array_pop($_name);
34
  } else {
39
  $quote->setCustomerFirstname($name_first);
40
  $quote->setCustomerLastname($name_last);
41
 
42
+ $street = $data['address2'] ? array($data['address1'], $data['address2']) : $data['address1'];
43
 
44
  // to fix error with countries w/o zip codes
45
  if (is_array($data['zip'])){
55
  'city' => $data['city'],
56
  'postcode' => $igcZipCode,
57
  'telephone' => $data['phone'],
58
+ 'region' => $data['state'],
59
  'country_id' => $data['countryCode'],
60
+ 'company' => $data['company'],
61
  );
62
 
63
+ $billingCheckVar = $data['billingAddress1'];
64
+ if (!empty($billingCheckVar)){
65
+ $_nameBilling = explode(' ', $data['billingName'], 2);
66
+ if ($data['testOrder'] == "true") {
67
+ $name_first_billing = "TEST ORDER! DO NOT SHIP! - " . array_shift($_nameBilling);
68
+ $name_last_billing = array_pop($_nameBilling);
69
+ } else {
70
+ $name_first_billing = array_shift($_nameBilling);
71
+ $name_last_billing = array_pop($_nameBilling);
 
 
 
 
 
 
 
 
72
  }
73
+
74
+
75
+ $streetBilling = $data['billingAddress2'] ? array($data['billingAddress1'], $data['billingAddress2']) : $data['billingAddress1'];
76
+
77
+ // to fix error with countries w/o zip codes
78
+ if (is_array($data['billingZip'])){
79
+ $igcZipCodeBilling = ' ';
80
+ }else {
81
+ $igcZipCodeBilling = $data['billingZip'];
82
+ }
83
+
84
+ $billingAddressData = array(
85
+ 'firstname' => $name_first_billing,
86
+ 'lastname' => $name_last_billing,
87
+ 'street' => $streetBilling,
88
+ 'city' => $data['billingCity'],
89
+ 'postcode' => $igcZipCodeBilling,
90
+ 'telephone' => $data['billingPhone'],
91
+ 'region' => $data['billingState'],
92
+ 'country_id' => $data['billingCountryCode'],
93
+ );
94
+ } else {
95
+ $billingAddressData = $addressData;
96
+ }
97
 
98
  /*
99
  // code to pull available shipping methods pulls all available shipping methods and makes an array. used if you want to use merchants avaialable methods instead of iglobal custom method.
284
  $order->save();
285
  }
286
 
287
+ if ($data['testOrder'] == 'true') {
288
  //Set the international_order flag and the ig_order_number on the order
289
+ $query = "UPDATE `" . $tableName . "` SET `international_order` = 1, `ig_order_number` = '{$_order}', `iglobal_test_order` = 1 WHERE `entity_id` = '{$id}'";
290
  Mage::getSingleton('core/resource')->getConnection('core_write')->query($query);
291
  } else {
292
  //Set the international_order flag and the ig_order_number on the order
293
+ $query = "UPDATE `" . $tableName . "` SET `international_order` = 1, `ig_order_number` = '{$_order}' WHERE `entity_id` = '{$id}'";
294
  Mage::getSingleton('core/resource')->getConnection('core_write')->query($query);
295
  }
296
 
app/code/community/Iglobal/Stores/controllers/TestController.php CHANGED
@@ -10,11 +10,85 @@ class Iglobal_Stores_TestController extends Mage_Core_Controller_Front_Action
10
  echo "in the controller <br/>";
11
 
12
 
13
- $cart = Mage::getModel('checkout/cart')->getQuote()->getAllItems();
14
- Zend_Debug::dump($cart);
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
 
 
 
18
  /*
19
  // Load the session
20
  $session = Mage::getModel('checkout/cart');
10
  echo "in the controller <br/>";
11
 
12
 
13
+ $_order = '902-107604'; // has different addresses
14
+ //$_order = '902-107620'; // has same addresses
15
 
16
+ $rest = Mage::getModel('stores/rest_order');
17
+ $data = $rest->getOrder($_order);
18
+
19
+
20
+ $_name = explode(' ', $data['name'], 2);
21
+ if ($data['testOrder'] == "true") {
22
+ $name_first = "TEST ORDER! DO NOT SHIP! - " . array_shift($_name);
23
+ $name_last = array_pop($_name);
24
+ } else {
25
+ $name_first = array_shift($_name);
26
+ $name_last = array_pop($_name);
27
+ }
28
+
29
+ $street = $data['address2'] ? array($data['address1'], $data['address2']) : $data['address1'];
30
+
31
+ // to fix error with countries w/o zip codes
32
+ if (is_array($data['zip'])){
33
+ $igcZipCode = ' ';
34
+ }else {
35
+ $igcZipCode = $data['zip'];
36
+ }
37
+
38
+ $addressData = array(
39
+ 'firstname' => $name_first,
40
+ 'lastname' => $name_last,
41
+ 'street' => $street,
42
+ 'city' => $data['city'],
43
+ 'postcode' => $igcZipCode,
44
+ 'telephone' => $data['phone'],
45
+ 'region' => $data['state'],
46
+ //'region' => 'utah',
47
+ //'region_id' => 'ut',
48
+ 'country_id' => $data['countryCode'],
49
+ 'company' => $data['company'],
50
+ );
51
+
52
+ $billingCheckVar = $data['billingAddress1'];
53
+ if (!empty($billingCheckVar)){
54
+ $_nameBilling = explode(' ', $data['billingName'], 2);
55
+ if ($data['testOrder'] == "true") {
56
+ $name_first_billing = "TEST ORDER! DO NOT SHIP! - " . array_shift($_nameBilling);
57
+ $name_last_billing = array_pop($_nameBilling);
58
+ } else {
59
+ $name_first_billing = array_shift($_nameBilling);
60
+ $name_last_billing = array_pop($_nameBilling);
61
+ }
62
+
63
+
64
+ $streetBilling = $data['billingAddress2'] ? array($data['billingAddress1'], $data['billingAddress2']) : $data['billingAddress1'];
65
+
66
+ // to fix error with countries w/o zip codes
67
+ if (is_array($data['billingZip'])){
68
+ $igcZipCodeBilling = ' ';
69
+ }else {
70
+ $igcZipCodeBilling = $data['billingZip'];
71
+ }
72
+
73
+ $billingAddressData = array(
74
+ 'firstname' => $name_first_billing,
75
+ 'lastname' => $name_last_billing,
76
+ 'street' => $streetBilling,
77
+ 'city' => $data['billingCity'],
78
+ 'postcode' => $igcZipCodeBilling,
79
+ 'telephone' => $data['billingPhone'],
80
+ 'region' => $data['billingState'],
81
+ 'country_id' => $data['billingCountryCode'],
82
+ );
83
+ } else {
84
+ $billingAddressData = $addressData;
85
+ }
86
+ echo "Address Data: <br />";
87
+ Zend_Debug::dump($addressData);
88
 
89
 
90
+ echo "Billing Address Data: <br />";
91
+ Zend_Debug::dump($billingAddressData);
92
  /*
93
  // Load the session
94
  $session = Mage::getModel('checkout/cart');
app/code/community/Iglobal/Stores/controllers/magento cart.phtml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <NotepadPlus>
2
+ <Session activeView="0">
3
+ <mainView activeIndex="14">
4
+ <File firstVisibleLine="63" xOffset="0" scrollWidth="1432" startPos="1816" endPos="1816" selMode="0" lang="PHP" encoding="-1" filename="C:\magentostack6\apps\magento\htdocs\app\design\frontend\base\default\template\iglobal\stores\cart.phtml" />
5
+ <File firstVisibleLine="0" xOffset="0" scrollWidth="956" startPos="0" endPos="0" selMode="0" lang="PHP" encoding="-1" filename="C:\Users\mattf_000\Desktop\cart2.phtml" />
6
+ <File firstVisibleLine="0" xOffset="6" scrollWidth="981" startPos="302" endPos="407" selMode="0" lang="PHP" encoding="-1" filename="C:\Users\mattf_000\Desktop\cart7.phtml" />
7
+ <File firstVisibleLine="0" xOffset="55" scrollWidth="956" startPos="302" endPos="302" selMode="0" lang="PHP" encoding="-1" filename="C:\Users\mattf_000\Desktop\cart4.phtml" />
8
+ <File firstVisibleLine="39" xOffset="0" scrollWidth="1482" startPos="2046" endPos="2046" selMode="0" lang="Javascript" encoding="-1" filename="C:\magentostack6\apps\magento\htdocs\js\iGlobal\igc.cs.magento_default_ice.js" />
9
+ <File firstVisibleLine="21" xOffset="0" scrollWidth="25095" startPos="4516" endPos="4516" selMode="0" lang="Javascript" encoding="-1" filename="C:\magentostack6\apps\magento\htdocs\js\iGlobal\ig_welcome_mat_default.js" />
10
+ <File firstVisibleLine="0" xOffset="0" scrollWidth="270" startPos="119" endPos="119" selMode="0" lang="XML" encoding="-1" filename="C:\magentostack6\apps\magento\htdocs\app\code\community\Iglobal\Stores\etc\config.xml" />
11
+ <File firstVisibleLine="0" xOffset="0" scrollWidth="180" startPos="0" endPos="0" selMode="0" lang="PHP" encoding="-1" filename="C:\Users\mattf_000\Downloads\extension\extension\app\design\frontend\base\default\template\zxyxz_store\cart.phtml" />
12
+ <File firstVisibleLine="6" xOffset="0" scrollWidth="556" startPos="1322" endPos="1262" selMode="0" lang="PHP" encoding="-1" filename="C:\Users\mattf_000\Downloads\extension\extension\app\code\community\Zxyxz\Store\Block\Cart.php" />
13
+ <File firstVisibleLine="112" xOffset="0" scrollWidth="209551" startPos="97767" endPos="97767" selMode="0" lang="Javascript" encoding="-1" filename="C:\nginx\html\igc.cs.shoolu.js" />
14
+ <File firstVisibleLine="41" xOffset="0" scrollWidth="1631" startPos="3491" endPos="1794" selMode="0" lang="Javascript" encoding="-1" filename="C:\nginx\html\igc.cs.gourmetnew.js" />
15
+ <File firstVisibleLine="0" xOffset="0" scrollWidth="979" startPos="0" endPos="0" selMode="0" lang="PHP" encoding="-1" filename="C:\magentostack6\apps\magento\htdocs\app\code\community\Iglobal\Stores\sql\iglobal_stores_setup\mysql4-install-0.1.0.php" />
16
+ <File firstVisibleLine="0" xOffset="0" scrollWidth="253" startPos="0" endPos="0" selMode="0" lang="PHP" encoding="-1" filename="C:\magentostack6\apps\magento\htdocs\app\code\community\Iglobal\Stores\sql\iglobal_stores_setup\mysql4-upgrade-0.1.0-0.1.1.php" />
17
+ <File firstVisibleLine="0" xOffset="0" scrollWidth="724" startPos="0" endPos="0" selMode="0" lang="PHP" encoding="-1" filename="C:\magentostack6\apps\magento\htdocs\app\code\community\Iglobal\Stores\sql\iglobal_stores_setup\mysql4-upgrade-0.1.1-0.1.2.php" />
18
+ <File firstVisibleLine="0" xOffset="0" scrollWidth="1225" startPos="0" endPos="0" selMode="0" lang="PHP" encoding="-1" filename="C:\magentostack6\apps\magento\htdocs\app\code\community\Iglobal\Stores\controllers\SuccessController.php" />
19
+ </mainView>
20
+ <subView activeIndex="0" />
21
+ </Session>
22
+ </NotepadPlus>
app/code/community/Iglobal/Stores/etc/config.xml CHANGED
@@ -4,7 +4,7 @@
4
  <config>
5
  <modules>
6
  <Iglobal_Stores>
7
- <version>1.0.4</version>
8
  <currencies>
9
  <AED></AED>
10
  <ARS>&amp;#8371;</ARS>
4
  <config>
5
  <modules>
6
  <Iglobal_Stores>
7
+ <version>1.0.5</version>
8
  <currencies>
9
  <AED></AED>
10
  <ARS>&amp;#8371;</ARS>
app/design/frontend/base/default/template/iglobal/stores/cart.phtml CHANGED
@@ -58,6 +58,8 @@
58
  echo '<span class="igDescription">'. Mage::getModel('catalog/product')->load($item->getProductId())->getDescription().'</span>';
59
 
60
  echo '<span class="igShortDescription">'. Mage::getModel('catalog/product')->load($item->getProductId())->getShortDescription().'</span>';
 
 
61
 
62
 
63
 
58
  echo '<span class="igDescription">'. Mage::getModel('catalog/product')->load($item->getProductId())->getDescription().'</span>';
59
 
60
  echo '<span class="igShortDescription">'. Mage::getModel('catalog/product')->load($item->getProductId())->getShortDescription().'</span>';
61
+
62
+ echo '<span class="MageWeight">'.$item->getWeight().'</span>';
63
 
64
 
65
 
js/iGlobal/igc.cs.magento_default_ice.js CHANGED
@@ -8,6 +8,7 @@ $igc =jQuery
8
  var igCartUrl = "/magento/index.php/checkout/cart";
9
  var ajaxPath = window.location.href.replace(window.location.origin, '')
10
  ajaxPath = '/iglobal/ajax/icedata'; //parses the uri to figure out how to get to the right controller
 
11
  //ajaxPath = ajaxPath.substring(0, ajaxPath.indexOf("index.php")+9) + '/iglobal/ajax/icedata'; //parses the url to figure out how to get to the right controller
12
 
13
 
@@ -64,6 +65,11 @@ function igcGetItems() {
64
  var descTxt = '<span class="itemDescription">' + $igc(this).find('.igName').text() + '</span>';// + $igc(this).find('.igItemOptions').html();
65
  var sku = $igc(this).find('.igSku').text();
66
  var pid =$igc(this).find('.igID').text();
 
 
 
 
 
67
  var weight = $igc(this).find('.ig_itemWeight').text();
68
  var length = $igc(this).find('.ig_itemLength').text();
69
  var width = $igc(this).find('.ig_itemWidth').text();
8
  var igCartUrl = "/magento/index.php/checkout/cart";
9
  var ajaxPath = window.location.href.replace(window.location.origin, '')
10
  ajaxPath = '/iglobal/ajax/icedata'; //parses the uri to figure out how to get to the right controller
11
+ ajaxPath = '/magento/index.php/iglobal/ajax/icedata'; //just here to make it easy for me to override the default path while debugging. comment this out on a live site
12
  //ajaxPath = ajaxPath.substring(0, ajaxPath.indexOf("index.php")+9) + '/iglobal/ajax/icedata'; //parses the url to figure out how to get to the right controller
13
 
14
 
65
  var descTxt = '<span class="itemDescription">' + $igc(this).find('.igName').text() + '</span>';// + $igc(this).find('.igItemOptions').html();
66
  var sku = $igc(this).find('.igSku').text();
67
  var pid =$igc(this).find('.igID').text();
68
+ if ($igc(this).find('.ig_itemWeight').text()){
69
+ var weight = $igc(this).find('.ig_itemWeight').text();
70
+ } else {
71
+ var weight = $igc(this).find('.MageWeight').text();
72
+ }
73
  var weight = $igc(this).find('.ig_itemWeight').text();
74
  var length = $igc(this).find('.ig_itemLength').text();
75
  var width = $igc(this).find('.ig_itemWidth').text();
js/iGlobal/igc.cs.matts_test_ice.js ADDED
@@ -0,0 +1,205 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 = "/magento/index.php/checkout/cart";
9
+ var ajaxPath = window.location.href.replace(window.location.origin, '')
10
+ ajaxPath = '/index.php/iglobal/ajax/icedata'; //parses the uri to figure out how to get to the right controller
11
+ //ajaxPath = ajaxPath.substring(0, ajaxPath.indexOf("index.php")+9) + '/iglobal/ajax/icedata'; //parses the url to figure out how to get to the right controller
12
+
13
+
14
+ $igc.post (
15
+ ajaxPath,
16
+ //'/magento/iglobal/ajax/icedata',
17
+ function(data){
18
+
19
+ //console.log(data);
20
+ var result = eval("(" + data + ")");
21
+
22
+ if (result.storeId){
23
+ // store ID is set
24
+ igStoreId = result.storeId;
25
+ }
26
+
27
+ if (result.subdomain){
28
+ // subdomain is set
29
+ igSubdomain = result.subdomain;
30
+ }
31
+
32
+ if (result.cartUrl){
33
+ // subdomain is set
34
+ igCartUrl = result.cartUrl;
35
+ }
36
+
37
+ }
38
+ );
39
+ //}
40
+
41
+ function igcCheckout() {
42
+ //TODO: reset to store 3
43
+ igcGoToCheckout(igStoreId);
44
+ }
45
+
46
+ function getSelectedCountry() {
47
+ return ig_country;
48
+ }
49
+
50
+ function getSubDomain() {
51
+ return igSubdomain;
52
+ }
53
+
54
+ function igcGetItems() {
55
+
56
+ var items = new Array();
57
+ var itemRows = $igc(".igItemDetails");//products rows
58
+
59
+ $igc(itemRows).each(function() {
60
+ var qty = $igc(this).find('.igQty').text();
61
+ var price = $igc(this).find('.igPrice').text();
62
+ var imgURL = $igc(this).find('.igImage').text();
63
+ var itemURL = $igc(this).find('.igUrl').text();
64
+ var descTxt = '<span class="itemDescription">' + $igc(this).find('.igName').text() + '</span>';// + $igc(this).find('.igItemOptions').html();
65
+ var sku = $igc(this).find('.igSku').text();
66
+ var pid =$igc(this).find('.igID').text();
67
+ var weight = $igc(this).find('.ig_itemWeight').text();
68
+ var length = $igc(this).find('.ig_itemLength').text();
69
+ var width = $igc(this).find('.ig_itemWidth').text();
70
+ var height = $igc(this).find('.ig_itemHeight').text();
71
+
72
+
73
+ if(qty){
74
+ items.push({
75
+ "itemDescription":$igc.trim(descTxt),
76
+ "itemQuantity":$igc.trim(qty),
77
+ "itemUnitPrice": $igc.trim(price),
78
+ "itemURL": itemURL,
79
+ "itemImageURL": imgURL,
80
+ "itemSku": sku,
81
+ "itemProductId": pid,
82
+ "itemWeight": weight,
83
+ "itemLength": length,
84
+ "itemWidth": width,
85
+ "itemHeight": height
86
+ });
87
+ }
88
+ });
89
+ return items;
90
+ }
91
+
92
+ var oldButton = "";
93
+ var oldOnClick = "";
94
+
95
+ function ig_recordOnClick () {
96
+ //record click actions
97
+ oldButton = $igc(':button[title="Proceed to Checkout"]'); //this is the jQuery selector for your checkout button
98
+ 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.
99
+ //console.log(oldOnClick);
100
+ }
101
+
102
+ //domestic configuration
103
+
104
+ function ig_domesticActions () {
105
+ $igc(oldButton).off(); // remove event handler if it was added by ig_internationalActions()
106
+ //replace old onclick attr
107
+ $igc(oldButton).attr('onclick',oldOnClick);
108
+
109
+ //hide the shipping estimate and discount codes for int'l visitors
110
+ $igc(".shipping").show();
111
+ $igc(".discount").show();
112
+ }
113
+
114
+
115
+ //international configuration
116
+
117
+ function ig_internationalActions () {
118
+
119
+ //take over button
120
+ $igc(oldButton).attr('onclick','');
121
+ $igc(oldButton).click(function(){
122
+ igcCheckout();
123
+ });
124
+ //hide the shipping estimate and discount codes for int'l visitors
125
+ $igc(".shipping").hide();
126
+ $igc(".discount").hide();
127
+
128
+ }
129
+
130
+ //for when the country is changed
131
+ function ig_ice_countryChanged() {
132
+
133
+ if (window.location.href.indexOf("cart") != -1) {
134
+
135
+ if ( !ig_isDomesticCountry() ){
136
+
137
+ ig_internationalActions ();
138
+
139
+ } else {
140
+
141
+ ig_domesticActions ();
142
+
143
+ }
144
+ }
145
+
146
+ if ((window.location.href.indexOf("checkout") != -1) && (window.location.href.indexOf("cart") == -1)) {
147
+
148
+ if ( !ig_isDomesticCountry() ){
149
+
150
+ alert('You are using the domestic checkout for an international order. Please return to your cart and checkout again.');
151
+ window.location.replace(igCartUrl);
152
+
153
+ }
154
+ }
155
+ }
156
+
157
+
158
+ $igc(document).ready(function(){
159
+
160
+
161
+ if ((window.location.href.indexOf("checkout") != -1) && (window.location.href.indexOf("cart") == -1)) {
162
+
163
+ if ( !ig_isDomesticCountry() ){
164
+
165
+ alert('You are using the domestic checkout for an international order. Please return to your cart and checkout again.');
166
+ window.location.replace(igCartUrl);
167
+
168
+ }
169
+ }
170
+
171
+ //button logic
172
+ if(!$igc("#welcome_mat_deactivated").length){ //welcome mat active, take button or set country
173
+ if(ig_country){
174
+
175
+ ig_recordOnClick();
176
+
177
+ if(!ig_isDomesticCountry()){
178
+
179
+
180
+ //hide the shipping estimate and discount codes for int'l visitors
181
+ //$igc(".shipping").hide();
182
+ //$igc(".discount").hide();
183
+
184
+
185
+ ig_internationalActions ();
186
+
187
+ }
188
+ } else {
189
+ alert("Please select your country from the list, and click the Checkout button again.");
190
+ ig_showTheSplash();
191
+ return false;
192
+ }
193
+
194
+ } else {
195
+ //add additional button b/c no welcome mat
196
+ var igButton = $igc('<br /><img>').attr("src","https://checkout.iglobalstores.com/images/iglobal-button2.png").attr("class","igButton").css({cursor:"pointer"});
197
+
198
+ $igc(".totals .checkout-types").append($igc("<li>").append(igButton));
199
+
200
+ $igc(igButton).click(function() {
201
+ igcCheckout();
202
+ });
203
+
204
+ }
205
+ });
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Iglobal_Main</name>
4
- <version>1.0.4</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
@@ -55,11 +55,13 @@ Installation Instructions&#xD;
55
  &lt;li&gt;&lt;strong&gt;iGlobal Dimension Units&lt;/strong&gt; &#x2013; Unit of measure for the iGlobal Dimensional attributes. (CM / IN)&lt;/li&gt;&#xD;
56
  &lt;/ul&gt;&#xD;
57
  &lt;/ol&gt;</description>
58
- <notes>a few bug fixes</notes>
 
 
59
  <authors><author><name>Matt Flamm</name><user>mattflamm</user><email>matt@iglobalstores.com</email></author><author><name>Judd Flamm</name><user>UnkUser1</user><email>judd@iglobalstores.com</email></author><author><name>Dustin Dwyer</name><user>UnkUser2</user><email>dustin@iglobalstores.com</email></author><author><name>Dave Meads</name><user>unkuser3</user><email>dave@iglobalstores.com</email></author></authors>
60
- <date>2014-08-22</date>
61
- <time>04:35:29</time>
62
- <contents><target name="magecommunity"><dir name="Iglobal"><dir name="Fee"><dir name="Block"><dir name="Sales"><dir name="Order"><file name="Total.php" hash="0e9e1537fd6cedc9a2b4a3efdf3f769d"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="406a814f1216d736e8661a32c833a15e"/></dir><dir name="Model"><file name="Fee.php" hash="29729703293e6fa5af6527708d67d97f"/><file name="Observer.php" hash="a9ec09a49108625f592f8ef00bcba842"/><dir name="Sales"><dir name="Order"><dir name="Total"><dir name="Creditmemo"><file name="Fee.php" hash="048c8a97de6d884d3b95e0345c1cb75a"/></dir><dir name="Invoice"><file name="Fee.php" hash="fc98218c9a421b95af9f5f0ca062e1d8"/></dir></dir></dir><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Fee.php" hash="bc925a41535068fb0a94c57183dd2027"/></dir></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="4cf60a3913d56196b169dd2dffa85e12"/></dir><dir name="sql"><dir name="fee_setup"><file name="mysql4-install-0.1.0.php" hash="8327866f66c8bff7fcbb0305385a6f93"/></dir></dir></dir><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="1cf0b2e1716d3f726f4e974f02267b53"/></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="7b71e2bc9b801138f77f5927e7a6f6ba"/><file name="Cart.php" hash="2fd47fa1ca047bbc75383c2e35dd4bf2"/><file name="Includes.php" hash="7c36803ae1a6193f7805d7ae5bef17e6"/></dir><dir name="Helper"><file name="Configoptions.php" hash="b129e55b21f845a20d6e7fdb3b532be3"/><file name="Data.php" hash="2d77637b08ac8e7dcb717d8e1571739a"/></dir><dir name="Model"><file name="Configoptions.php" hash="6da281d601b7a6ce98ebc81b398d6e54"/><file name="Observer.php" hash="24ba19336cd0fb51700069ae3d80e471"/><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="6b05cac95a1d36deeb7e9c9bd439ad8c"/></dir><dir name="Rest"><file name="Order.php" hash="916a67634abdf48666119854a1628ac3"/></dir><dir name="Service"><file name="Quote.php" hash="bae0e5a710b9e3aa1427bb78a08fbfd8"/></dir></dir><dir name="controllers"><file name="AjaxController.php" hash="3169062e850efd55749ae8033676bf2d"/><file name="SuccessController.php" hash="38d0b1715a5b8aa30ab2cbfbee5d65d7"/><file name="TestController.php" hash="4d14668de657eaa3f32a200e35b43a37"/><file name="UpdateShippingStatusController.php" hash="77534f8cbc68f23ab3377ff1427b9300"/></dir><dir name="etc"><file name="adminhtml.xml" hash="a94aa66e4f3643fcc49fb60650fef416"/><file name="config.xml" hash="d224067eb392ad4f0990f9ca5f2cb1c0"/><file name="system.xml" hash="40420c6652da8b38d181fdf57ab15720"/></dir><dir name="sql"><dir name="iglobal_stores_setup"><file name="mysql4-install-0.1.0.php" hash="8f8d6e6596d0ad98d70075f79f320cfd"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="1e8d0cc9906c303b99042290636faef9"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="d710311110eebfc65573d178e8cf5aba"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="1e8d0cc9906c303b99042290636faef9"/><file name="mysql4-upgrade-0.1.3-1.0.0.php" hash="ef0079b0f3b1c09b7417ff86df00ad9e"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Iglobal_Fee.xml" hash="205714b75c3b417343a6b25ecedf35c4"/><file name="Iglobal_Ship.xml" hash="6d40f1c84e29bb7d8b70eadd77a03917"/><file name="Iglobal_Stores.xml" hash="9d9c621c78a98152bf83747eeecdaf99"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="fee.xml" hash="96955d111e2a9014d5dc3d18201ddddf"/><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 name="fee"><dir name="sales"><dir name="order"><file name="refunded.phtml" hash="f4239d313366d75907a34b3342b35eb1"/><file name="total.phtml" hash="bbb080fb20415086d72719c1f1f613d4"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="iglobal"><dir name="checkout"><dir name="cart"><dir name="item"><dir name="configure"><file name="updatecart.phtml" hash="0fc6cc809c88704da74a915cf7e20918"/></dir></dir></dir></dir><dir name="stores"><file name="cart.phtml" hash="7f81a0edcf7658bbb62fc5138c1f87f5"/><file name="igcincludes.phtml" hash="c8e7469a99a83a7ad7a884fa96899abc"/></dir></dir></dir><dir name="layout"><file name="iglobal.xml" hash="d522ac5d3cabf448736c0b593dd7536e"/><file name="fee.xml" hash="97d67fc83755f625dfe305748fca65b1"/></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="iGlobal"><file name="ig_welcome_mat_default.css" hash="52ddb2f596572313d7525de9b53adecb"/><file name="ig_welcome_mat_default.js" hash="6d8567ed60a1464e738eb018e77e7874"/><file name="igc.cs.magento_default_ice.js" hash="aa8836ba720daba6b6a62130f7d6035c"/><dir name="jquery"><file name="jquery.js" hash="73a130a5693ab0a806c6d2acc8251006"/><file name="jquery.noconflict.js" hash="09bfdd3b964eb2b17b5d6caa1d20a607"/></dir></dir></dir></target></contents>
63
  <compatible/>
64
  <dependencies><required><php><min>5.0.0</min><max>7.0.0</max></php></required></dependencies>
65
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Iglobal_Main</name>
4
+ <version>1.0.5</version>
5
  <stability>stable</stability>
6
  <license>OSL</license>
7
  <channel>community</channel>
55
  &lt;li&gt;&lt;strong&gt;iGlobal Dimension Units&lt;/strong&gt; &#x2013; Unit of measure for the iGlobal Dimensional attributes. (CM / IN)&lt;/li&gt;&#xD;
56
  &lt;/ul&gt;&#xD;
57
  &lt;/ol&gt;</description>
58
+ <notes>-now significantly happier spending time with tables&#xD;
59
+ -some defaults have changed. A violation of the meaning of default&#xD;
60
+ -a couple minor bug fixes</notes>
61
  <authors><author><name>Matt Flamm</name><user>mattflamm</user><email>matt@iglobalstores.com</email></author><author><name>Judd Flamm</name><user>UnkUser1</user><email>judd@iglobalstores.com</email></author><author><name>Dustin Dwyer</name><user>UnkUser2</user><email>dustin@iglobalstores.com</email></author><author><name>Dave Meads</name><user>unkuser3</user><email>dave@iglobalstores.com</email></author></authors>
62
+ <date>2014-09-04</date>
63
+ <time>17:08:55</time>
64
+ <contents><target name="magecommunity"><dir name="Iglobal"><dir name="Fee"><dir name="Block"><dir name="Sales"><dir name="Order"><file name="Total.php" hash="0e9e1537fd6cedc9a2b4a3efdf3f769d"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="406a814f1216d736e8661a32c833a15e"/></dir><dir name="Model"><file name="Fee.php" hash="29729703293e6fa5af6527708d67d97f"/><file name="Observer.php" hash="a9ec09a49108625f592f8ef00bcba842"/><dir name="Sales"><dir name="Order"><dir name="Total"><dir name="Creditmemo"><file name="Fee.php" hash="048c8a97de6d884d3b95e0345c1cb75a"/></dir><dir name="Invoice"><file name="Fee.php" hash="fc98218c9a421b95af9f5f0ca062e1d8"/></dir></dir></dir><dir name="Quote"><dir name="Address"><dir name="Total"><file name="Fee.php" hash="bc925a41535068fb0a94c57183dd2027"/></dir></dir></dir></dir></dir><dir name="etc"><file name="config.xml" hash="4cf60a3913d56196b169dd2dffa85e12"/></dir><dir name="sql"><dir name="fee_setup"><file name="mysql4-install-0.1.0.php" hash="8327866f66c8bff7fcbb0305385a6f93"/></dir></dir></dir><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="1cf0b2e1716d3f726f4e974f02267b53"/></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="7b71e2bc9b801138f77f5927e7a6f6ba"/><file name="Cart.php" hash="2fd47fa1ca047bbc75383c2e35dd4bf2"/><file name="Includes.php" hash="7c36803ae1a6193f7805d7ae5bef17e6"/></dir><dir name="Helper"><file name="Configoptions.php" hash="b129e55b21f845a20d6e7fdb3b532be3"/><file name="Data.php" hash="2d77637b08ac8e7dcb717d8e1571739a"/></dir><dir name="Model"><file name="Configoptions.php" hash="6da281d601b7a6ce98ebc81b398d6e54"/><file name="Observer.php" hash="24ba19336cd0fb51700069ae3d80e471"/><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="6b05cac95a1d36deeb7e9c9bd439ad8c"/></dir><dir name="Rest"><file name="Order.php" hash="916a67634abdf48666119854a1628ac3"/></dir><dir name="Service"><file name="Quote.php" hash="bae0e5a710b9e3aa1427bb78a08fbfd8"/></dir></dir><dir name="controllers"><file name="AjaxController.php" hash="3169062e850efd55749ae8033676bf2d"/><file name="SuccessController.php" hash="2a00e63cfdff46fd8bf73277cb3f76ca"/><file name="TestController.php" hash="16d3154f6762859648abe2167bd4c4f5"/><file name="UpdateShippingStatusController.php" hash="77534f8cbc68f23ab3377ff1427b9300"/><file name="magento cart.phtml" hash="c39743cba1b96b2d0c6354155ea8bbf3"/></dir><dir name="etc"><file name="adminhtml.xml" hash="a94aa66e4f3643fcc49fb60650fef416"/><file name="config.xml" hash="9b2fbb79a16f29ae1601c3816ddaa04a"/><file name="system.xml" hash="40420c6652da8b38d181fdf57ab15720"/></dir><dir name="sql"><dir name="iglobal_stores_setup"><file name="mysql4-install-0.1.0.php" hash="8f8d6e6596d0ad98d70075f79f320cfd"/><file name="mysql4-upgrade-0.1.0-0.1.1.php" hash="1e8d0cc9906c303b99042290636faef9"/><file name="mysql4-upgrade-0.1.1-0.1.2.php" hash="d710311110eebfc65573d178e8cf5aba"/><file name="mysql4-upgrade-0.1.2-0.1.3.php" hash="1e8d0cc9906c303b99042290636faef9"/><file name="mysql4-upgrade-0.1.3-1.0.0.php" hash="ef0079b0f3b1c09b7417ff86df00ad9e"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Iglobal_Fee.xml" hash="205714b75c3b417343a6b25ecedf35c4"/><file name="Iglobal_Ship.xml" hash="6d40f1c84e29bb7d8b70eadd77a03917"/><file name="Iglobal_Stores.xml" hash="9d9c621c78a98152bf83747eeecdaf99"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="fee.xml" hash="96955d111e2a9014d5dc3d18201ddddf"/><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 name="fee"><dir name="sales"><dir name="order"><file name="refunded.phtml" hash="f4239d313366d75907a34b3342b35eb1"/><file name="total.phtml" hash="bbb080fb20415086d72719c1f1f613d4"/></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="iglobal"><dir name="checkout"><dir name="cart"><dir name="item"><dir name="configure"><file name="updatecart.phtml" hash="0fc6cc809c88704da74a915cf7e20918"/></dir></dir></dir></dir><dir name="stores"><file name="cart.phtml" hash="5d2db597e5dad80541c1caa5feab1af0"/><file name="igcincludes.phtml" hash="c8e7469a99a83a7ad7a884fa96899abc"/></dir></dir></dir><dir name="layout"><file name="iglobal.xml" hash="d522ac5d3cabf448736c0b593dd7536e"/><file name="fee.xml" hash="97d67fc83755f625dfe305748fca65b1"/></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="iGlobal"><file name="ig_welcome_mat_default.css" hash="52ddb2f596572313d7525de9b53adecb"/><file name="ig_welcome_mat_default.js" hash="6d8567ed60a1464e738eb018e77e7874"/><file name="igc.cs.magento_default_ice.js" hash="89898d6eb28c8636fb93f6dc5d9d0230"/><file name="igc.cs.matts_test_ice.js" hash="77971613fcf5b7addab808762ad8a421"/><dir name="jquery"><file name="jquery.js" hash="73a130a5693ab0a806c6d2acc8251006"/><file name="jquery.noconflict.js" hash="09bfdd3b964eb2b17b5d6caa1d20a607"/></dir></dir></dir></target></contents>
65
  <compatible/>
66
  <dependencies><required><php><min>5.0.0</min><max>7.0.0</max></php></required></dependencies>
67
  </package>