Version Notes
New Features:
Fully Embedded Checkout Using iFrame
Magento Country Region Support
Reconciliation Improvements with Payment Transaction Id
Improvements:
Faster Speeds
iGlobal Stores Updated API Additions
Download this release
Release Info
Developer | Matt Flamm |
Extension | Iglobal_Main |
Version | 1.1.0 |
Comparing to | |
See all releases |
Code changes from version 1.0.8 to 1.1.0
- app/code/community/Iglobal/Stores/Block/Link.php +27 -0
- app/code/community/Iglobal/Stores/Helper/Url.php +24 -0
- app/code/community/Iglobal/Stores/Model/International/International.php +187 -0
- app/code/community/Iglobal/Stores/Model/Rest/Order.php +7 -7
- app/code/community/Iglobal/Stores/Model/Rest/Region.php +42 -0
- app/code/community/Iglobal/Stores/controllers/CheckoutController.php +43 -0
- app/code/community/Iglobal/Stores/controllers/OrderscheckController.php +0 -116
- app/code/community/Iglobal/Stores/controllers/SuccessController.php +361 -273
- app/code/community/Iglobal/Stores/controllers/TestController.php +0 -166
- app/code/community/Iglobal/Stores/controllers/UpdateShippingStatusController.php +0 -72
- app/code/community/Iglobal/Stores/controllers/carbonfiber.php +0 -357
- app/code/community/Iglobal/Stores/etc/config.xml +14 -5
- app/code/community/Iglobal/Stores/etc/system.xml +35 -2
- app/design/frontend/base/default/layout/iglobal.xml +6 -0
- app/design/frontend/base/default/template/iglobal/checkout/onepage/link.phtml +30 -0
- app/design/frontend/base/default/template/iglobal/stores/igcincludes.phtml +1 -1
- js/iGlobal/ig_welcome_mat_default.js +18 -0
- js/iGlobal/igc.cs.magento_default_ice.js +1 -1
- package.xml +15 -48
app/code/community/Iglobal/Stores/Block/Link.php
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
//this block override returns the url to be used on the primary checkout buttons on the cart page.
|
4 |
+
//If you are using a custom checkout then this may or may not still work.
|
5 |
+
//If not, you will need to find how the checkout determines the url, and apply a similar method.
|
6 |
+
// also refer to ../Helper/Url.php
|
7 |
+
|
8 |
+
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));
|
25 |
+
}
|
26 |
+
}
|
27 |
+
}
|
app/code/community/Iglobal/Stores/Helper/Url.php
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Iglobal_Stores_Helper_Url extends Mage_Checkout_Helper_Url
|
3 |
+
{
|
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') && Mage::getStoreConfig('iglobal_integration/apireqs/ice_toggle') && Mage::getStoreConfig('iglobal_integration/apireqs/use_iframe')){// check for welcome mat //!$isDomestic && Mage::getStoreConfig('iglobal_integration/apireqs/ice_toggle')){ // add checks for other admin configs
|
14 |
+
|
15 |
+
// make this a javascript url
|
16 |
+
return "javascript:if(!ig_isDomesticCountry()){window.location.replace (' " . $this->_getUrl('iglobal/checkout') . "');} else {window.location.replace ('" . $this->_getUrl('checkout/onepage') . "');}";
|
17 |
+
//return "javascript:if(!ig_isDomesticCountry()){window.location.replace ('{$this->_getUrl('iglobal/checkout')}')return false;} else {window.location.replace ('{$this->_getUrl('checkout/onepage')}";
|
18 |
+
//return $this->_getUrl('iglobal/checkout');
|
19 |
+
} else {
|
20 |
+
return $this->_getUrl('checkout/onepage');
|
21 |
+
}
|
22 |
+
}
|
23 |
+
|
24 |
+
}
|
app/code/community/Iglobal/Stores/Model/International/International.php
ADDED
@@ -0,0 +1,187 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
|
4 |
+
class Iglobal_Stores_Model_International_International extends Mage_Core_Model_Abstract
|
5 |
+
{
|
6 |
+
protected $_entryPoint = null;
|
7 |
+
|
8 |
+
protected function _construct()
|
9 |
+
{
|
10 |
+
|
11 |
+
|
12 |
+
}
|
13 |
+
|
14 |
+
public function setParameters ($client) {
|
15 |
+
|
16 |
+
//get all the items in the cart
|
17 |
+
$cart = Mage::getModel('checkout/cart')->getQuote();
|
18 |
+
//start a loop to set each one
|
19 |
+
//$i = 0;
|
20 |
+
foreach ($cart->getAllVisibleItems() as $index=>$item) {
|
21 |
+
$itemNumber = ++$index;
|
22 |
+
// This is because Magento fails to load the custom attributes hence we have to go back to the DB.
|
23 |
+
$weight = "";
|
24 |
+
$length = "";
|
25 |
+
$width = "";
|
26 |
+
$height = "";
|
27 |
+
|
28 |
+
try {
|
29 |
+
$allItemData = Mage::getModel('catalog/product')->load($item['product_id']);
|
30 |
+
$weightUnits = "";
|
31 |
+
$dimUnits = "";
|
32 |
+
|
33 |
+
try {
|
34 |
+
$weightUnits = "";
|
35 |
+
if (!empty($allItemData['ig_weight_units'])) {
|
36 |
+
$weightUnits = $allItemData->getAttributeText('ig_weight_units');
|
37 |
+
}
|
38 |
+
} catch (Exception $e) {
|
39 |
+
$weightUnits = "";
|
40 |
+
}
|
41 |
+
|
42 |
+
try {
|
43 |
+
$weight = "";
|
44 |
+
if (!empty($allItemData['ig_weight'])) {
|
45 |
+
$weight = $allItemData->getData('ig_weight');
|
46 |
+
} else if (!empty($allItemData['weight'])) {
|
47 |
+
$weight = $item->getWeight();
|
48 |
+
}
|
49 |
+
|
50 |
+
if (!empty($weight)) {
|
51 |
+
if ($weightUnits=="kg") {
|
52 |
+
$weight = round(floatval($weight) / 0.453592, 2);
|
53 |
+
} else if ($weightUnits=="oz") {
|
54 |
+
$weight = round(floatval($weight) / 16, 2);
|
55 |
+
} else if ($weightUnits=="g") {
|
56 |
+
$weight = round(floatval($weight) / 453.592, 2);
|
57 |
+
} else {//Default is lbs
|
58 |
+
$weight = round(floatval($weight), 2);
|
59 |
+
}
|
60 |
+
} else {
|
61 |
+
$weight = "";
|
62 |
+
}
|
63 |
+
} catch(Exception $e) {
|
64 |
+
$weight = "";
|
65 |
+
}
|
66 |
+
|
67 |
+
try {
|
68 |
+
$dimUnits = "";
|
69 |
+
if (!empty($allItemData['ig_dimension_units'])) {
|
70 |
+
$dimUnits = $allItemData->getAttributeText('ig_dimension_units');
|
71 |
+
}
|
72 |
+
} catch (Exception $e) {
|
73 |
+
$dimUnits = "";
|
74 |
+
}
|
75 |
+
try {
|
76 |
+
$length = "";
|
77 |
+
if (!empty($allItemData['ig_length'])) {
|
78 |
+
$length = $allItemData->getData('ig_length');
|
79 |
+
}
|
80 |
+
$width = "";
|
81 |
+
if (!empty($allItemData['ig_width'])) {
|
82 |
+
$width = $allItemData->getData('ig_width');
|
83 |
+
}
|
84 |
+
$height = "";
|
85 |
+
if (!empty($allItemData['ig_height'])) {
|
86 |
+
$height = $allItemData->getData('ig_height');
|
87 |
+
}
|
88 |
+
if (!empty($length) && !empty($width) && !empty($height)) {
|
89 |
+
if ($dimUnits=="cm") {
|
90 |
+
$length = ceil(floatval($length) / 2.54);
|
91 |
+
$width = ceil(floatval($width) / 2.54);
|
92 |
+
$height = ceil(floatval($height) / 2.54);
|
93 |
+
} else {//Default is inches
|
94 |
+
$length = ceil(floatval($length));
|
95 |
+
$width = ceil(floatval($width));
|
96 |
+
$height = ceil(floatval($height));
|
97 |
+
}
|
98 |
+
} else {
|
99 |
+
$length = "";
|
100 |
+
$width = "";
|
101 |
+
$height = "";
|
102 |
+
}
|
103 |
+
} catch(Exception $e) {
|
104 |
+
$length = "";
|
105 |
+
$width = "";
|
106 |
+
$height = "";
|
107 |
+
}
|
108 |
+
} catch (Exception $outerE) {
|
109 |
+
|
110 |
+
}
|
111 |
+
|
112 |
+
$itemId = $item->getProductId();
|
113 |
+
$itemName = $item->getName();
|
114 |
+
$itemSku = $item->getProduct()->getTypeId() == 'bundle' ? substr($item->getSku(), strpos($item->getSku(), '-')+1) : $item->getSku();
|
115 |
+
$itemQty = $item->getQty();
|
116 |
+
$itemPrice = $item->getPrice();
|
117 |
+
$itemProductUrl = Mage::getModel('catalog/product')->load($item->getProductId())->getProductUrl();
|
118 |
+
$itemImageUrl = str_replace("http:", "https:",Mage::helper('catalog/image')->init($item->getProduct(), 'thumbnail'));
|
119 |
+
$itemDescription = Mage::getModel('catalog/product')->load($item->getProductId())->getDescription();
|
120 |
+
$itemShortDescription = Mage::getModel('catalog/product')->load($item->getProductId())->getDescription();
|
121 |
+
$itemMageWeight = $item->getWeight();
|
122 |
+
$itemIgWeight = $weight;
|
123 |
+
$itemIgLength = $length;
|
124 |
+
$itemIgWidth = $width;
|
125 |
+
$itemIgHeight = $height;
|
126 |
+
|
127 |
+
if($itemId) $client->setParameterPost('itemProductId'.$itemNumber, $itemId);
|
128 |
+
if($itemName) $client->setParameterPost('itemDescription'.$itemNumber, $itemName);
|
129 |
+
if($itemSku) $client->setParameterPost('itemSku'.$itemNumber, $itemSku);
|
130 |
+
if($itemQty) $client->setParameterPost('itemQuantity'.$itemNumber, $itemQty);
|
131 |
+
if($itemPrice) $client->setParameterPost('itemUnitPrice'.$itemNumber, $itemPrice);
|
132 |
+
if($itemProductUrl) $client->setParameterPost('itemURL'.$itemNumber, $itemProductUrl);
|
133 |
+
if($itemImageUrl) $client->setParameterPost('itemImageURL'.$itemNumber, $itemImageUrl);
|
134 |
+
if($itemDescription) $client->setParameterPost('itemDescription'.$itemNumber, $itemDescription);
|
135 |
+
//if($itemShortDescription) $client->setParameterPost('itemProductIdN'.$itemNumber, $itemShortDescription);
|
136 |
+
if($itemIgLength) $client->setParameterPost('itemLength'.$itemNumber, $itemIgLength);
|
137 |
+
if($itemIgWidth) $client->setParameterPost('itemWidth'.$itemNumber, $itemIgWidth);
|
138 |
+
if($itemIgHeight) $client->setParameterPost('itemHeight'.$itemNumber, $itemIgHeight);
|
139 |
+
if($itemIgWeight) {
|
140 |
+
$client->setParameterPost('itemWeight'.$itemNumber, $itemIgWeight);
|
141 |
+
} elseif ($itemMageWeight) {
|
142 |
+
$client->setParameterPost('itemWeight'.$itemNumber, $itemMageWeight);
|
143 |
+
}
|
144 |
+
|
145 |
+
}
|
146 |
+
}
|
147 |
+
|
148 |
+
public function getTempCartId ()
|
149 |
+
{
|
150 |
+
//build a POST and return the response
|
151 |
+
|
152 |
+
$storeNumber = Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid');
|
153 |
+
|
154 |
+
$client = new Varien_Http_Client('https://checkout.iglobalstores.com/iglobalstores/services/TempCartService');
|
155 |
+
$client->setMethod(Varien_Http_Client::POST);
|
156 |
+
|
157 |
+
$client->setParameterPost('store', $storeNumber);
|
158 |
+
$this->setParameters($client);
|
159 |
+
|
160 |
+
//$client->setParameterPost('itemDescription1', 'My item for testing temp carts');
|
161 |
+
//$client->setParameterPost('itemQuantity1', '1');
|
162 |
+
//$client->setParameterPost('itemUnitPrice1', '123.45');
|
163 |
+
//set the parameters in a loop
|
164 |
+
|
165 |
+
//$client->setParameterPost('address', '123 fake st');//$address);
|
166 |
+
//$client->setParameterPost('address', $address);
|
167 |
+
|
168 |
+
//more parameters
|
169 |
+
//Zend_Debug::dump($client);
|
170 |
+
|
171 |
+
Mage::log("the client data" . print_r($client, true), null, 'international.log', true);
|
172 |
+
|
173 |
+
try{
|
174 |
+
$response = $client->request();
|
175 |
+
if ($response->isSuccessful()) {
|
176 |
+
return $response->getBody();
|
177 |
+
}
|
178 |
+
} catch (Exception $e) {
|
179 |
+
die($e);
|
180 |
+
}
|
181 |
+
|
182 |
+
|
183 |
+
echo "I'm in the function!";
|
184 |
+
}
|
185 |
+
|
186 |
+
}
|
187 |
+
?>
|
app/code/community/Iglobal/Stores/Model/Rest/Order.php
CHANGED
@@ -46,23 +46,23 @@ class Iglobal_Stores_Model_Rest_Order extends Mage_Core_Model_Abstract
|
|
46 |
$result = $client->restPost('/iglobalstores/services/OrderRestService/v1.06', $this->addCredentials($data))->getBody();
|
47 |
return json_decode(json_encode((array) simplexml_load_string($result)),1);
|
48 |
}
|
49 |
-
|
50 |
public function getAllOrders()
|
51 |
{
|
52 |
$data = array('operation'=>'orderNumbers', 'sinceDate'=>'20100101');
|
53 |
$client = $this->getRestClient();
|
54 |
$result = $client->restPost('/iglobalstores/services/OrderRestService/v1.06', $this->addCredentials($data))->getBody();
|
55 |
return json_decode(json_encode((array) simplexml_load_string($result)),1);
|
56 |
-
}
|
57 |
-
|
58 |
public function getAllOrdersSinceDate($data)
|
59 |
{
|
60 |
$data = array('operation'=>'orderNumbers', 'sinceDate'=>$data);
|
61 |
$client = $this->getRestClient();
|
62 |
$result = $client->restPost('/iglobalstores/services/OrderRestService/v1.06', $this->addCredentials($data))->getBody();
|
63 |
return json_decode(json_encode((array) simplexml_load_string($result)),1);
|
64 |
-
}
|
65 |
-
|
66 |
public function getOrder($order)
|
67 |
{
|
68 |
$data = array('operation'=>'orderDetail', 'orderId' => $order);
|
@@ -71,8 +71,8 @@ class Iglobal_Stores_Model_Rest_Order extends Mage_Core_Model_Abstract
|
|
71 |
//echo "Rest result: <br />";
|
72 |
//Zend_Debug::dump($result);
|
73 |
//Mage::log("The rest result for order {$order}:" . Zend_Debug::dump($result), 'mattscustom.log', true);
|
74 |
-
Mage::log("The rest result for order {$order}:" . print_r($result, true), null, 'mattscustom.log', true);
|
75 |
-
|
76 |
return json_decode(json_encode((array) simplexml_load_string($result)),1);
|
77 |
}
|
78 |
|
46 |
$result = $client->restPost('/iglobalstores/services/OrderRestService/v1.06', $this->addCredentials($data))->getBody();
|
47 |
return json_decode(json_encode((array) simplexml_load_string($result)),1);
|
48 |
}
|
49 |
+
|
50 |
public function getAllOrders()
|
51 |
{
|
52 |
$data = array('operation'=>'orderNumbers', 'sinceDate'=>'20100101');
|
53 |
$client = $this->getRestClient();
|
54 |
$result = $client->restPost('/iglobalstores/services/OrderRestService/v1.06', $this->addCredentials($data))->getBody();
|
55 |
return json_decode(json_encode((array) simplexml_load_string($result)),1);
|
56 |
+
}
|
57 |
+
|
58 |
public function getAllOrdersSinceDate($data)
|
59 |
{
|
60 |
$data = array('operation'=>'orderNumbers', 'sinceDate'=>$data);
|
61 |
$client = $this->getRestClient();
|
62 |
$result = $client->restPost('/iglobalstores/services/OrderRestService/v1.06', $this->addCredentials($data))->getBody();
|
63 |
return json_decode(json_encode((array) simplexml_load_string($result)),1);
|
64 |
+
}
|
65 |
+
|
66 |
public function getOrder($order)
|
67 |
{
|
68 |
$data = array('operation'=>'orderDetail', 'orderId' => $order);
|
71 |
//echo "Rest result: <br />";
|
72 |
//Zend_Debug::dump($result);
|
73 |
//Mage::log("The rest result for order {$order}:" . Zend_Debug::dump($result), 'mattscustom.log', true);
|
74 |
+
//Mage::log("The rest result for order {$order}:" . print_r($result, true), null, 'mattscustom.log', true);
|
75 |
+
//$result = mb_convert_encoding($result, "HTML-ENTITIES", "UTF-8");
|
76 |
return json_decode(json_encode((array) simplexml_load_string($result)),1);
|
77 |
}
|
78 |
|
app/code/community/Iglobal/Stores/Model/Rest/Region.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Iglobal_Stores_Model_Rest_Region extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
protected $_entryPoint = null;
|
6 |
+
|
7 |
+
protected function _construct()
|
8 |
+
{
|
9 |
+
|
10 |
+
|
11 |
+
//Set Service Key
|
12 |
+
$this -> _key = '{31ae7155-5b9e-461f-8353-9a8c3f8ae35974ffec3a-88dc-4acb-8420-270df7967338}';
|
13 |
+
|
14 |
+
//set entryPoint
|
15 |
+
$this->_entryPoint = 'https://api.iglobalstores.com/v1/magento-region';
|
16 |
+
|
17 |
+
}
|
18 |
+
|
19 |
+
protected function getRestClient()
|
20 |
+
{
|
21 |
+
return new Zend_Http_Client($this->_entryPoint);
|
22 |
+
}
|
23 |
+
|
24 |
+
protected function addCredentials(array $data)
|
25 |
+
{
|
26 |
+
return array_merge($data, array('serviceToken'=>$this->_key));
|
27 |
+
}
|
28 |
+
|
29 |
+
public function getRegionId($countryId, $region, $order)
|
30 |
+
{
|
31 |
+
$data = array('countryCode'=> $countryId,'region'=> $region, 'orderId' => $order);
|
32 |
+
$client = $this->getRestClient();
|
33 |
+
$client->setRawData(json_encode($data), 'application/json')->setHeaders("serviceToken:31ae7155-5b9e-461f-8353-9a8c3f8ae35974ffec3a-88dc-4acb-8420-270df7967338")->request('POST');
|
34 |
+
$result = $client->request()->getBody();
|
35 |
+
$resArray = json_decode($result, true);
|
36 |
+
//Mage::log("The region rest result for order {$order}:" . Zend_Debug::dump($result), 'mattscustom.log', true);
|
37 |
+
//Mage::log("The region rest result for order {$order}:" . print_r($result, true), null, 'mattscustom.log', true);
|
38 |
+
return $resArray;
|
39 |
+
}
|
40 |
+
|
41 |
+
}
|
42 |
+
?>
|
app/code/community/Iglobal/Stores/controllers/CheckoutController.php
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
//
|
3 |
+
// Load the iGlobal hosted checkout in an iframe, cause it's awesome
|
4 |
+
//
|
5 |
+
class Iglobal_Stores_CheckoutController extends Mage_Core_Controller_Front_Action
|
6 |
+
{
|
7 |
+
public function indexAction()
|
8 |
+
{
|
9 |
+
//todo: add a check to see if they are domestic and then redirect to domestic checkout
|
10 |
+
|
11 |
+
|
12 |
+
$cartQty = (int) Mage::getModel('checkout/cart')->getQuote()->getItemsQty();
|
13 |
+
if (!$cartQty) {
|
14 |
+
$this->_redirect('checkout/cart');
|
15 |
+
die();
|
16 |
+
//echo "The Cart is Empty";
|
17 |
+
}
|
18 |
+
|
19 |
+
$tempcart = Mage::getModel('stores/international_international');
|
20 |
+
|
21 |
+
if (!$tempcart) {
|
22 |
+
echo "No tempcart!";
|
23 |
+
die();
|
24 |
+
}
|
25 |
+
|
26 |
+
$cartId = $tempcart->getTempCartId();
|
27 |
+
|
28 |
+
// echo out the html that will build the iframe
|
29 |
+
$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: 0px;} </style></head><body><div id="content"><iframe width="100%" height="100%" frameborder="0" src="';
|
30 |
+
//this is where we build the url for the checkout
|
31 |
+
$subdomain = (Mage::getStoreConfig('iglobal_integration/apireqs/igsubdomain') ? Mage::getStoreConfig('iglobal_integration/apireqs/igsubdomain') : "checkout");
|
32 |
+
$storeNumber = (Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid') ? Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid') : "3");
|
33 |
+
$countryCode = (isset($_COOKIE['igCountry']) ? $_COOKIE['igCountry'] : "");
|
34 |
+
|
35 |
+
$iframeUrl = 'https://' . $subdomain . '.iglobalstores.com/?store=' . $storeNumber . '&tempCartUUID=' . $cartId . '&country=' . $countryCode;
|
36 |
+
|
37 |
+
$domCode = $domCode . $iframeUrl . '"/></div></body></html>';
|
38 |
+
|
39 |
+
echo $domCode;
|
40 |
+
|
41 |
+
}
|
42 |
+
|
43 |
+
}
|
app/code/community/Iglobal/Stores/controllers/OrderscheckController.php
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
<?php
|
4 |
-
|
5 |
-
class Iglobal_Stores_OrderscheckController extends Mage_Core_Controller_Front_Action
|
6 |
-
{
|
7 |
-
public function indexAction()
|
8 |
-
{
|
9 |
-
|
10 |
-
//get array with all orders in past
|
11 |
-
$rest = Mage::getModel('stores/rest_order'); // get rest model
|
12 |
-
|
13 |
-
//fetch all orders for the store from iGlobal server
|
14 |
-
$data = $rest->getAllOrdersSinceDate('20140526');
|
15 |
-
$orderData = $data['order'];
|
16 |
-
$restOrders = array();
|
17 |
-
|
18 |
-
//build array of orders with keypairs "ig_order_number" => "the number as a string"
|
19 |
-
foreach($orderData as $row => $order){
|
20 |
-
if($data['testOrder'] == "false"){
|
21 |
-
$newId = $order['id'];
|
22 |
-
array_push($restOrders, $newId);
|
23 |
-
}
|
24 |
-
}
|
25 |
-
|
26 |
-
|
27 |
-
//build array of orders currently in magento
|
28 |
-
$table = "sales_flat_order";
|
29 |
-
$tableName = Mage::getSingleton("core/resource")->getTableName($table);
|
30 |
-
$reader = Mage::getSingleton('core/resource')->getConnection('core_read'); // get our connection to the DB
|
31 |
-
$importedIgOrdersQuery = "Select * from `" . $tableName . "` where `international_order` = 1 AND `ig_order_number` IS NOT NULL"; //select rows that are ig orders
|
32 |
-
$importedIgOrders = $reader->fetchAll($importedIgOrdersQuery); //fetch them all
|
33 |
-
|
34 |
-
//fix teh array so it matches our array of all orders
|
35 |
-
$magentoOrders = array();
|
36 |
-
foreach ($importedIgOrders as $importedIgOrder) {
|
37 |
-
$newId = $importedIgOrder['ig_order_number'];
|
38 |
-
array_push($magentoOrders, $newId);
|
39 |
-
}
|
40 |
-
|
41 |
-
|
42 |
-
//compare arrays, removing orders already in magento from list of all orders, remainder are orders that didn't import
|
43 |
-
$missedOrders = array_diff($restOrders, $magentoOrders);
|
44 |
-
|
45 |
-
if (count($missedOrders) > 0) {
|
46 |
-
echo '<div style="width:50%;background-color:#c1c1c1;overflow:hidden;">Missed Orders: <br />';
|
47 |
-
foreach ($missedOrders as $missedOrder){
|
48 |
-
echo $missedOrder . '<br />';
|
49 |
-
}
|
50 |
-
//var_dump($missedOrders);
|
51 |
-
echo '</div>';
|
52 |
-
} else {
|
53 |
-
echo '<div style="width:50%;background-color:#c1c1c1;overflow:hidden;">There are no orders that have not been imported<br /></div>';
|
54 |
-
}
|
55 |
-
|
56 |
-
/* if (count($restOrders) > 0) {
|
57 |
-
echo '<div style="width:50%;background-color:#e0e0e0;overflow:hidden;float:left;">Rest Orders: <br />';
|
58 |
-
var_dump($restOrders);
|
59 |
-
echo '</div>';
|
60 |
-
} else {
|
61 |
-
echo '<div style="width:50%;background-color:#e0e0e0;overflow:hidden;float:left;">All orders from iGlobal are test orders.<br />';
|
62 |
-
}
|
63 |
-
|
64 |
-
if (count($magentoOrders) > 0) {
|
65 |
-
echo '<div style="width:50%;background-color:#e0e0e0;overflow:hidden;float:left;">Magento Orders: <br />';
|
66 |
-
var_dump($magentoOrders);
|
67 |
-
echo '</div>';
|
68 |
-
} else {
|
69 |
-
echo '<div style="width:50%;background-color:#e0e0e0;overflow:hidden;float:left;">You don\'t have any orders from iGlobal imported yet.<br />';
|
70 |
-
} */
|
71 |
-
|
72 |
-
|
73 |
-
//create array of duplicate orders
|
74 |
-
$allOrders = array();
|
75 |
-
foreach ($importedIgOrders as $importedIgOrder) {
|
76 |
-
$order = Mage::getModel('sales/order')->load($importedIgOrder['entity_id']);
|
77 |
-
$Incrementid = $importedIgOrder['entity_id'];
|
78 |
-
$magentoOrderId = $order->getIncrementId();
|
79 |
-
$allOrders[$magentoOrderId] = $importedIgOrder['ig_order_number'];
|
80 |
-
}
|
81 |
-
|
82 |
-
//create a complicated way to show duplicates, because PHP only makes it easy to find unique values. for shame, php. for shame.
|
83 |
-
$duplicateOrders = array_diff_assoc($allOrders,array_unique($allOrders));
|
84 |
-
|
85 |
-
echo '<table style="width:50%;background-color:#e0e0e0;border: 1px solid black;"><thead><tr><th>Orders duplicated in Magento (does not include the actual order, only the duplicates)</th></tr><tr><th>Magento Order Number</th><th>iGlobal Order Number</th></tr></thead><tbody>';
|
86 |
-
|
87 |
-
foreach ($duplicateOrders as $key=>$value) {
|
88 |
-
echo '<tr><td>' . $key . '</td><td>' . $value . '</td></tr>';
|
89 |
-
}
|
90 |
-
echo '</tbody></table>' ;
|
91 |
-
|
92 |
-
/* //get array of all
|
93 |
-
$dupsQuery = "SELECT *, COUNT(*) as count FROM " . $tableName ." GROUP BY ig_order_number HAVING COUNT(*) > 1";
|
94 |
-
$duplicatedIgOrders = $reader->fetchAll($dupsQuery);
|
95 |
-
//var_dump($duplicatedIgOrders);
|
96 |
-
|
97 |
-
//foreach to get $orderId
|
98 |
-
foreach ($duplicatedIgOrders as $order){
|
99 |
-
$igNumber = $order['ig_order_number'];
|
100 |
-
$magentoNumber = $order['entity_id'];
|
101 |
-
//array_push($magentoOrders, $newId);
|
102 |
-
echo $igNumber . ":" . $magentoNumber;
|
103 |
-
//echo $igNumber;
|
104 |
-
}
|
105 |
-
|
106 |
-
//remove from array if no duplicate
|
107 |
-
|
108 |
-
//echo unique order numbers, paired with ig_order number
|
109 |
-
$order = Mage::getModel('sales/order')->load($orderid);
|
110 |
-
$Incrementid = $order->getIncrementId();
|
111 |
-
*/
|
112 |
-
}
|
113 |
-
|
114 |
-
|
115 |
-
}
|
116 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Iglobal/Stores/controllers/SuccessController.php
CHANGED
@@ -8,283 +8,371 @@ class Iglobal_Stores_SuccessController extends Mage_Core_Controller_Front_Action
|
|
8 |
$_order = $this->getRequest()->getParam('orderId', null);
|
9 |
try
|
10 |
{
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
|
275 |
}
|
276 |
catch(Exception $e)
|
277 |
{
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
|
|
288 |
}
|
289 |
|
290 |
$this->loadLayout();
|
8 |
$_order = $this->getRequest()->getParam('orderId', null);
|
9 |
try
|
10 |
{
|
11 |
+
$quote = Mage::getSingleton('checkout/session')->getQuote()->setStoreId(Mage::app()->getStore()->getId());
|
12 |
+
$table = "sales_flat_order";
|
13 |
+
$tableName = Mage::getSingleton("core/resource")->getTableName($table);
|
14 |
+
$existsQuery = "SELECT `entity_id` FROM `" . $tableName. "` WHERE `ig_order_number` = '{$_order}'";
|
15 |
+
$orderExists = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchRow($existsQuery);
|
16 |
+
|
17 |
+
if(!$_order || $orderExists) {
|
18 |
+
header('Location: /');
|
19 |
+
die();
|
20 |
+
}
|
21 |
+
|
22 |
+
|
23 |
+
$rest = Mage::getModel('stores/rest_order');
|
24 |
+
$data = $rest->getOrder($_order);
|
25 |
+
//Mage::log("the data in the controller for order {$_order}:" . print_r($data, true), null, 'mattscustom.log', true);
|
26 |
+
//set ddp
|
27 |
+
$quote->setFeeAmount($data['dutyTaxesTotal']);
|
28 |
+
|
29 |
+
//set customer info
|
30 |
+
$quote->setCustomerEmail($data['email']);
|
31 |
+
|
32 |
+
$_name = explode(' ', $data['name'], 2);
|
33 |
+
if ($data['testOrder'] == "true") {
|
34 |
+
$name_first = "TEST ORDER! DO NOT SHIP! - " . array_shift($_name);
|
35 |
+
$name_last = array_pop($_name);
|
36 |
+
} else {
|
37 |
+
$name_first = array_shift($_name);
|
38 |
+
$name_last = array_pop($_name);
|
39 |
+
}
|
40 |
+
|
41 |
+
$quote->setCustomerFirstname($name_first);
|
42 |
+
$quote->setCustomerLastname($name_last);
|
43 |
+
|
44 |
+
$street = $data['address2'] ? array($data['address1'], $data['address2']) : $data['address1'];
|
45 |
+
|
46 |
+
// to fix error with countries w/o zip codes
|
47 |
+
if (is_array($data['zip'])){
|
48 |
+
$igcZipCode = ' ';
|
49 |
+
}else {
|
50 |
+
$igcZipCode = $data['zip'];
|
51 |
+
}
|
52 |
+
|
53 |
+
$regionData = Mage::getModel('stores/rest_region');
|
54 |
+
$regionReq = $rest->getRegionId($data['countryCode'], $data['state'], $_order);
|
55 |
+
//Zend_Debug::dump($regionReq);
|
56 |
+
echo $regionReq['magentoRegionId'];
|
57 |
+
$mageRegion = $regionReq['magentoRegionId'];
|
58 |
+
|
59 |
+
$addressData = array(
|
60 |
+
'firstname' => $name_first,
|
61 |
+
'lastname' => $name_last,
|
62 |
+
'street' => $street,
|
63 |
+
'city' => $data['city'],
|
64 |
+
'postcode' => $igcZipCode,
|
65 |
+
'telephone' => $data['phone'],
|
66 |
+
//'region' => Mage::getModel('directory/region')->load($mageRegion)->getName(),
|
67 |
+
'region' => $data['state'],
|
68 |
+
'region_id' => $mageRegion,
|
69 |
+
'country_id' => $data['countryCode'],
|
70 |
+
'company' => '',//$data['company'],
|
71 |
+
);
|
72 |
+
|
73 |
+
$billingCheckVar = $data['billingAddress1'];
|
74 |
+
if (!empty($billingCheckVar)){
|
75 |
+
$_nameBilling = explode(' ', $data['billingName'], 2);
|
76 |
+
if ($data['testOrder'] == "true") {
|
77 |
+
$name_first_billing = "TEST ORDER! DO NOT SHIP! - " . array_shift($_nameBilling);
|
78 |
+
$name_last_billing = array_pop($_nameBilling);
|
79 |
+
} else {
|
80 |
+
$name_first_billing = array_shift($_nameBilling);
|
81 |
+
$name_last_billing = array_pop($_nameBilling);
|
82 |
+
}
|
83 |
+
|
84 |
+
|
85 |
+
$streetBilling = $data['billingAddress2'] ? array($data['billingAddress1'], $data['billingAddress2']) : $data['billingAddress1'];
|
86 |
+
|
87 |
+
// to fix error with countries w/o zip codes
|
88 |
+
if (is_array($data['billingZip'])){
|
89 |
+
$igcZipCodeBilling = ' ';
|
90 |
+
}else {
|
91 |
+
$igcZipCodeBilling = $data['billingZip'];
|
92 |
+
}
|
93 |
+
|
94 |
+
$billingAddressData = array(
|
95 |
+
'firstname' => $name_first_billing,
|
96 |
+
'lastname' => $name_last_billing,
|
97 |
+
'street' => $streetBilling,
|
98 |
+
'city' => $data['billingCity'],
|
99 |
+
'postcode' => $igcZipCodeBilling,
|
100 |
+
'telephone' => $data['billingPhone'],
|
101 |
+
//'region' => Mage::getModel('directory/region')->load($mageRegion)->getName(),
|
102 |
+
'region' => $data['state'],
|
103 |
+
//'region_id' => $mageRegion,
|
104 |
+
'country_id' => $data['billingCountryCode'],
|
105 |
+
);
|
106 |
+
|
107 |
+
} else {
|
108 |
+
$billingAddressData = $addressData;
|
109 |
+
}
|
110 |
+
|
111 |
+
|
112 |
+
Mage::log('address data for order {$_order}: ' . print_r($addressData, true), null, 'mattscustom.log', true);
|
113 |
+
|
114 |
+
Mage::log('billing address data for order {$_order}: ' . print_r($billingAddressData, true), null, 'mattscustom.log', true);
|
115 |
+
|
116 |
+
//Figure out shipping carrier name etc.
|
117 |
+
$shippingRate = $data['shippingTotal'];
|
118 |
+
$shippingCarrierMethod = $data['shippingCarrierServiceLevel'];
|
119 |
+
switch ($shippingCarrierMethod) {
|
120 |
+
case 'DHL_EXPRESS' :
|
121 |
+
$shipper = 'excellence_excellence';
|
122 |
+
$shippingCarrierTitle = 'DHL';
|
123 |
+
$shippingMethodTitle = 'Express - iGlobal';
|
124 |
+
break;
|
125 |
+
case 'DHL_GLOBAL_MAIL' :
|
126 |
+
$shipper = 'excellence_excellence';
|
127 |
+
$shippingCarrierTitle = 'DHL';
|
128 |
+
$shippingMethodTitle = 'Global Mail - iGlobal';
|
129 |
+
break;
|
130 |
+
case 'FEDEX_ECONOMY' :
|
131 |
+
$shipper = 'excellence_excellence';
|
132 |
+
$shippingCarrierTitle = 'FedExl';
|
133 |
+
$shippingMethodTitle = 'Economy - iGlobal';
|
134 |
+
break;
|
135 |
+
case 'FEDEX_GROUND' :
|
136 |
+
$shipper = 'excellence_excellence';
|
137 |
+
$shippingCarrierTitle = 'FedEx';
|
138 |
+
$shippingMethodTitle = 'Ground - iGlobal';
|
139 |
+
break;
|
140 |
+
case 'FEDEX_PRIORITY' :
|
141 |
+
$shipper = 'excellence_excellence';
|
142 |
+
$shippingCarrierTitle = 'FedEx';
|
143 |
+
$shippingMethodTitle = 'Priority - iGlobal';
|
144 |
+
break;
|
145 |
+
case 'UPS_EXPEDITED' :
|
146 |
+
$shipper = 'excellence_excellence';
|
147 |
+
$shippingCarrierTitle = 'UPS';
|
148 |
+
$shippingMethodTitle = 'Expedited - iGlobal';
|
149 |
+
break;
|
150 |
+
case 'UPS_EXPRESS' :
|
151 |
+
$shipper = 'excellence_excellence';
|
152 |
+
$shippingCarrierTitle = 'UPS';
|
153 |
+
$shippingMethodTitle = 'Express - iGlobal';
|
154 |
+
break;
|
155 |
+
case 'UPS_EXPRESS_SAVER':
|
156 |
+
$shipper = 'excellence_excellence';
|
157 |
+
$shippingCarrierTitle = 'UPS';
|
158 |
+
$shippingMethodTitle = 'Express Saver - iGlobal';
|
159 |
+
break;
|
160 |
+
case 'UPS_GROUND':
|
161 |
+
$shipper = 'excellence_excellence';
|
162 |
+
$shippingCarrierTitle = 'UPS';
|
163 |
+
$shippingMethodTitle = 'Canada Ground - iGlobal';
|
164 |
+
break;
|
165 |
+
case 'UPS_STANDARD' :
|
166 |
+
$shipper = 'excellence_excellence';
|
167 |
+
$shippingCarrierTitle = 'UPS';
|
168 |
+
$shippingMethodTitle = 'Canada Standard - iGlobal';
|
169 |
+
break;
|
170 |
+
case 'USPS_FIRST_CLASS_MAIL_INTERNATIONAL' :
|
171 |
+
$shipper = 'excellence_excellence';
|
172 |
+
$shippingCarrierTitle = 'USPS';
|
173 |
+
$shippingMethodTitle = 'First Class Mail, International - iGlobal';
|
174 |
+
break;
|
175 |
+
case 'USPS_PRIORITY_MAIL_EXPRESS_INTERNATIONAL' :
|
176 |
+
$shipper = 'excellence_excellence';
|
177 |
+
$shippingCarrierTitle = 'USPS';
|
178 |
+
$shippingMethodTitle = 'Priority Mail Express, International - iGlobal';
|
179 |
+
break;
|
180 |
+
case 'USPS_PRIORITY_MAIL_INTERNATIONAL' :
|
181 |
+
$shipper = 'excellence_excellence';
|
182 |
+
$shippingCarrierTitle = 'USPS';
|
183 |
+
$shippingMethodTitle = 'Priority Mail, International - iGlobal';
|
184 |
+
break;
|
185 |
+
case 'APC_EXPEDITED_MAIL' :
|
186 |
+
$shipper = 'excellence_excellence';
|
187 |
+
$shippingCarrierTitle = 'UPS';
|
188 |
+
$shippingMethodTitle = 'APC Expedited 3-5 Days - iGlobal';
|
189 |
+
break;
|
190 |
+
case 'APC_PRIORITY_MAIL' :
|
191 |
+
$shipper = 'excellence_excellence';
|
192 |
+
$shippingCarrierTitle = 'UPS';
|
193 |
+
$shippingMethodTitle = 'APC Priority Mail 4-9 Days - iGlobal';
|
194 |
+
break;
|
195 |
+
case 'CANADA_POST_EXPEDITED' :
|
196 |
+
$shipper = 'excellence_excellence';
|
197 |
+
$shippingCarrierTitle = 'UPS';
|
198 |
+
$shippingMethodTitle = 'Canada Post Expedited - iGlobal';
|
199 |
+
break;
|
200 |
+
case 'FEDEX_IPD' :
|
201 |
+
$shipper = 'excellence_excellence';
|
202 |
+
$shippingCarrierTitle = 'UPS';
|
203 |
+
$shippingMethodTitle = 'FedEx IPD - iGlobal';
|
204 |
+
break;
|
205 |
+
case 'UPS_2ND_DAY_AIR' :
|
206 |
+
$shipper = 'excellence_excellence';
|
207 |
+
$shippingCarrierTitle = 'UPS';
|
208 |
+
$shippingMethodTitle = 'UPS 2 Day Air - iGlobal';
|
209 |
+
break;
|
210 |
+
case 'UPS_3_DAY_AIR' :
|
211 |
+
$shipper = 'excellence_excellence';
|
212 |
+
$shippingCarrierTitle = 'UPS';
|
213 |
+
$shippingMethodTitle = 'UPS 3 Day Air - iGlobal';
|
214 |
+
break;
|
215 |
+
case 'UPS_FREIGHT' :
|
216 |
+
$shipper = 'excellence_excellence';
|
217 |
+
$shippingCarrierTitle = 'UPS';
|
218 |
+
$shippingMethodTitle = 'UPS Freight - iGlobal';
|
219 |
+
break;
|
220 |
+
case 'UPS_MAIL_INNOVATIONS' :
|
221 |
+
$shipper = 'excellence_excellence';
|
222 |
+
$shippingCarrierTitle = 'UPS';
|
223 |
+
$shippingMethodTitle = 'Bodyguardz - UPS Mail Innovations - iGlobal';
|
224 |
+
break;
|
225 |
+
case 'UPS_NEXT_DAY_AIR_SAVER' :
|
226 |
+
$shipper = 'excellence_excellence';
|
227 |
+
$shippingCarrierTitle = 'UPS';
|
228 |
+
$shippingMethodTitle = 'UPS Next Day Air Saver - iGlobal';
|
229 |
+
break;
|
230 |
+
case 'UPS_WORLDEASE' :
|
231 |
+
$shipper = 'excellence_excellence';
|
232 |
+
$shippingCarrierTitle = 'UPS';
|
233 |
+
$shippingMethodTitle = 'UPS WorldEase - iGlobal';
|
234 |
+
break;
|
235 |
+
case 'USPS_EPACKET' :
|
236 |
+
$shipper = 'excellence_excellence';
|
237 |
+
$shippingCarrierTitle = 'UPS';
|
238 |
+
$shippingMethodTitle = 'USPS ePacket - iGlobal';
|
239 |
+
break;
|
240 |
+
case 'USPS_EXPRESS_1' :
|
241 |
+
$shipper = 'excellence_excellence';
|
242 |
+
$shippingCarrierTitle = 'UPS';
|
243 |
+
$shippingMethodTitle = 'Express 1 Mail - iGlobal';
|
244 |
+
break;
|
245 |
+
case 'USPS_IPA' :
|
246 |
+
$shipper = 'excellence_excellence';
|
247 |
+
$shippingCarrierTitle = 'UPS';
|
248 |
+
$shippingMethodTitle = 'USPS IPA - iGlobal';
|
249 |
+
break;
|
250 |
+
case 'LANDMARK_LGINTREGU':
|
251 |
+
case 'LANDMARK_LGINTSTD':
|
252 |
+
case 'LANDMARK_LGINTSTDU':
|
253 |
+
case 'MSI_PARCEL':
|
254 |
+
case 'MSI_PRIORITY':
|
255 |
+
$shipper = 'excellence_excellence';
|
256 |
+
$shippingCarrierTitle = 'iGlobal';
|
257 |
+
$shippingMethodTitle = 'Landmark';
|
258 |
+
break;
|
259 |
+
default:
|
260 |
+
$shipper = 'excellence_excellence';
|
261 |
+
$shippingCarrierTitle = 'iGlobal';
|
262 |
+
$shippingMethodTitle = 'International Shipping';
|
263 |
+
}
|
264 |
+
|
265 |
+
//Add things to the register so they can be used by the shipping method
|
266 |
+
Mage::register('shipping_cost', $shippingRate);
|
267 |
+
Mage::register('shipping_carriertitle', $shippingCarrierTitle);
|
268 |
+
Mage::register('shipping_methodtitle', $shippingMethodTitle);
|
269 |
+
|
270 |
+
//set shipping info
|
271 |
+
$billingAddress = $quote->getBillingAddress()->addData($billingAddressData);
|
272 |
+
$shippingAddress = $quote->getShippingAddress()->addData($addressData);
|
273 |
+
$shippingAddress->setCollectShippingRates(true)->collectShippingRates()
|
274 |
+
->setShippingMethod('excellence_excellence')
|
275 |
+
->setPaymentMethod('iGlobalCreditCard');
|
276 |
+
|
277 |
+
|
278 |
+
//updates payment type in Magento Admin area
|
279 |
+
$paymentMethod = $data ['paymentProcessing'] ['paymentGateway'];
|
280 |
+
if($paymentMethod === 'iGlobal_CC'){
|
281 |
+
$paymentType = 'iGlobalCreditCard';
|
282 |
+
} else if ($paymentMethod === 'iGlobal PayPal') {
|
283 |
+
$paymentType = 'iGlobalPaypal';
|
284 |
+
} else {
|
285 |
+
$paymentType = 'iGlobal';
|
286 |
+
};
|
287 |
+
|
288 |
+
$quote->getPayment()->importData(array('method' => $paymentType));
|
289 |
+
|
290 |
+
$quote->collectTotals()->save();
|
291 |
+
$quote->setIsActive(0)->save();
|
292 |
+
|
293 |
+
$service = Mage::getModel('stores/service_quote', $quote);
|
294 |
+
$service->submitAll();
|
295 |
+
$order = $service->getOrder();
|
296 |
+
|
297 |
+
|
298 |
+
// cleaning up
|
299 |
+
Mage::getSingleton('checkout/session')->clear();
|
300 |
+
|
301 |
+
$id = $order->getEntityId();
|
302 |
+
|
303 |
+
Mage::getSingleton('checkout/session')->setLastOrderId($order->getId());
|
304 |
+
Mage::getSingleton('checkout/session')->setLastRealOrderId($order->getIncrementId());
|
305 |
+
|
306 |
+
|
307 |
+
$transId = Mage::getSingleton('checkout/session')->getLastRealOrderId($order->getIncrementId());
|
308 |
+
|
309 |
+
|
310 |
+
//Save Order Invoice as paid
|
311 |
+
$commentMessage = 'Order automatically imported from iGlobal order ID: '. $_order;
|
312 |
+
|
313 |
+
try {
|
314 |
+
$order = Mage::getModel("sales/order")->load($id);
|
315 |
+
//add trans ID
|
316 |
+
$transaction_id = '34234234234'; //todo: this needs to be set dynamically
|
317 |
+
$transaction = Mage::getModel('sales/order_payment_transaction');
|
318 |
+
$transaction->setOrderPaymentObject($order->getPayment());
|
319 |
+
$transaction->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
|
320 |
+
$transaction->setTxnId($transaction_id);
|
321 |
+
$transaction->save();
|
322 |
+
|
323 |
+
$invoices = Mage::getModel('sales/order_invoice')->getCollection()->addAttributeToFilter('order_id', array('eq'=>$order->getId()));
|
324 |
+
$invoices->getSelect()->limit(1);
|
325 |
+
if ((int)$invoices->count() == 0 && $order->getState() == Mage_Sales_Model_Order::STATE_NEW) {
|
326 |
+
if(!$order->canInvoice()) {
|
327 |
+
$order->addStatusHistoryComment($commentMessage, false);
|
328 |
+
$order->addStatusHistoryComment('iGlobal: Order cannot be invoiced', false);
|
329 |
+
$order->save();
|
330 |
+
} else {
|
331 |
+
$order->addStatusHistoryComment($commentMessage, false);
|
332 |
+
$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
|
333 |
+
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
|
334 |
+
$invoice->register();
|
335 |
+
$invoice->getOrder()->setCustomerNoteNotify(false);
|
336 |
+
$invoice->getOrder()->setIsInProcess(true);
|
337 |
+
$order->addStatusHistoryComment('Automatically INVOICED by iGlobal', false);
|
338 |
+
$transactionSave = Mage::getModel('core/resource_transaction')
|
339 |
+
->addObject($invoice)
|
340 |
+
->addObject($invoice->getOrder());
|
341 |
+
$transactionSave->save();
|
342 |
+
}
|
343 |
+
}
|
344 |
+
} catch (Exception $e) {
|
345 |
+
$order->addStatusHistoryComment('iGlobal Invoicer: Exception occurred during automatically invoicing. Exception message: '.$e->getMessage(), false);
|
346 |
+
$order->save();
|
347 |
+
}
|
348 |
+
|
349 |
+
if ($data['testOrder'] == 'true') {
|
350 |
+
//Set the international_order flag and the ig_order_number on the order and mark as a test order
|
351 |
+
$query = "UPDATE `" . $tableName . "` SET `international_order` = 1, `ig_order_number` = '{$_order}', `iglobal_test_order` = 1 WHERE `entity_id` = '{$id}'";
|
352 |
+
Mage::getSingleton('core/resource')->getConnection('core_write')->query($query);
|
353 |
+
} else {
|
354 |
+
//Set the international_order flag and the ig_order_number on the order
|
355 |
+
$query = "UPDATE `" . $tableName . "` SET `international_order` = 1, `ig_order_number` = '{$_order}' WHERE `entity_id` = '{$id}'";
|
356 |
+
Mage::getSingleton('core/resource')->getConnection('core_write')->query($query);
|
357 |
+
}
|
358 |
+
|
359 |
+
//Send the magento id to iGlobal
|
360 |
+
$rest->sendMagentoOrderId($_order, $id);
|
361 |
|
362 |
}
|
363 |
catch(Exception $e)
|
364 |
{
|
365 |
+
$adminEmail = false;
|
366 |
+
//die($e);
|
367 |
+
if (Mage::getStoreConfig('iglobal_integration/apireqs/admin_email')) {
|
368 |
+
$adminEmail = Mage::getStoreConfig('iglobal_integration/apireqs/admin_email');
|
369 |
+
}
|
370 |
+
mail('monitoring@iglobalstores.com', 'Magento Integration Error - International order failed to import', 'International order# '. $_order .'.'. ' Exception Message: '.$e->getMessage());
|
371 |
+
mail('magentomissedorders@iglobalstores.com', 'Magento Integration Error - International order failed to import', 'International order# '. $_order .'.'. ' Exception Message: '.$e->getMessage());
|
372 |
+
if ($adminEmail) {
|
373 |
+
mail($adminEmail, 'iGlobal Import Error - International order failed to import', 'iGlobal International order# '. $_order . " failed to import properly. We've already received notice of the problem, and are probably working on it as you read this. Until then, you may manually enter the order, or give us a call for help at 1-800-942-0721." );
|
374 |
+
}
|
375 |
+
Mage::log("International order #{$_order} failed to import!" .$e, Zend_Log::ERR, 'iglobal.log', true);
|
376 |
}
|
377 |
|
378 |
$this->loadLayout();
|
app/code/community/Iglobal/Stores/controllers/TestController.php
DELETED
@@ -1,166 +0,0 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
<?php
|
4 |
-
|
5 |
-
class Iglobal_Stores_TestController extends Mage_Core_Controller_Front_Action
|
6 |
-
{
|
7 |
-
public function indexAction()
|
8 |
-
{
|
9 |
-
|
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 |
-
echo "Data in controller: <br />";
|
19 |
-
Zend_Debug::dump($data);
|
20 |
-
|
21 |
-
$_name = explode(' ', $data['name'], 2);
|
22 |
-
if ($data['testOrder'] == "true") {
|
23 |
-
$name_first = "TEST ORDER! DO NOT SHIP! - " . array_shift($_name);
|
24 |
-
$name_last = array_pop($_name);
|
25 |
-
} else {
|
26 |
-
$name_first = array_shift($_name);
|
27 |
-
$name_last = array_pop($_name);
|
28 |
-
}
|
29 |
-
|
30 |
-
$street = $data['address2'] ? array($data['address1'], $data['address2']) : $data['address1'];
|
31 |
-
|
32 |
-
// to fix error with countries w/o zip codes
|
33 |
-
if (is_array($data['zip'])){
|
34 |
-
$igcZipCode = ' ';
|
35 |
-
}else {
|
36 |
-
$igcZipCode = $data['zip'];
|
37 |
-
}
|
38 |
-
|
39 |
-
$addressData = array(
|
40 |
-
'firstname' => $name_first,
|
41 |
-
'lastname' => $name_last,
|
42 |
-
'street' => $street,
|
43 |
-
'city' => $data['city'],
|
44 |
-
'postcode' => $igcZipCode,
|
45 |
-
'telephone' => $data['phone'],
|
46 |
-
'region' => $data['state'],
|
47 |
-
//'region' => 'utah',
|
48 |
-
//'region_id' => 'ut',
|
49 |
-
'country_id' => $data['countryCode'],
|
50 |
-
'company' => $data['company'],
|
51 |
-
);
|
52 |
-
|
53 |
-
$billingCheckVar = $data['billingAddress1'];
|
54 |
-
if (!empty($billingCheckVar)){
|
55 |
-
$_nameBilling = explode(' ', $data['billingName'], 2);
|
56 |
-
if ($data['testOrder'] == "true") {
|
57 |
-
$name_first_billing = "TEST ORDER! DO NOT SHIP! - " . array_shift($_nameBilling);
|
58 |
-
$name_last_billing = array_pop($_nameBilling);
|
59 |
-
} else {
|
60 |
-
$name_first_billing = array_shift($_nameBilling);
|
61 |
-
$name_last_billing = array_pop($_nameBilling);
|
62 |
-
}
|
63 |
-
|
64 |
-
|
65 |
-
$streetBilling = $data['billingAddress2'] ? array($data['billingAddress1'], $data['billingAddress2']) : $data['billingAddress1'];
|
66 |
-
|
67 |
-
// to fix error with countries w/o zip codes
|
68 |
-
if (is_array($data['billingZip'])){
|
69 |
-
$igcZipCodeBilling = ' ';
|
70 |
-
}else {
|
71 |
-
$igcZipCodeBilling = $data['billingZip'];
|
72 |
-
}
|
73 |
-
|
74 |
-
$billingAddressData = array(
|
75 |
-
'firstname' => $name_first_billing,
|
76 |
-
'lastname' => $name_last_billing,
|
77 |
-
'street' => $streetBilling,
|
78 |
-
'city' => $data['billingCity'],
|
79 |
-
'postcode' => $igcZipCodeBilling,
|
80 |
-
'telephone' => $data['billingPhone'],
|
81 |
-
'region' => $data['billingState'],
|
82 |
-
'country_id' => $data['billingCountryCode'],
|
83 |
-
);
|
84 |
-
} else {
|
85 |
-
$billingAddressData = $addressData;
|
86 |
-
}
|
87 |
-
echo "Address Data: <br />";
|
88 |
-
Zend_Debug::dump($addressData);
|
89 |
-
|
90 |
-
|
91 |
-
echo "Billing Address Data: <br />";
|
92 |
-
Zend_Debug::dump($billingAddressData);
|
93 |
-
/*
|
94 |
-
// Load the session
|
95 |
-
$session = Mage::getModel('checkout/cart');
|
96 |
-
// Array to hold the final result
|
97 |
-
$finalResult = array();
|
98 |
-
// Loop through all items in the cart
|
99 |
-
foreach ($session->getQuote()->getAllItems() as $item)
|
100 |
-
{
|
101 |
-
// Array to hold the item's options
|
102 |
-
$result = array();
|
103 |
-
// Load the configured product options
|
104 |
-
$options = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct());
|
105 |
-
echo 'Options: <br />';
|
106 |
-
Zend_Debug::dump($options);
|
107 |
-
// Check for options
|
108 |
-
if ($options)
|
109 |
-
{
|
110 |
-
if (isset($options['options']))
|
111 |
-
{
|
112 |
-
$result = array_merge($result, $options['options']);
|
113 |
-
}
|
114 |
-
echo 'result: <br />';
|
115 |
-
Zend_Debug::dump($result);
|
116 |
-
|
117 |
-
$igOptionList = '<dl class="item-options">';
|
118 |
-
foreach ($result as $optionDetails) {
|
119 |
-
//$_formatedOptionValue = $this->getFormatedOptionValue($optionDetails);
|
120 |
-
$label = '<dt>' . $optionDetails['label'] . '</dt>';
|
121 |
-
$value = '<dd>' . $optionDetails['value'] .'</dd>';
|
122 |
-
$igOptionList = $igOptionList . $label . $value;
|
123 |
-
}
|
124 |
-
$igOptionList = $igOptionList . '</dl>';
|
125 |
-
|
126 |
-
echo 'my list: <br />';
|
127 |
-
Zend_Debug::dump($igOptionList);
|
128 |
-
|
129 |
-
echo 'my result: '.$result['label'] .':'.$result['value'];
|
130 |
-
|
131 |
-
/* if (isset($options['additionaloptionDetailss']))
|
132 |
-
{
|
133 |
-
$result = array_merge($result, $options['additionaloptionDetailss']);
|
134 |
-
}
|
135 |
-
if (!empty($options['attributes_info']))
|
136 |
-
{
|
137 |
-
$result = array_merge($options['attributes_info'], $result);
|
138 |
-
}
|
139 |
-
}
|
140 |
-
$finalResult = array_merge($finalResult, $result);
|
141 |
-
}
|
142 |
-
// Now you have the final array of all configured options
|
143 |
-
echo 'final result: <br />';
|
144 |
-
Zend_Debug::dump($finalResult);
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
echo '<div class="igTestDiv">';
|
149 |
-
if ($optionDetailss = Mage::getModel('catalog/product')->load($item->getProductId())->getOptionList()) {
|
150 |
-
$igOptionList = '<dl class="item-options">';
|
151 |
-
foreach ($optionDetailss as $optionDetails) {
|
152 |
-
$_formatedOptionValue = $this->getFormatedOptionValue($optionDetails);
|
153 |
-
$label = '<dt>' . $this->escapeHtml($optionDetails['label']) . '</dt>';
|
154 |
-
$value = '<dd>' . $_formatedOptionValue['full_view'] .'</dd>';
|
155 |
-
$igOptionList = $igOptionList . $lable . $value;
|
156 |
-
}
|
157 |
-
$igOptionList = $igOptionList . '</dl>';
|
158 |
-
}
|
159 |
-
echo $igOptionList;
|
160 |
-
echo '</div>';*/
|
161 |
-
|
162 |
-
}
|
163 |
-
|
164 |
-
|
165 |
-
}
|
166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Iglobal/Stores/controllers/UpdateShippingStatusController.php
DELETED
@@ -1,72 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Iglobal_Stores_UpdateShippingStatusController extends Mage_Core_Controller_Front_Action
|
4 |
-
{
|
5 |
-
public function indexAction()
|
6 |
-
{
|
7 |
-
|
8 |
-
$reader = Mage::getSingleton('core/resource')->getConnection('core_read');
|
9 |
-
$writer = Mage::getSingleton('core/resource')->getConnection('core_write');
|
10 |
-
|
11 |
-
$openOrderQuery = "Select * from `sales_flat_order` where `international_order` = 1 AND `ig_order_number` IS NOT NULL AND `state` <> 'complete' AND `state` <> 'closed' AND `state` <> 'canceled' AND `state` <> 'holded'";
|
12 |
-
$openOrders = $reader->fetchAll($openOrderQuery);
|
13 |
-
|
14 |
-
$rest = Mage::getModel('stores/rest_order');
|
15 |
-
|
16 |
-
$ordersShown = 0;
|
17 |
-
foreach ($openOrders as $openOrder) {
|
18 |
-
echo "<div style='border:solid 1px blue; margin: 15px;'>Processing Order: " . $openOrder['entity_id'] . " | increment id: " . $openOrder['increment_id'] . " | igOrderNumber: " . $openOrder['ig_order_number'] . " | state: " . $openOrder['state'] . " | status: " . $openOrder['status'];
|
19 |
-
|
20 |
-
//Get Order Data
|
21 |
-
$data = $rest->getOrder($openOrder['ig_order_number']);
|
22 |
-
echo "<br>iGlobal Shipping Status: " . $data['shippingStatus'];
|
23 |
-
|
24 |
-
//If the shipping status is end of day, then complete the order in magento
|
25 |
-
if ($data["shippingStatus"] == "VENDOR_END_OF_DAY_COMPLETE") {
|
26 |
-
$order = Mage::getModel("sales/order")->load($openOrder['entity_id']);
|
27 |
-
try {
|
28 |
-
|
29 |
-
if ($order->canShip()) {
|
30 |
-
$shipment = $order->prepareShipment();
|
31 |
-
$shipment->register();
|
32 |
-
$order->setIsInProcess(true);
|
33 |
-
$order->addStatusHistoryComment('Automatically SHIPPED by iGlobal.', false);
|
34 |
-
$transactionSave = Mage::getModel('core/resource_transaction')
|
35 |
-
->addObject($shipment)
|
36 |
-
->addObject($shipment->getOrder())
|
37 |
-
->save();
|
38 |
-
|
39 |
-
if (!empty($data["trackingNumber"])) {
|
40 |
-
//Add the tracking number "track_number"
|
41 |
-
$track = Mage::getModel('sales/order_shipment_track')
|
42 |
-
->setShipment($shipment)
|
43 |
-
->setData('title', 'iGlobal Stores')
|
44 |
-
->setData('number', $data["trackingNumber"])
|
45 |
-
->setData('carrier_code', 'custom')
|
46 |
-
->setData('order_id', $shipment->getData('order_id'))
|
47 |
-
->save();
|
48 |
-
}
|
49 |
-
|
50 |
-
}
|
51 |
-
echo "<br>Marking Order as Completed";
|
52 |
-
} catch (Exception $e) {
|
53 |
-
$order->addStatusHistoryComment('iGlobal Shipper: Exception occurred during automatically shipping. Exception message: '.$e->getMessage(), false);
|
54 |
-
$order->save();
|
55 |
-
echo "<br>An Error Occurred while trying to mark Order as Completed";
|
56 |
-
}
|
57 |
-
} else {
|
58 |
-
echo "<br>Skipping Order";
|
59 |
-
}
|
60 |
-
|
61 |
-
echo "</div>";
|
62 |
-
|
63 |
-
$ordersShown++;
|
64 |
-
}
|
65 |
-
|
66 |
-
if ($ordersShown < 1) {
|
67 |
-
echo "No active iGlobal orders to process";
|
68 |
-
}
|
69 |
-
|
70 |
-
}
|
71 |
-
|
72 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Iglobal/Stores/controllers/carbonfiber.php
DELETED
@@ -1,357 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Iglobal_Stores_SuccessController extends Mage_Core_Controller_Front_Action
|
4 |
-
{
|
5 |
-
public function indexAction()
|
6 |
-
{
|
7 |
-
|
8 |
-
$_order = $this->getRequest()->getParam('orderId', null);
|
9 |
-
try
|
10 |
-
{
|
11 |
-
/*
|
12 |
-
Mage::log('in the try', null, 'iglobal.log');
|
13 |
-
|
14 |
-
//try and log the whole trace to see what is calling this
|
15 |
-
Mage::log(' ******* Entered the controller. Begin backtrace: *******', null, 'mattscustom.log');
|
16 |
-
foreach(debug_backtrace() as $key=>$info)
|
17 |
-
{
|
18 |
-
Mage::Log("#" . $key .
|
19 |
-
" Called " .
|
20 |
-
$info['function'] .
|
21 |
-
" in " .
|
22 |
-
$info['file'] .
|
23 |
-
" on line " .
|
24 |
-
$info['line'], null, 'mattscustom.log');
|
25 |
-
}
|
26 |
-
*/
|
27 |
-
|
28 |
-
//Hello Matt
|
29 |
-
|
30 |
-
$quote = Mage::getSingleton('checkout/session')->getQuote()->setStoreId(Mage::app()->getStore()->getId())->setIsActive(false)->setIsMultiShipping(false)->save();//if more than one store, then this should be set dynamically
|
31 |
-
$table = "sales_flat_order";
|
32 |
-
$tableName = Mage::getSingleton("core/resource")->getTableName($table);
|
33 |
-
$existsQuery = "SELECT `entity_id` FROM `" . $tableName. "` WHERE `ig_order_number` = '{$_order}'";
|
34 |
-
//Mage::log('Exists Query: ' . $existsQuery, null, 'mattscustom.log');
|
35 |
-
$orderExists = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchRow($existsQuery);
|
36 |
-
//Mage::log('Order Exists: ' . $orderExists, null, 'mattscustom.log');
|
37 |
-
|
38 |
-
if(!$_order || $orderExists) header('Location: /');
|
39 |
-
|
40 |
-
//log that we passed the location change
|
41 |
-
// Mage::log('**** We made it past the the redirect: $_order and $orderExist are true ****', null, 'mattscustom.log');
|
42 |
-
|
43 |
-
$rest = Mage::getModel('stores/rest_order');
|
44 |
-
$data = $rest->getOrder($_order);
|
45 |
-
|
46 |
-
|
47 |
-
$quote->setCustomerEmail($data['email']);
|
48 |
-
//set ddp
|
49 |
-
$quote->setFeeAmount($data['dutyTaxesTotal']); //turn this back on to get the fee stff working again
|
50 |
-
|
51 |
-
$_name = explode(' ', $data['name'], 2);
|
52 |
-
if ($data['testOrder'] == "true") {
|
53 |
-
$name_first = "TEST ORDER! DO NOT SHIP! - " . array_shift($_name);
|
54 |
-
$name_last = array_pop($_name);
|
55 |
-
} else {
|
56 |
-
$name_first = array_shift($_name);
|
57 |
-
$name_last = array_pop($_name);
|
58 |
-
}
|
59 |
-
|
60 |
-
$quote->setCustomerFirstname($name_first);
|
61 |
-
$quote->setCustomerLastname($name_last);
|
62 |
-
|
63 |
-
$street = $data['address2'] ? array($data['address1'], $data['address2']) : $data['address1'];
|
64 |
-
|
65 |
-
// to fix error with countries w/o zip codes
|
66 |
-
if (is_array($data['zip'])){
|
67 |
-
$igcZipCode = ' ';
|
68 |
-
}else {
|
69 |
-
$igcZipCode = $data['zip'];
|
70 |
-
}
|
71 |
-
|
72 |
-
$addressData = array(
|
73 |
-
'firstname' => $name_first,
|
74 |
-
'lastname' => $name_last,
|
75 |
-
'street' => $street,
|
76 |
-
'city' => $data['city'],
|
77 |
-
'postcode' => $igcZipCode,
|
78 |
-
'telephone' => $data['phone'],
|
79 |
-
'region' => $data['state'],
|
80 |
-
'country_id' => $data['countryCode'],
|
81 |
-
'company' => $data['company'],
|
82 |
-
);
|
83 |
-
|
84 |
-
$billingCheckVar = $data['billingAddress1'];
|
85 |
-
if (!empty($billingCheckVar)){
|
86 |
-
$_nameBilling = explode(' ', $data['billingName'], 2);
|
87 |
-
if ($data['testOrder'] == "true") {
|
88 |
-
$name_first_billing = "TEST ORDER! DO NOT SHIP! - " . array_shift($_nameBilling);
|
89 |
-
$name_last_billing = array_pop($_nameBilling);
|
90 |
-
} else {
|
91 |
-
$name_first_billing = array_shift($_nameBilling);
|
92 |
-
$name_last_billing = array_pop($_nameBilling);
|
93 |
-
}
|
94 |
-
|
95 |
-
|
96 |
-
$streetBilling = $data['billingAddress2'] ? array($data['billingAddress1'], $data['billingAddress2']) : $data['billingAddress1'];
|
97 |
-
|
98 |
-
// to fix error with countries w/o zip codes
|
99 |
-
if (is_array($data['billingZip'])){
|
100 |
-
$igcZipCodeBilling = ' ';
|
101 |
-
}else {
|
102 |
-
$igcZipCodeBilling = $data['billingZip'];
|
103 |
-
}
|
104 |
-
|
105 |
-
$billingAddressData = array(
|
106 |
-
'firstname' => $name_first_billing,
|
107 |
-
'lastname' => $name_last_billing,
|
108 |
-
'street' => $streetBilling,
|
109 |
-
'city' => $data['billingCity'],
|
110 |
-
'postcode' => $igcZipCodeBilling,
|
111 |
-
'telephone' => $data['billingPhone'],
|
112 |
-
'region' => $data['billingState'],
|
113 |
-
'country_id' => $data['billingCountryCode'],
|
114 |
-
);
|
115 |
-
} else {
|
116 |
-
$billingAddressData = $addressData;
|
117 |
-
}
|
118 |
-
Mage::log('address data: ' . print_r($addressData, true), null, 'mattscustom.log', true);
|
119 |
-
|
120 |
-
Mage::log('billing address data: ' . print_r($billingAddressData, true), null, 'mattscustom.log', true);
|
121 |
-
/*
|
122 |
-
// 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.
|
123 |
-
$methods = Mage::getSingleton('shipping/config')->getActiveCarriers();
|
124 |
-
$shipping = array();
|
125 |
-
foreach($methods as $_ccode => $_carrier) {
|
126 |
-
if($_methods = $_carrier->getAllowedMethods()) {
|
127 |
-
if(!$_title = Mage::getStoreConfig("carriers/$_ccode/title"))
|
128 |
-
$_title = $_ccode;
|
129 |
-
foreach($_methods as $_mcode => $_method) {
|
130 |
-
$_code = $_ccode . '_' . $_mcode;
|
131 |
-
$shipping[$_code]=array('title' => $_method,'carrier' => $_title);
|
132 |
-
}
|
133 |
-
}
|
134 |
-
}
|
135 |
-
|
136 |
-
//matches XML shipping level with Magento carrier code
|
137 |
-
|
138 |
-
// shipping methods designed to use in store shipping methods already in place. changing this for our current version
|
139 |
-
set the shipping method name here, like in the code below
|
140 |
-
//matches XML shipping level with Magento carrier code
|
141 |
-
|
142 |
-
used if you are trying to validate shipping method against merchent avaialable methods to use their built in modules
|
143 |
-
$shippingRate = $data['shippingTotal'];
|
144 |
-
if (!$shippingCarrierTitle || !$shippingMethodTItle){
|
145 |
-
if(!$shippingCarrierTitle && $shipping [$shipper]['carrier']) {
|
146 |
-
$shippingCarrierTitle = $shipping [$shipper]['carrier'];// 'Starship Spamblaster';
|
147 |
-
} elseif (!$shippingCarrierTitle) {
|
148 |
-
$shippingCarrierTitle = 'iGlobal';
|
149 |
-
}
|
150 |
-
if (!$shippingMethodTItle && $shipping [$shipper]['title']){
|
151 |
-
$shippingMethodTitle = $shipping [$shipper]['title'];//'Operation: Tickle Fight';
|
152 |
-
} elseif (!$shippingMethodTItle) {
|
153 |
-
$shippingMethodTitle = 'International Shipping';
|
154 |
-
}
|
155 |
-
}
|
156 |
-
*/
|
157 |
-
$shippingRate = $data['shippingTotal'];
|
158 |
-
$shippingCarrierMethod = $data['shippingCarrierServiceLevel'];
|
159 |
-
switch ($shippingCarrierMethod) {
|
160 |
-
case 'DHL_EXPRESS' :
|
161 |
-
$shipper = 'excellence_excellence';
|
162 |
-
$shippingCarrierTitle = 'DHL';
|
163 |
-
$shippingMethodTitle = 'Express - iGlobal';
|
164 |
-
break;
|
165 |
-
case 'DHL_GLOBAL_MAIL' :
|
166 |
-
$shipper = 'excellence_excellence';
|
167 |
-
$shippingCarrierTitle = 'DHL';
|
168 |
-
$shippingMethodTitle = 'Global Mail - iGlobal';
|
169 |
-
break;
|
170 |
-
case 'FEDEX_ECONOMY' :
|
171 |
-
$shipper = 'excellence_excellence';
|
172 |
-
$shippingCarrierTitle = 'FedExl';
|
173 |
-
$shippingMethodTitle = 'Economy - iGlobal';
|
174 |
-
break;
|
175 |
-
case 'FEDEX_GROUND' :
|
176 |
-
$shipper = 'excellence_excellence';
|
177 |
-
$shippingCarrierTitle = 'FedEx';
|
178 |
-
$shippingMethodTitle = 'Ground - iGlobal';
|
179 |
-
break;
|
180 |
-
case 'FEDEX_PRIORITY' :
|
181 |
-
$shipper = 'excellence_excellence';
|
182 |
-
$shippingCarrierTitle = 'FedEx';
|
183 |
-
$shippingMethodTitle = 'Priority - iGlobal';
|
184 |
-
break;
|
185 |
-
case 'UPS_EXPEDITED' :
|
186 |
-
$shipper = 'excellence_excellence';
|
187 |
-
$shippingCarrierTitle = 'UPS';
|
188 |
-
$shippingMethodTitle = 'Expedited - iGlobal';
|
189 |
-
break;
|
190 |
-
case 'UPS_EXPRESS' :
|
191 |
-
$shipper = 'excellence_excellence';
|
192 |
-
$shippingCarrierTitle = 'UPS';
|
193 |
-
$shippingMethodTitle = 'Express - iGlobal';
|
194 |
-
break;
|
195 |
-
case 'UPS_EXPRESS_SAVER':
|
196 |
-
$shipper = 'excellence_excellence';
|
197 |
-
$shippingCarrierTitle = 'UPS';
|
198 |
-
$shippingMethodTitle = 'Express Saver - iGlobal';
|
199 |
-
break;
|
200 |
-
case 'UPS_GROUND':
|
201 |
-
$shipper = 'excellence_excellence';
|
202 |
-
$shippingCarrierTitle = 'UPS';
|
203 |
-
$shippingMethodTitle = 'Ground - iGlobal';
|
204 |
-
break;
|
205 |
-
case 'UPS_STANDARD' :
|
206 |
-
$shipper = 'excellence_excellence';
|
207 |
-
$shippingCarrierTitle = 'UPS';
|
208 |
-
$shippingMethodTitle = 'Standard - iGlobal';
|
209 |
-
break;
|
210 |
-
case 'USPS_FIRST_CLASS_MAIL_INTERNATIONAL' :
|
211 |
-
$shipper = 'excellence_excellence';
|
212 |
-
$shippingCarrierTitle = 'USPS';
|
213 |
-
$shippingMethodTitle = 'First Class Mail, International - iGlobal';
|
214 |
-
break;
|
215 |
-
case 'USPS_PRIORITY_MAIL_EXPRESS_INTERNATIONAL' :
|
216 |
-
$shipper = 'excellence_excellence';
|
217 |
-
$shippingCarrierTitle = 'USPS';
|
218 |
-
$shippingMethodTitle = 'Priority Mail Express, International - iGlobal';
|
219 |
-
break;
|
220 |
-
case 'USPS_PRIORITY_MAIL_INTERNATIONAL' :
|
221 |
-
$shipper = 'excellence_excellence';
|
222 |
-
$shippingCarrierTitle = 'USPS';
|
223 |
-
$shippingMethodTitle = 'Priority Mail, International - iGlobal';
|
224 |
-
break;
|
225 |
-
case 'LANDMARK_LGINTREGU':
|
226 |
-
case 'LANDMARK_LGINTSTD':
|
227 |
-
case 'LANDMARK_LGINTSTDU':
|
228 |
-
case 'MSI_PARCEL':
|
229 |
-
case 'MSI_PRIORITY':
|
230 |
-
$shipper = 'excellence_excellence';
|
231 |
-
$shippingCarrierTitle = 'iGlobal';
|
232 |
-
$shippingMethodTitle = 'Landmark';
|
233 |
-
break;
|
234 |
-
default:
|
235 |
-
$shipper = 'excellence_excellence';
|
236 |
-
$shippingCarrierTitle = 'iGlobal';
|
237 |
-
$shippingMethodTitle = 'International Shipping';
|
238 |
-
}
|
239 |
-
|
240 |
-
Mage::register('shipping_cost', $shippingRate);
|
241 |
-
Mage::register('shipping_carriertitle', $shippingCarrierTitle);
|
242 |
-
Mage::register('shipping_methodtitle', $shippingMethodTitle);
|
243 |
-
|
244 |
-
//set shipping info
|
245 |
-
$billingAddress = $quote->getBillingAddress()->addData($billingAddressData);
|
246 |
-
$shippingAddress = $quote->getShippingAddress()->addData($addressData);
|
247 |
-
$shippingAddress->setCollectShippingRates(true)->collectShippingRates()
|
248 |
-
->setShippingMethod('excellence_excellence')
|
249 |
-
->setPaymentMethod('iGlobalCreditCard');
|
250 |
-
|
251 |
-
|
252 |
-
//updates payment type in Magento Admin area
|
253 |
-
$paymentMethod = $data ['paymentProcessing'] ['paymentGateway'];
|
254 |
-
if($paymentMethod === 'iGlobal_CC'){
|
255 |
-
$paymentType = 'iGlobalCreditCard';
|
256 |
-
} else if ($paymentMethod === 'iGlobal PayPal') {
|
257 |
-
$paymentType = 'iGlobalPaypal';
|
258 |
-
} else {
|
259 |
-
$paymentType = 'iGlobal';
|
260 |
-
};
|
261 |
-
|
262 |
-
$quote->getPayment()->importData(array('method' => $paymentType));
|
263 |
-
|
264 |
-
$quote->collectTotals()->save();
|
265 |
-
|
266 |
-
$service = Mage::getModel('stores/service_quote', $quote);
|
267 |
-
$service->submitAll();
|
268 |
-
$order = $service->getOrder();
|
269 |
-
|
270 |
-
|
271 |
-
// cleaning up
|
272 |
-
Mage::getSingleton('checkout/session')->clear();
|
273 |
-
|
274 |
-
//testing another way to clear up
|
275 |
-
//$storeId = Mage::app()->getStore()->getStoreId();
|
276 |
-
//$quoteId = Mage::getSingleton('checkout/session')->getQuoteId();
|
277 |
-
//Mage::getSingleton('checkout/session')->setLastQuoteId($quoteId))
|
278 |
-
//->setLastSuccessQuoteId($quoteId))
|
279 |
-
//->clearHelperData();
|
280 |
-
|
281 |
-
|
282 |
-
$id = $order->getEntityId();
|
283 |
-
|
284 |
-
Mage::getSingleton('checkout/session')->setLastOrderId($order->getId());
|
285 |
-
Mage::getSingleton('checkout/session')->setLastRealOrderId($order->getIncrementId());
|
286 |
-
|
287 |
-
//Save Order Invoice as paid
|
288 |
-
$commentMessage = 'Order automatically imported from iGlobal order ID: '. $_order;
|
289 |
-
|
290 |
-
try {
|
291 |
-
$order = Mage::getModel("sales/order")->load($id);
|
292 |
-
$invoices = Mage::getModel('sales/order_invoice')->getCollection()->addAttributeToFilter('order_id', array('eq'=>$order->getId()));
|
293 |
-
$invoices->getSelect()->limit(1);
|
294 |
-
if ((int)$invoices->count() == 0 && $order->getState() == Mage_Sales_Model_Order::STATE_NEW) {
|
295 |
-
if(!$order->canInvoice()) {
|
296 |
-
$order->addStatusHistoryComment($commentMessage, false);
|
297 |
-
$order->addStatusHistoryComment('iGlobal: Order cannot be invoiced', false);
|
298 |
-
$order->save();
|
299 |
-
} else {
|
300 |
-
$order->addStatusHistoryComment($commentMessage, false);
|
301 |
-
$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
|
302 |
-
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
|
303 |
-
$invoice->register();
|
304 |
-
$invoice->getOrder()->setCustomerNoteNotify(false);
|
305 |
-
$invoice->getOrder()->setIsInProcess(true);
|
306 |
-
$order->addStatusHistoryComment('Automatically INVOICED by iGlobal', false);
|
307 |
-
$transactionSave = Mage::getModel('core/resource_transaction')
|
308 |
-
->addObject($invoice)
|
309 |
-
->addObject($invoice->getOrder());
|
310 |
-
$transactionSave->save();
|
311 |
-
}
|
312 |
-
}
|
313 |
-
} catch (Exception $e) {
|
314 |
-
$order->addStatusHistoryComment('iGlobal Invoicer: Exception occurred during automatically invoicing. Exception message: '.$e->getMessage(), false);
|
315 |
-
$order->save();
|
316 |
-
}
|
317 |
-
|
318 |
-
if ($data['testOrder'] == 'true') {
|
319 |
-
//Set the international_order flag and the ig_order_number on the order
|
320 |
-
$query = "UPDATE `" . $tableName . "` SET `international_order` = 1, `ig_order_number` = '{$_order}', `iglobal_test_order` = 1 WHERE `entity_id` = '{$id}'";
|
321 |
-
Mage::getSingleton('core/resource')->getConnection('core_write')->query($query);
|
322 |
-
Mage::log('Test order: True Order Query: ' . $query, null, 'mattscustom.log', true);
|
323 |
-
} else {
|
324 |
-
//Set the international_order flag and the ig_order_number on the order
|
325 |
-
$query = "UPDATE `" . $tableName . "` SET `international_order` = 1, `ig_order_number` = '{$_order}' WHERE `entity_id` = '{$id}'";
|
326 |
-
Mage::getSingleton('core/resource')->getConnection('core_write')->query($query);
|
327 |
-
Mage::log('Test order: False Order Query: ' . $query, null, 'mattscustom.log', true);
|
328 |
-
}
|
329 |
-
|
330 |
-
//Send the magento id to iGlobal
|
331 |
-
$rest->sendMagentoOrderId($_order, $id);
|
332 |
-
|
333 |
-
}
|
334 |
-
catch(Exception $e)
|
335 |
-
{
|
336 |
-
//die($e);
|
337 |
-
if (Mage::getStoreConfig('iglobal_integration/apireqs/admin_email')) {
|
338 |
-
$adminEmail = Mage::getStoreConfig('iglobal_integration/apireqs/admin_email');
|
339 |
-
}
|
340 |
-
mail('monitoring@iglobalstores.com', 'Magento Integration Error - International order failed to import', 'International order# '. $_order .'.'. ' Exception Message: '.$e->getMessage());
|
341 |
-
if ($adminEmail) {
|
342 |
-
mail($adminEmail, 'iGlobal Import Error - International order failed to import', 'iGlobal International order# '. $_order . " failed to import properly. We've already received notice of the problem, and are probably working on it as you read this. Until then, you may manually enter the order, or give us a call for help at 1-800-942-0721." );
|
343 |
-
}
|
344 |
-
Mage::log("International order #{$_order} failed to import!" .$e, Zend_Log::ERR, 'iglobal.log', true);
|
345 |
-
//Mage::log($e->getMessage(), null, 'iglobal.log');
|
346 |
-
//Mage::log("Order Failed to Import Automatically" .$e, Zend_Log::ERR, 'iglobal.log', true);
|
347 |
-
}
|
348 |
-
|
349 |
-
$this->loadLayout();
|
350 |
-
|
351 |
-
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
|
352 |
-
Mage::dispatchEvent('checkout_onepage_controller_success_action', array('order_ids' => array($lastOrderId)));
|
353 |
-
|
354 |
-
$this->renderLayout();
|
355 |
-
}
|
356 |
-
|
357 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Iglobal/Stores/etc/config.xml
CHANGED
@@ -1,10 +1,8 @@
|
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
-
|
3 |
-
|
4 |
-
<config>
|
5 |
<modules>
|
6 |
<Iglobal_Stores>
|
7 |
-
<version>1.0
|
8 |
<currencies>
|
9 |
<AED></AED>
|
10 |
<ARS>&#8371;</ARS>
|
@@ -212,11 +210,21 @@
|
|
212 |
<stores>
|
213 |
<class>Iglobal_Stores_Block</class>
|
214 |
</stores>
|
|
|
|
|
|
|
|
|
|
|
215 |
</blocks>
|
216 |
<helpers>
|
217 |
<stores>
|
218 |
<class>Iglobal_Stores_Helper</class>
|
219 |
</stores>
|
|
|
|
|
|
|
|
|
|
|
220 |
</helpers>
|
221 |
<resources>
|
222 |
<iglobal_stores_setup>
|
@@ -278,6 +286,7 @@
|
|
278 |
<secret>Your API Code Goes Here</secret>
|
279 |
<iglobalid>Your Store ID Goes Here</iglobalid>
|
280 |
<ice_toggle>0</ice_toggle>
|
|
|
281 |
</apireqs>
|
282 |
<igmat>
|
283 |
<welcome_mat_active>0</welcome_mat_active>
|
@@ -329,7 +338,7 @@
|
|
329 |
<observers>
|
330 |
<iglobal_notification>
|
331 |
<type>singleton</type>
|
332 |
-
<class>stores/
|
333 |
<method>observe</method>
|
334 |
</iglobal_notification>
|
335 |
</observers>
|
1 |
<?xml version="1.0" encoding="UTF-8"?>
|
2 |
+
<config>
|
|
|
|
|
3 |
<modules>
|
4 |
<Iglobal_Stores>
|
5 |
+
<version>1.1.0</version>
|
6 |
<currencies>
|
7 |
<AED></AED>
|
8 |
<ARS>&#8371;</ARS>
|
210 |
<stores>
|
211 |
<class>Iglobal_Stores_Block</class>
|
212 |
</stores>
|
213 |
+
<checkout>
|
214 |
+
<rewrite>
|
215 |
+
<onepage_link>Iglobal_Stores_Block_Link</onepage_link>
|
216 |
+
</rewrite>
|
217 |
+
</checkout>
|
218 |
</blocks>
|
219 |
<helpers>
|
220 |
<stores>
|
221 |
<class>Iglobal_Stores_Helper</class>
|
222 |
</stores>
|
223 |
+
<checkout>
|
224 |
+
<rewrite>
|
225 |
+
<url>Iglobal_Stores_Helper_Url</url>
|
226 |
+
</rewrite>
|
227 |
+
</checkout>
|
228 |
</helpers>
|
229 |
<resources>
|
230 |
<iglobal_stores_setup>
|
286 |
<secret>Your API Code Goes Here</secret>
|
287 |
<iglobalid>Your Store ID Goes Here</iglobalid>
|
288 |
<ice_toggle>0</ice_toggle>
|
289 |
+
<use_iframe>1</use_iframe>
|
290 |
</apireqs>
|
291 |
<igmat>
|
292 |
<welcome_mat_active>0</welcome_mat_active>
|
338 |
<observers>
|
339 |
<iglobal_notification>
|
340 |
<type>singleton</type>
|
341 |
+
<class>stores/ddpd</class>
|
342 |
<method>observe</method>
|
343 |
</iglobal_notification>
|
344 |
</observers>
|
app/code/community/Iglobal/Stores/etc/system.xml
CHANGED
@@ -113,7 +113,7 @@
|
|
113 |
<show_in_default>1</show_in_default>
|
114 |
<show_in_website>1</show_in_website>
|
115 |
<show_in_store>1</show_in_store>
|
116 |
-
</ice>
|
117 |
|
118 |
<ice_toggle>
|
119 |
<label>Turn on International Checkout?</label>
|
@@ -123,8 +123,30 @@
|
|
123 |
<sort_order>5</sort_order>
|
124 |
<show_in_default>1</show_in_default>
|
125 |
<show_in_website>1</show_in_website>
|
126 |
-
<show_in_store>1</show_in_store>
|
127 |
</ice_toggle>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
|
129 |
<heading_error translate="label">
|
130 |
<label>Error Reporting</label>
|
@@ -280,6 +302,17 @@
|
|
280 |
<show_in_website>1</show_in_website>
|
281 |
<show_in_store>1</show_in_store>
|
282 |
</enabled>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
283 |
|
284 |
</fields>
|
285 |
</igjq>
|
113 |
<show_in_default>1</show_in_default>
|
114 |
<show_in_website>1</show_in_website>
|
115 |
<show_in_store>1</show_in_store>
|
116 |
+
</ice>
|
117 |
|
118 |
<ice_toggle>
|
119 |
<label>Turn on International Checkout?</label>
|
123 |
<sort_order>5</sort_order>
|
124 |
<show_in_default>1</show_in_default>
|
125 |
<show_in_website>1</show_in_website>
|
126 |
+
<show_in_store>1</show_in_store>
|
127 |
</ice_toggle>
|
128 |
+
|
129 |
+
<use_iframe>
|
130 |
+
<label>Embed iGlobal Checkout by iframe?</label>
|
131 |
+
<comment>Embed the iGlobal Checkout into your site, making customers feel more secure by seeing your url and improving the user experience.</comment>
|
132 |
+
<frontend_type>select</frontend_type>
|
133 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
134 |
+
<sort_order>42</sort_order>
|
135 |
+
<show_in_default>1</show_in_default>
|
136 |
+
<show_in_website>1</show_in_website>
|
137 |
+
<show_in_store>1</show_in_store>
|
138 |
+
</use_iframe>
|
139 |
+
|
140 |
+
<use_ice>
|
141 |
+
<label>Use an iCE Integration File?</label>
|
142 |
+
<comment>Turn on to use an iGlobal Connect Engine Integration Method instead of the default method. This should only be selected if suggested by an iGlobal Integration Specialist.</comment>
|
143 |
+
<frontend_type>select</frontend_type>
|
144 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
145 |
+
<sort_order>45</sort_order>
|
146 |
+
<show_in_default>1</show_in_default>
|
147 |
+
<show_in_website>1</show_in_website>
|
148 |
+
<show_in_store>1</show_in_store>
|
149 |
+
</use_ice>
|
150 |
|
151 |
<heading_error translate="label">
|
152 |
<label>Error Reporting</label>
|
302 |
<show_in_website>1</show_in_website>
|
303 |
<show_in_store>1</show_in_store>
|
304 |
</enabled>
|
305 |
+
|
306 |
+
<iglogging>
|
307 |
+
<label>Turn on iGlobal Logging?</label>
|
308 |
+
<comment>Turn on to enable iGlobal Logging. This can result in very large log files, so it's best to leave this off unless needed!</comment>
|
309 |
+
<frontend_type>select</frontend_type>
|
310 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
311 |
+
<sort_order>5</sort_order>
|
312 |
+
<show_in_default>1</show_in_default>
|
313 |
+
<show_in_website>1</show_in_website>
|
314 |
+
<show_in_store>1</show_in_store>
|
315 |
+
</iglogging>
|
316 |
|
317 |
</fields>
|
318 |
</igjq>
|
app/design/frontend/base/default/layout/iglobal.xml
CHANGED
@@ -31,6 +31,12 @@
|
|
31 |
<block type="core/template" name="iglobal.cart" as="iglobal.cart" template="iglobal/stores/cart.phtml"/>
|
32 |
</reference>
|
33 |
</checkout_cart_index>
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
|
35 |
<!-- set template for success page-->
|
36 |
<iglobal_success_index translate="label">
|
31 |
<block type="core/template" name="iglobal.cart" as="iglobal.cart" template="iglobal/stores/cart.phtml"/>
|
32 |
</reference>
|
33 |
</checkout_cart_index>
|
34 |
+
|
35 |
+
<checkout_onepage_index>
|
36 |
+
<reference name="content"> <!--can also reference content if there are problems with the theme -->
|
37 |
+
<block type="core/template" name="iglobal.cart" as="iglobal.cart" template="iglobal/stores/cart.phtml"/>
|
38 |
+
</reference>
|
39 |
+
</checkout_onepage_index>
|
40 |
|
41 |
<!-- set template for success page-->
|
42 |
<iglobal_success_index translate="label">
|
app/design/frontend/base/default/template/iglobal/checkout/onepage/link.phtml
ADDED
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magento.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magento.com for more information.
|
20 |
+
*
|
21 |
+
* @category design
|
22 |
+
* @package base_default
|
23 |
+
* @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
|
24 |
+
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
25 |
+
*/
|
26 |
+
?>
|
27 |
+
<?php if ($this->isPossibleOnepageCheckout()):?>
|
28 |
+
<button type="button" title="<?php echo $this->__('Proceed to Checkout') ?>" class="button btn-proceed-checkout btn-checkout<?php if ($this->isDisabled()):?> no-checkout<?php endif; ?>"<?php if ($this->isDisabled()):?> disabled="disabled"<?php endif; ?> onclick="<?php echo $this->getCheckoutUrl() ?>;"><span><span><?php echo $this->__('Proceed to Checkout') ?></span></span></button>
|
29 |
+
<?php endif?>
|
30 |
+
|
app/design/frontend/base/default/template/iglobal/stores/igcincludes.phtml
CHANGED
@@ -40,7 +40,7 @@
|
|
40 |
}
|
41 |
|
42 |
//set includes for ICE and main
|
43 |
-
if (Mage::getStoreConfig('iglobal_integration/apireqs/ice_toggle') && ((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>';
|
40 |
}
|
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>';
|
js/iGlobal/ig_welcome_mat_default.js
CHANGED
@@ -18,6 +18,23 @@ 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 |
//
|
@@ -712,6 +729,7 @@ function ig_countrySelected() {
|
|
712 |
ig_setCountry(ig_validateCountryCode(countryCode));
|
713 |
igJq("#igSplashElement").html(ig_createSplashContentsHtml());
|
714 |
ig_alertIceOfCountryChange();
|
|
|
715 |
}
|
716 |
|
717 |
//Called by auto popup logic for first time non domestic country customers. Also called by ALL customers clicking the nested flag on the page
|
18 |
var ajaxPath = '/iglobal/ajax/matdata';
|
19 |
//ajaxPath = '/magento/index.php/iglobal/ajax/matdata'; //override used on some testing installs
|
20 |
|
21 |
+
var hrefMagento = false,
|
22 |
+
var hrefIndex = false,
|
23 |
+
url = window.location.toString(),
|
24 |
+
ajaxPath = "";
|
25 |
+
|
26 |
+
hrefMagento = url.indexOf('/magento');
|
27 |
+
hrefIndex = url.indexOf('/index.php');
|
28 |
+
|
29 |
+
if (hrefMagento != -1 && hrefIndex != -1) {
|
30 |
+
ajaxPath = '/magento/index.php/iglobal/ajax/matdata';
|
31 |
+
} else if (hrefMagento != -1 && hrefIndex == -1) {
|
32 |
+
ajaxPath = '/magento/iglobal/ajax/matdata';
|
33 |
+
} else if (hrefMagento == -1 && hrefIndex != -1) {
|
34 |
+
ajaxPath = '/iglobal/ajax/matdata';
|
35 |
+
}
|
36 |
+
|
37 |
+
|
38 |
// Set internal JQuery Variable
|
39 |
// Can set to existing $ on page, or can include Jquery here, and set igJq to jquery-no-conflict
|
40 |
//
|
729 |
ig_setCountry(ig_validateCountryCode(countryCode));
|
730 |
igJq("#igSplashElement").html(ig_createSplashContentsHtml());
|
731 |
ig_alertIceOfCountryChange();
|
732 |
+
location.reload();
|
733 |
}
|
734 |
|
735 |
//Called by auto popup logic for first time non domestic country customers. Also called by ALL customers clicking the nested flag on the page
|
js/iGlobal/igc.cs.magento_default_ice.js
CHANGED
@@ -167,7 +167,7 @@ $igc(document).ready(function(){
|
|
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 |
}
|
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 |
}
|
package.xml
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Iglobal_Main</name>
|
4 |
-
<version>1.0
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>
|
10 |
<description>International eCommerce Done Right
|
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
|
12 |

|
@@ -18,58 +18,25 @@ Duty, Tax, VAT? Done. - Calculate customs, duties, taxes and VAT and let your cu
|
|
18 |

|
19 |
Your Shipping Carriers - Work with the shipping carriers of your choice, at your rates.
|
20 |

|
21 |
-
Direct Shipping to the World- Ship directly from your warehouse to anywhere in the world with iGlobal Stores
|
22 |

|
23 |
Their Currency - Show customers their order totals in their local currency, making the buying decision that much easier
|
24 |

|
25 |
Your Payment Processor or Ours - Use your own payment processor or leverage the integrated payment system to settle in foreign currencies - it's up to you.
|
26 |

|
27 |
Before You Install
|
28 |
-
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
|
29 |
-
|
30 |
-
|
31 |
-

|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
<li><strong>iGlobal API Key</strong> – Provided by iGlobal Stores.</li>
|
41 |
-
<li><strong>ICE script</strong> – iGlobal Stores will customize an integration file for your store and provide you with the URL of that file.</li>
|
42 |
-
<li><strong>Use the Welcome Mat?</strong> – This turns the iGlobal Welcome Mat on or off with your integration.</li>
|
43 |
-
<li><strong>Welcome Mat Script File</strong> – iGlobal Stores will provide you with a customizable script file that you will upload here to be hosted from your Magento site.</li>
|
44 |
-
<li><strong>Welcome Mat CSS File</strong> – iGlobal Stores will provide you with a customizable CSS file for use with the Welcome Mat. You will upload it here to be hosted from your Magento site.</li>
|
45 |
-
<li><strong>Custom Install Path</strong> – This will be the default directory of your Magento installation. In many cases this will be your full domain name.</li>
|
46 |
-
<li><strong>jQuery</strong> – The iGlobal Stores Magento Extension requires jQuery on your site. If you do not already have jQuery installed you can easily include it on your pages by turning this feature on.</li>
|
47 |
-
</ul>
|
48 |
-
<li>Once the extension has been installed you will have new item attributes for:
|
49 |
-
<ul>
|
50 |
-
<li /><strong>iGlobal Length</strong> – Length attribute for your items for iGlobal Stores shipping estimates.</li>
|
51 |
-
<li><strong>iGlobal Width</strong> – Width attribute for your items for iGlobal Stores shipping estimates.</li>
|
52 |
-
<li><strong>iGlobal Height</strong> – Height attribute for your items for iGlobal Stores shipping estimates.</li>
|
53 |
-
<li><strong>iGlobal Weight</strong> – Weight attribute for your items for iGlobal Stores shipping estimates.</li>
|
54 |
-
<li><strong>iGlobal Weight Units</strong> – Unit of measure for the iGlobal Weight attribute. (LB / OZ / G / KG)</li>
|
55 |
-
<li><strong>iGlobal Dimension Units</strong> – Unit of measure for the iGlobal Dimensional attributes. (CM / IN)</li>
|
56 |
-
</ul>
|
57 |
-
</ol></description>
|
58 |
-
<notes>fixed bugs:
|
59 |
-
-Issue with taxes not being added to grand total
|
60 |
-
-Cart failing to clear for logged-in users
|
61 |
-
-fixed undefined indexes that throw exceptions in EE
|
62 |
-

|
63 |
-
Added Features:
|
64 |
-
-ability to turn of integration of international checkout while leaving other features running
|
65 |
-
-prevent accidental deploy before integration and testing are done
|
66 |
-

|
67 |
-
Other:
|
68 |
-
Various code cleanings to streamline</notes>
|
69 |
-
<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>
|
70 |
-
<date>2014-11-12</date>
|
71 |
-
<time>17:15:56</time>
|
72 |
-
<contents><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="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="5d288c6bc298db3bdc86adcdd036bdd6"/><file name="Cart.php" hash="2fd47fa1ca047bbc75383c2e35dd4bf2"/><file name="Includes.php" hash="8214ef5eae6a83e2909f8ebeee6ea1f7"/></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="56a5c17a3e71079ecf574fd4a0e69011"/><file name="Observer.php" hash="a399f807657409c06e3463e53666eab3"/><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="55ef50a78966b6b2bc3db268de5037ce"/></dir><dir name="Rest"><file name="Order.php" hash="5f485c1aa886af09d9ff072547ad1fd0"/></dir><dir name="Service"><file name="Quote.php" hash="bae0e5a710b9e3aa1427bb78a08fbfd8"/></dir></dir><dir name="controllers"><file name="AjaxController.php" hash="3169062e850efd55749ae8033676bf2d"/><file name="InternationalController.php" hash="bcb5288ffed067019649cfca31e59356"/><file name="OrderscheckController.php" hash="85ecc023e3e90f6d1c1360dcecc5077e"/><file name="SuccessController.php" hash="99e9e859c7dbfa0ed0f1547cd7f4b82e"/><file name="TestController.php" hash="92dbb668489c3a42f962076eb26a1c92"/><file name="UpdateShippingStatusController.php" hash="77534f8cbc68f23ab3377ff1427b9300"/><file name="carbonfiber.php" hash="74639ecbb7f93dae5e68e5ba56981571"/></dir><dir name="etc"><file name="adminhtml.xml" hash="187e2b5c1a92072af9f24ad832cbc371"/><file name="config.xml" hash="3dc53cf8b710d1669b9358c2bb2d2014"/><file name="system.xml" hash="8d3e1184aa2e7b70ea749021e6a7c7b1"/></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 name="Fee"><dir name="Block"><dir name="Sales"><dir name="Order"><file name="Total.php" hash="8ca3334de405b0b7088584f5548bb47e"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="406a814f1216d736e8661a32c833a15e"/></dir><dir name="Model"><file name="Fee.php" hash="5a18c1da4f5f091d63051872a9dc0135"/><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="c7c42dd266a0cdb0b1c504dd66b920bc"/></dir><dir name="sql"><dir name="fee_setup"><file name="mysql4-install-0.1.0.php" hash="8327866f66c8bff7fcbb0305385a6f93"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Iglobal_Ship.xml" hash="6d40f1c84e29bb7d8b70eadd77a03917"/><file name="Iglobal_Stores.xml" hash="56839ad045b6a99f97564de63ebed700"/><file name="Iglobal_Fee.xml" hash="205714b75c3b417343a6b25ecedf35c4"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="iglobal.xml" hash="6df6f5f0aceab891d0cd13061a3b5e55"/><file name="fee.xml" hash="96955d111e2a9014d5dc3d18201ddddf"/></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="9eaac8c650b6986db7c0a5005966c4ee"/></dir></dir></dir></dir><dir name="stores"><file name="cart.phtml" hash="26aad68cbe45247ece12d702f87da59b"/><file name="igcincludes.phtml" hash="96543d2e1e1d90394d6485b7f327e0ed"/></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="f095c20844c8ee158b704be69d4dc2bf"/><file name="ig_welcome_mat_default.js" hash="d9a9d16ced35769cffd27bb2cf2de4db"/><file name="igc.cs.magento_default_ice.js" hash="151e93ff4067fef88c18f76acf203f58"/><dir name="jquery"><file name="jquery.js" hash="6903c661e9db496b11e737478528318f"/><file name="jquery.noconflict.js" hash="09bfdd3b964eb2b17b5d6caa1d20a607"/></dir></dir></dir></target></contents>
|
73 |
<compatible/>
|
74 |
<dependencies><required><php><min>5.0.0</min><max>7.0.0</max></php></required></dependencies>
|
75 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Iglobal_Main</name>
|
4 |
+
<version>1.1.0</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Fully Embedded iFrame Checkout and Improvements</summary>
|
10 |
<description>International eCommerce Done Right
|
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
|
12 |

|
18 |

|
19 |
Your Shipping Carriers - Work with the shipping carriers of your choice, at your rates.
|
20 |

|
21 |
+
Direct Shipping to the World- Ship directly from your warehouse to anywhere in the world with iGlobal Stores&apos; easy print and ship technology. We&apos;ll take care of the paperwork
|
22 |

|
23 |
Their Currency - Show customers their order totals in their local currency, making the buying decision that much easier
|
24 |

|
25 |
Your Payment Processor or Ours - Use your own payment processor or leverage the integrated payment system to settle in foreign currencies - it's up to you.
|
26 |

|
27 |
Before You Install
|
28 |
+
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>
|
29 |
+
<notes>New Features:
|
30 |
+
Fully Embedded Checkout Using iFrame
|
31 |
+
Magento Country Region Support
|
32 |
+
Reconciliation Improvements with Payment Transaction Id
|
33 |
+
Improvements:
|
34 |
+
Faster Speeds
|
35 |
+
iGlobal Stores Updated API Additions</notes>
|
36 |
+
<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>David Meads</name><user>unkuser3</user><email>dave@iglobalstores.com</email></author></authors>
|
37 |
+
<date>2015-07-08</date>
|
38 |
+
<time>17:35:05</time>
|
39 |
+
<contents><target name="mageetc"><dir name="modules"><file name="Iglobal_Stores.xml" hash="56839ad045b6a99f97564de63ebed700"/><file name="Iglobal_Ship.xml" hash="6d40f1c84e29bb7d8b70eadd77a03917"/><file name="Iglobal_Fee.xml" hash="205714b75c3b417343a6b25ecedf35c4"/></dir></target><target name="magecommunity"><dir name="Iglobal"><dir name="Fee"><dir name="Block"><dir name="Sales"><dir name="Order"><file name="Total.php" hash="8ca3334de405b0b7088584f5548bb47e"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="406a814f1216d736e8661a32c833a15e"/></dir><dir name="Model"><file name="Fee.php" hash="5a18c1da4f5f091d63051872a9dc0135"/><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="c7c42dd266a0cdb0b1c504dd66b920bc"/></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="5d288c6bc298db3bdc86adcdd036bdd6"/><file name="Cart.php" hash="2fd47fa1ca047bbc75383c2e35dd4bf2"/><file name="Includes.php" hash="8214ef5eae6a83e2909f8ebeee6ea1f7"/><file name="Link.php" hash="25edb29e24e086f0518a7ca4bed59f10"/></dir><dir name="Helper"><file name="Configoptions.php" hash="b129e55b21f845a20d6e7fdb3b532be3"/><file name="Data.php" hash="2d77637b08ac8e7dcb717d8e1571739a"/><file name="Url.php" hash="9ac6f1784835d3c4ac0f81dfe9a2eb1d"/></dir><dir name="Model"><file name="Configoptions.php" hash="56a5c17a3e71079ecf574fd4a0e69011"/><dir name="International"><file name="International.php" hash="b72f00d5bdd6bc2a2b918bb210b5c5b3"/></dir><file name="Observer.php" hash="a399f807657409c06e3463e53666eab3"/><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="55ef50a78966b6b2bc3db268de5037ce"/></dir><dir name="Rest"><file name="Order.php" hash="7652ce755b605c3cf2ce18d6b1f0d884"/><file name="Region.php" hash="ec4b17694c839236b929e6c537e2e602"/></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="e953271910a1e3ca1469292ec8064e02"/><file name="InternationalController.php" hash="bcb5288ffed067019649cfca31e59356"/><file name="SuccessController.php" hash="6429a3ce3ce1253d3b3ceda13a24f264"/></dir><dir name="etc"><file name="adminhtml.xml" hash="187e2b5c1a92072af9f24ad832cbc371"/><file name="config.xml" hash="9d5d5058a42831488b7a703c10802f0e"/><file name="system.xml" hash="8f02c3ae7e3060b0006b288a030ce2a9"/></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="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="iglobal.xml" hash="d49680762997b0480aaaeae331dc4695"/><file name="fee.xml" hash="97d67fc83755f625dfe305748fca65b1"/></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="f0ded88a2ec21ccd130a82a49c4923d2"/></dir></dir><dir name="stores"><file name="cart.phtml" hash="26aad68cbe45247ece12d702f87da59b"/><file name="igcincludes.phtml" hash="3ae102c65bd8a80ebd80267263df69aa"/></dir></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="iglobal.xml" hash="6df6f5f0aceab891d0cd13061a3b5e55"/><file name="fee.xml" hash="96955d111e2a9014d5dc3d18201ddddf"/></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></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="a778a2749a38c38367cc70fb8986ec5c"/><file name="igc.cs.magento_default_ice.js" hash="45fe3cfd5f55e4a96132fa77c034bc33"/><dir name="jquery"><file name="jquery.js" hash="6903c661e9db496b11e737478528318f"/><file name="jquery.noconflict.js" hash="09bfdd3b964eb2b17b5d6caa1d20a607"/></dir></dir></dir></target></contents>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
<compatible/>
|
41 |
<dependencies><required><php><min>5.0.0</min><max>7.0.0</max></php></required></dependencies>
|
42 |
</package>
|