Iglobal_Main - Version 1.2.0

Version Notes

New Features:
Duty & Fees Integrated into Tax
Order email can be sent from the store

Improvements:
Faster Speeds
Country Region Fixes
iGlobal Stores Updated API

Download this release

Release Info

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


Code changes from version 1.1.1 to 1.2.0

Files changed (36) hide show
  1. app/code/community/Iglobal/Fee/Block/Sales/Order/Total.php +0 -65
  2. app/code/community/Iglobal/Fee/Helper/Data.php +0 -8
  3. app/code/community/Iglobal/Fee/Model/Fee.php +0 -17
  4. app/code/community/Iglobal/Fee/Model/Observer.php +0 -28
  5. app/code/community/Iglobal/Fee/Model/Sales/Order/Total/Creditmemo/Fee.php +0 -17
  6. app/code/community/Iglobal/Fee/Model/Sales/Order/Total/Invoice/Fee.php +0 -17
  7. app/code/community/Iglobal/Fee/Model/Sales/Quote/Address/Total/Fee.php +0 -51
  8. app/code/community/Iglobal/Fee/etc/config.xml +0 -169
  9. app/code/community/Iglobal/Fee/sql/fee_setup/mysql4-install-0.1.0.php +0 -25
  10. app/code/community/Iglobal/Stores/Block/Link.php +26 -26
  11. app/code/community/Iglobal/Stores/Helper/Url.php +24 -24
  12. app/code/community/Iglobal/Stores/Model/International/International.php +48 -186
  13. app/code/community/Iglobal/Stores/Model/Observer.php +2 -2
  14. app/code/community/Iglobal/Stores/Model/Order.php +279 -0
  15. app/code/community/Iglobal/Stores/Model/Rest.php +75 -0
  16. app/code/community/Iglobal/Stores/Model/Rest/Order.php +0 -86
  17. app/code/community/Iglobal/Stores/Model/Rest/Region.php +0 -42
  18. app/code/community/Iglobal/Stores/Model/Sales/Quote/Address/Total/Fee.php +17 -0
  19. app/code/community/Iglobal/Stores/controllers/CheckoutController.php +42 -42
  20. app/code/community/Iglobal/Stores/controllers/InternationalController.php +0 -32
  21. app/code/community/Iglobal/Stores/controllers/SuccessController.php +50 -386
  22. app/code/community/Iglobal/Stores/etc/config.xml +10 -0
  23. app/code/community/Iglobal/Stores/etc/system.xml +79 -59
  24. app/design/adminhtml/default/default/layout/fee.xml +0 -56
  25. app/design/adminhtml/default/default/template/fee/sales/order/refunded.phtml +0 -16
  26. app/design/adminhtml/default/default/template/fee/sales/order/total.phtml +0 -9
  27. app/design/frontend/base/default/layout/fee.xml +0 -50
  28. app/design/frontend/base/default/template/iglobal/checkout/onepage/link.phtml +30 -30
  29. app/design/frontend/base/default/template/iglobal/stores/cart.phtml +21 -24
  30. app/etc/modules/Iglobal_Fee.xml +0 -9
  31. js/iGlobal/ig_welcome_mat_default.css +0 -41
  32. js/iGlobal/ig_welcome_mat_default.js +0 -867
  33. js/iGlobal/igc.cs.magento_default_ice.js +0 -203
  34. js/iGlobal/jquery/jquery.js +0 -9603
  35. js/iGlobal/jquery/jquery.noconflict.js +0 -1
  36. package.xml +14 -12
app/code/community/Iglobal/Fee/Block/Sales/Order/Total.php DELETED
@@ -1,65 +0,0 @@
1
- <?php
2
- class Iglobal_Fee_Block_Sales_Order_Total extends Mage_Core_Block_Template
3
- {
4
- /**
5
- * Get label cell tag properties
6
- *
7
- * @return string
8
- */
9
- public function getLabelProperties()
10
- {
11
- return $this->getParentBlock()->getLabelProperties();
12
- }
13
-
14
- /**
15
- * Get order store object
16
- *
17
- * @return Mage_Sales_Model_Order
18
- */
19
- public function getOrder()
20
- {
21
- return $this->getParentBlock()->getOrder();
22
- }
23
-
24
- /**
25
- * Get totals source object
26
- *
27
- * @return Mage_Sales_Model_Order
28
- */
29
- public function getSource()
30
- {
31
- return $this->getParentBlock()->getSource();
32
- }
33
-
34
- /**
35
- * Get value cell tag properties
36
- *
37
- * @return string
38
- */
39
- public function getValueProperties()
40
- {
41
- return $this->getParentBlock()->getValueProperties();
42
- }
43
-
44
- /**
45
- * Initialize reward points totals
46
- *
47
- * @return Enterprise_Reward_Block_Sales_Order_Total
48
- */
49
- public function initTotals()
50
- {
51
- if ((float) $this->getOrder()->getBaseFeeAmount()) {
52
- $source = $this->getSource();
53
- $value = $source->getFeeAmount();
54
-
55
- $this->getParentBlock()->addTotal(new Varien_Object(array(
56
- 'code' => 'fee',
57
- 'strong' => false,
58
- 'label' => Mage::helper('fee')->formatFee($value),
59
- 'value' => $source instanceof Mage_Sales_Model_Order_Creditmemo ? - $value : $value
60
- )));
61
- }
62
-
63
- return $this;
64
- }
65
- }
app/code/community/Iglobal/Fee/Helper/Data.php DELETED
@@ -1,8 +0,0 @@
1
- <?php
2
-
3
- class Iglobal_Fee_Helper_Data extends Mage_Core_Helper_Abstract
4
- {
5
- public function formatFee($amount){
6
- return Mage::helper('fee')->__('Customs and Duty Tax');
7
- }
8
- }
app/code/community/Iglobal/Fee/Model/Fee.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- class Iglobal_Fee_Model_Fee extends Varien_Object{
3
-
4
- public static function getFee(){
5
- return 0;
6
- }
7
- public static function canApply($address){
8
- return true;
9
- //put here your business logic to check if fee should be applied or not
10
- $quote = $address->getQuote();
11
- if($quote->getFeeAmount()){
12
- return true;
13
- } else {
14
- return false;
15
- }
16
- }
17
- }
app/code/community/Iglobal/Fee/Model/Observer.php DELETED
@@ -1,28 +0,0 @@
1
- <?php
2
- class Iglobal_Fee_Model_Observer{
3
- public function invoiceSaveAfter(Varien_Event_Observer $observer)
4
- {
5
- $invoice = $observer->getEvent()->getInvoice();
6
- if ($invoice->getBaseFeeAmount()) {
7
- $order = $invoice->getOrder();
8
- $order->setFeeAmountInvoiced($order->getFeeAmountInvoiced() + $invoice->getFeeAmount());
9
- $order->setBaseFeeAmountInvoiced($order->getBaseFeeAmountInvoiced() + $invoice->getBaseFeeAmount());
10
- }
11
- return $this;
12
- }
13
- public function creditmemoSaveAfter(Varien_Event_Observer $observer)
14
- {
15
- /* @var $creditmemo Mage_Sales_Model_Order_Creditmemo */
16
- $creditmemo = $observer->getEvent()->getCreditmemo();
17
- if ($creditmemo->getFeeAmount()) {
18
- $order = $creditmemo->getOrder();
19
- $order->setFeeAmountRefunded($order->getFeeAmountRefunded() + $creditmemo->getFeeAmount());
20
- $order->setBaseFeeAmountRefunded($order->getBaseFeeAmountRefunded() + $creditmemo->getBaseFeeAmount());
21
- }
22
- return $this;
23
- }
24
- public function updatePaypalTotal($evt){
25
- $cart = $evt->getPaypalCart();
26
- $cart->updateTotal(Mage_Paypal_Model_Cart::TOTAL_SUBTOTAL,$cart->getSalesEntity()->getFeeAmount());
27
- }
28
- }
app/code/community/Iglobal/Fee/Model/Sales/Order/Total/Creditmemo/Fee.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- class Iglobal_Fee_Model_Sales_Order_Total_Creditmemo_Fee extends Mage_Sales_Model_Order_Creditmemo_Total_Abstract
3
- {
4
- public function collect(Mage_Sales_Model_Order_Creditmemo $creditmemo)
5
- {
6
- $order = $creditmemo->getOrder();
7
- $feeAmountLeft = $order->getFeeAmountInvoiced() - $order->getFeeAmountRefunded();
8
- $basefeeAmountLeft = $order->getBaseFeeAmountInvoiced() - $order->getBaseFeeAmountRefunded();
9
- if ($basefeeAmountLeft > 0) {
10
- $creditmemo->setGrandTotal($creditmemo->getGrandTotal() + $feeAmountLeft);
11
- $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() + $basefeeAmountLeft);
12
- $creditmemo->setFeeAmount($feeAmountLeft);
13
- $creditmemo->setBaseFeeAmount($basefeeAmountLeft);
14
- }
15
- return $this;
16
- }
17
- }
app/code/community/Iglobal/Fee/Model/Sales/Order/Total/Invoice/Fee.php DELETED
@@ -1,17 +0,0 @@
1
- <?php
2
- class Iglobal_Fee_Model_Sales_Order_Total_Invoice_Fee extends Mage_Sales_Model_Order_Invoice_Total_Abstract
3
- {
4
- public function collect(Mage_Sales_Model_Order_Invoice $invoice)
5
- {
6
- $order = $invoice->getOrder();
7
- $feeAmountLeft = $order->getFeeAmount() - $order->getFeeAmountInvoiced();
8
- $baseFeeAmountLeft = $order->getBaseFeeAmount() - $order->getBaseFeeAmountInvoiced();
9
-
10
- $invoice->setGrandTotal($invoice->getGrandTotal() + $feeAmountLeft);
11
- $invoice->setBaseGrandTotal($invoice->getBaseGrandTotal() + $baseFeeAmountLeft);
12
-
13
- $invoice->setFeeAmount($feeAmountLeft);
14
- $invoice->setBaseFeeAmount($baseFeeAmountLeft);
15
- return $this;
16
- }
17
- }
app/code/community/Iglobal/Fee/Model/Sales/Quote/Address/Total/Fee.php DELETED
@@ -1,51 +0,0 @@
1
- <?php
2
- class Iglobal_Fee_Model_Sales_Quote_Address_Total_Fee extends Mage_Sales_Model_Quote_Address_Total_Abstract{
3
- protected $_code = 'fee';
4
-
5
- public function collect(Mage_Sales_Model_Quote_Address $address)
6
- {
7
- parent::collect($address);
8
-
9
- $this->_setAmount(0);
10
- $this->_setBaseAmount(0);
11
-
12
- $items = $this->_getAddressItems($address);
13
- if (!count($items)) {
14
- return $this; //this makes only address type shipping to come through
15
- }
16
-
17
-
18
- $quote = $address->getQuote();
19
-
20
- if(Iglobal_Fee_Model_Fee::canApply($address)){
21
- $exist_amount = $quote->getFeeAmount();
22
- $fee = Iglobal_Fee_Model_Fee::getFee();
23
- $balance = $exist_amount; //$fee - $exist_amount;
24
- // $balance = $fee;
25
-
26
- //$this->_setAmount($balance);
27
- //$this->_setBaseAmount($balance);
28
-
29
- $address->setFeeAmount($balance);
30
- $address->setBaseFeeAmount($balance);
31
-
32
- $quote->setFeeAmount($balance);
33
-
34
- $address->setGrandTotal($address->getGrandTotal() + $address->getFeeAmount());
35
- $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBaseFeeAmount());
36
- }
37
- }
38
-
39
- public function fetch(Mage_Sales_Model_Quote_Address $address)
40
- {
41
- $amt = $address->getFeeAmount();
42
- if($amt != 0){
43
- $address->addTotal(array(
44
- 'code'=>$this->getCode(),
45
- 'title'=>Mage::helper('fee')->__('Customs Duty and Tax'),
46
- 'value'=> $amt
47
- ));
48
- }
49
- return $this;
50
- }
51
- }
app/code/community/Iglobal/Fee/etc/config.xml DELETED
@@ -1,169 +0,0 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Iglobal_Fee>
5
- <version>0.1.0</version>
6
- </Iglobal_Fee>
7
- </modules>
8
- <frontend>
9
- <routers>
10
- <fee>
11
- <use>standard</use>
12
- <args>
13
- <module>Iglobal_Fee</module>
14
- <frontName>fee</frontName>
15
- </args>
16
- </fee>
17
- </routers>
18
- <layout>
19
- <updates>
20
- <fee>
21
- <file>fee.xml</file>
22
- </fee>
23
- </updates>
24
- </layout>
25
- </frontend>
26
- <admin>
27
- <routers>
28
- <fee>
29
- <use>admin</use>
30
- <args>
31
- <module>Iglobal_Fee</module>
32
- <frontName>fee</frontName>
33
- </args>
34
- </fee>
35
- </routers>
36
- </admin>
37
- <adminhtml>
38
- <layout>
39
- <updates>
40
- <fee>
41
- <file>fee.xml</file>
42
- </fee>
43
- </updates>
44
- </layout>
45
- </adminhtml>
46
- <global>
47
- <sales>
48
- <quote>
49
- <totals>
50
- <fee>
51
- <class>fee/sales_quote_address_total_fee</class>
52
- <before>subtotal</before>
53
- </fee>
54
- </totals>
55
- </quote>
56
- <order_invoice>
57
- <totals>
58
- <fee>
59
- <class>fee/sales_order_total_invoice_fee</class>
60
- <before>subtotal</before>
61
- </fee>
62
- </totals>
63
- </order_invoice>
64
- <order_creditmemo>
65
- <totals>
66
- <fee>
67
- <class>fee/sales_order_total_creditmemo_fee</class>
68
- <before>subtotal</before>
69
- </fee>
70
- </totals>
71
- </order_creditmemo>
72
- </sales>
73
- <events>
74
- <paypal_prepare_line_items>
75
- <observers>
76
- <paypal_prepare_line_items>
77
- <class>fee/observer</class>
78
- <method>updatePaypalTotal</method>
79
- </paypal_prepare_line_items>
80
- </observers>
81
- </paypal_prepare_line_items>
82
- <sales_order_invoice_save_after>
83
- <observers>
84
- <sales_order_invoice_save_after>
85
- <class>fee/observer</class>
86
- <method>invoiceSaveAfter</method>
87
- </sales_order_invoice_save_after>
88
- </observers>
89
- </sales_order_invoice_save_after>
90
- <sales_order_creditmemo_save_after>
91
- <observers>
92
- <sales_order_creditmemo_save_after>
93
- <class>fee/observer</class>
94
- <method>creditmemoSaveAfter</method>
95
- </sales_order_creditmemo_save_after>
96
- </observers>
97
- </sales_order_creditmemo_save_after>
98
- </events>
99
- <fieldsets>
100
- <sales_convert_quote_address>
101
- <fee_amount><to_order>*</to_order></fee_amount>
102
- <base_fee_amount><to_order>*</to_order></base_fee_amount>
103
- </sales_convert_quote_address>
104
- </fieldsets>
105
- <pdf>
106
- <totals>
107
- <fee translate="title">
108
- <title>Fee</title>
109
- <source_field>fee_amount</source_field>
110
- <font_size>7</font_size>
111
- <display_zero>0</display_zero>
112
- <sort_order>650</sort_order>
113
- <amount_prefix>-</amount_prefix>
114
- </fee>
115
- </totals>
116
- </pdf>
117
- <models>
118
- <fee>
119
- <class>Iglobal_Fee_Model</class>
120
- <resourceModel>fee_mysql4</resourceModel>
121
- </fee>
122
- <fee_mysql4>
123
- <class>Iglobal_Fee_Model_Mysql4</class>
124
- <entities>
125
- <fee>
126
- <table>fee</table>
127
- </fee>
128
- </entities>
129
- </fee_mysql4>
130
- </models>
131
- <resources>
132
- <fee_setup>
133
- <setup>
134
- <module>Iglobal_Fee</module>
135
- </setup>
136
- <connection>
137
- <use>core_setup</use>
138
- </connection>
139
- </fee_setup>
140
- <fee_write>
141
- <connection>
142
- <use>core_write</use>
143
- </connection>
144
- </fee_write>
145
- <fee_read>
146
- <connection>
147
- <use>core_read</use>
148
- </connection>
149
- </fee_read>
150
- </resources>
151
- <blocks>
152
- <fee>
153
- <class>Iglobal_Fee_Block</class>
154
- </fee>
155
- </blocks>
156
- <helpers>
157
- <fee>
158
- <class>Iglobal_Fee_Helper</class>
159
- </fee>
160
- </helpers>
161
- </global>
162
- <default>
163
- <sales>
164
- <totals_sort>
165
- <fee>15</fee>
166
- </totals_sort>
167
- </sales>
168
- </default>
169
- </config>
app/code/community/Iglobal/Fee/sql/fee_setup/mysql4-install-0.1.0.php DELETED
@@ -1,25 +0,0 @@
1
- <?php
2
-
3
- $installer = $this;
4
-
5
- $installer->startSetup();
6
-
7
- $installer->run("
8
-
9
- ALTER TABLE `".$this->getTable('sales/order')."` ADD `fee_amount` DECIMAL( 10, 2 ) NOT NULL;
10
- ALTER TABLE `".$this->getTable('sales/order')."` ADD `base_fee_amount` DECIMAL( 10, 2 ) NOT NULL;
11
- ALTER TABLE `".$this->getTable('sales/quote_address')."` ADD `fee_amount` DECIMAL( 10, 2 ) NOT NULL;
12
- ALTER TABLE `".$this->getTable('sales/quote_address')."` ADD `base_fee_amount` DECIMAL( 10, 2 ) NOT NULL;
13
- ALTER TABLE `".$this->getTable('sales/order')."` ADD `fee_amount_invoiced` DECIMAL( 10, 2 ) NOT NULL;
14
- ALTER TABLE `".$this->getTable('sales/order')."` ADD `base_fee_amount_invoiced` DECIMAL( 10, 2 ) NOT NULL;
15
- ALTER TABLE `".$this->getTable('sales/invoice')."` ADD `fee_amount` DECIMAL( 10, 2 ) NOT NULL;
16
- ALTER TABLE `".$this->getTable('sales/invoice')."` ADD `base_fee_amount` DECIMAL( 10, 2 ) NOT NULL;
17
- ALTER TABLE `".$this->getTable('sales/order')."` ADD `fee_amount_refunded` DECIMAL( 10, 2 ) NOT NULL;
18
- ALTER TABLE `".$this->getTable('sales/order')."` ADD `base_fee_amount_refunded` DECIMAL( 10, 2 ) NOT NULL;
19
- ALTER TABLE `".$this->getTable('sales/creditmemo')."` ADD `fee_amount` DECIMAL( 10, 2 ) NOT NULL;
20
- ALTER TABLE `".$this->getTable('sales/creditmemo')."` ADD `base_fee_amount` DECIMAL( 10, 2 ) NOT NULL;
21
-
22
-
23
- ");
24
-
25
- $installer->endSetup();
app/code/community/Iglobal/Stores/Block/Link.php CHANGED
@@ -1,27 +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
}
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 CHANGED
@@ -1,24 +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
- }
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 CHANGED
@@ -1,187 +1,49 @@
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
?>
1
+ <?php
2
+
3
+
4
+ class Iglobal_Stores_Model_International_International extends Mage_Core_Model_Abstract
5
+ {
6
+ public function getTempCartId ()
7
+ {
8
+
9
+ //get all the items in the cart
10
+ $cart = Mage::getModel('checkout/cart')->getQuote();
11
+ $items = array();
12
+
13
+ foreach ($cart->getAllVisibleItems() as $index=>$item) {
14
+ $product = $item->getProduct();
15
+ $sku = $item->getSku();
16
+ $dimUnits = $product->getIgDemesionUnits();
17
+ $dim2inch = ['cm' => 2.54, 'in' => 1, '' => 1];
18
+ $weight = $product->getIgWeight();
19
+ if (empty($weight))
20
+ {
21
+ $weight = $item->getWeight();
22
+ }
23
+
24
+ $items[] = [
25
+ "description" => $item->getName(),
26
+ "productId" => $item->getProductId(),
27
+ "sku" => $product->getTypeId() == 'bundle' ? substr($sku, strpos($sku, '-') + 1) : $sku,
28
+ "unitPrice" => $item->getPrice(),
29
+ "quantity" => $item->getQty(),
30
+ "length" => ceil(floatval($product->getIgLength()) / $dim2inch[$dimUnits]),
31
+ "width" => ceil(floatval($product->getIgWidth()) / $dim2inch[$dimUnits]),
32
+ "height" => ceil(floatval($product->getIgHeight()) / $dim2inch[$dimUnits]),
33
+ "weight" => $weight,
34
+ "weightUnits" => strtoupper($product->getIgWeightUnits()),
35
+ "itemURL" => $product->getProductUrl(),
36
+ "imageURL" => str_replace("http:", "https:", Mage::helper('catalog/image')->init($product, 'thumbnail')),
37
+ "itemDescriptionLong" => $product->getDescription(),
38
+
39
+ ];
40
+ }
41
+
42
+ $rest = Mage::getModel('stores/rest');
43
+ $response = $rest->createTempCart([
44
+ "storeId" =>Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid'),
45
+ "items" => $items,]);
46
+ return $response->tempCartUUID;
47
+ }
48
+ }
49
?>
app/code/community/Iglobal/Stores/Model/Observer.php CHANGED
@@ -86,11 +86,11 @@ class Iglobal_Stores_Model_Observer
86
public function orderRec () {
87
88
//get array with all orders in past
89
- $rest = Mage::getModel('stores/rest_order'); // get rest model
90
91
//fetch all orders for the store from iGlobal server
92
$data = $rest->getAllOrdersSinceDate('20140526');
93
- $orderData = $data['order'];
94
$restOrders = array();
95
96
//build array of orders with keypairs "ig_order_number" => "the number as a string"
86
public function orderRec () {
87
88
//get array with all orders in past
89
+ $rest = Mage::getModel('stores/rest'); // get rest model
90
91
//fetch all orders for the store from iGlobal server
92
$data = $rest->getAllOrdersSinceDate('20140526');
93
+ $orderData = $data['order'];
94
$restOrders = array();
95
96
//build array of orders with keypairs "ig_order_number" => "the number as a string"
app/code/community/Iglobal/Stores/Model/Order.php ADDED
@@ -0,0 +1,279 @@
1
+ <?php
2
+
3
+ class Iglobal_Stores_Model_Order extends Mage_Core_Model_Abstract
4
+ {
5
+ protected $quote = null;
6
+ protected $iglobal_order_id = null;
7
+ protected $iglobal_order = null;
8
+ protected $rest = null;
9
+ public function setQuote($quote)
10
+ {
11
+ $this->quote = $quote;
12
+ }
13
+
14
+ public function processOrder($orderid)
15
+ {
16
+ $this->iglobal_order_id = $orderid;
17
+ $this->rest = Mage::getModel('stores/rest');
18
+ $this->iglobal_order = $this->rest->getOrder($this->iglobal_order_id)->order;
19
+ Mage::register('duty_tax', $this->iglobal_order->dutyTaxesTotal);
20
+ $shippingAddress = $this->setContactInfo();
21
+ $shippingAddress = $this->setShipping($shippingAddress);
22
+ $this->setPayment($shippingAddress);
23
+ return $this->createOrder();
24
+ }
25
+
26
+ protected function setContactInfo()
27
+ {
28
+ //set customer info
29
+ $this->quote->setCustomerEmail($this->iglobal_order->email);
30
+
31
+ $_name = explode(' ', $this->iglobal_order->name, 2);
32
+ if ($this->iglobal_order->testOrder) {
33
+ $name_first = "TEST ORDER! DO NOT SHIP! - " . array_shift($_name);
34
+ $name_last = array_pop($_name);
35
+ } else {
36
+ $name_first = array_shift($_name);
37
+ $name_last = array_pop($_name);
38
+ }
39
+
40
+ $this->quote->setCustomerFirstname($name_first);
41
+ $this->quote->setCustomerLastname($name_last);
42
+
43
+ $street = $this->iglobal_order->address1;
44
+ if ($this->iglobal_order->address2)
45
+ {
46
+ $street = array($street, $this->iglobal_order->address2);
47
+ }
48
+
49
+ $region = Mage::getModel('directory/region')
50
+ ->loadbyName($this->iglobal_order->state, $this->iglobal_order->countryCode);
51
+ if (!$region->getId())
52
+ {
53
+ // Lookup region from iGlobalstores
54
+ $regionId = $this->rest->getRegionId(
55
+ $this->iglobal_order->countryCode,
56
+ $this->iglobal_order->state,
57
+ $this->iglobal_order_id);
58
+ $region->load($regionId);
59
+ if (!$region->getId())
60
+ {
61
+ // Create a new region
62
+ $region->setData([
63
+ 'country_id' => $this->iglobal_order->countryCode,
64
+ 'defalt_name' => $this->iglobal_order->state
65
+ ])->save();
66
+
67
+ }
68
+ }
69
+
70
+ $addressData = array(
71
+ 'firstname' => $name_first,
72
+ 'lastname' => $name_last,
73
+ 'street' => $street,
74
+ 'city' => $this->iglobal_order->city,
75
+ 'postcode' => $this->iglobal_order->zip,
76
+ 'telephone' => $this->iglobal_order->phone,
77
+ 'region' => $this->iglobal_order->state,
78
+ 'region_id' => $region->getId(),
79
+ 'country_id' => $this->iglobal_order->countryCode,
80
+ 'company' => '',//$this->iglobal_order->company,
81
+ );
82
+
83
+ if (!empty($this->iglobal_order->billingAddress1)) {
84
+ $_nameBilling = explode(' ', $this->iglobal_order->billingName, 2);
85
+ if ($this->iglobal_order->testOrder) {
86
+ $name_first_billing = "TEST ORDER! DO NOT SHIP! - " . array_shift($_nameBilling);
87
+ $name_last_billing = array_pop($_nameBilling);
88
+ } else {
89
+ $name_first_billing = array_shift($_nameBilling);
90
+ $name_last_billing = array_pop($_nameBilling);
91
+ }
92
+
93
+ $streetBilling = $this->iglobal_order->billingAddress1;
94
+ if ($this->iglobal_order->billingAddress2) {
95
+ $streetBilling = array($streetBilling, $this->iglobal_order->billingAddress2);
96
+ }
97
+
98
+ $billingAddressData = array(
99
+ 'firstname' => $name_first_billing,
100
+ 'lastname' => $name_last_billing,
101
+ 'street' => $streetBilling,
102
+ 'city' => $this->iglobal_order->billingCity,
103
+ 'postcode' => $this->iglobal_order->billingZip,
104
+ 'telephone' => $this->iglobal_order->billingPhone,
105
+ 'region' => $this->iglobal_order->state,
106
+ 'region_id' => $region->getId(),
107
+ 'country_id' => $this->iglobal_order->billingCountryCode,
108
+ );
109
+
110
+ } else {
111
+ $billingAddressData = $addressData;
112
+ }
113
+
114
+ if (Mage::getStoreConfig('iglobal_integration/igjq/iglogging'))
115
+ {
116
+ Mage::log('address data for order {$this->iglobal_order_id}: ' . print_r($addressData, true), null, 'iglobal.log', true);
117
+ Mage::log('billing address data for order {$this->iglobal_order_id}: ' . print_r($billingAddressData, true), null, 'iglobal.log', true);
118
+ }
119
+
120
+ $this->quote->getBillingAddress()->addData($billingAddressData);
121
+ $shippingAddress = $this->quote->getShippingAddress()->addData($addressData);
122
+ return $shippingAddress;
123
+ }
124
+
125
+ protected function setItems()
126
+ {
127
+ // @todo pull in the item details in case they have changed.
128
+ }
129
+
130
+ protected function setShipping($shippingAddress)
131
+ {
132
+ //Figure out shipping carrier name etc.
133
+ $shippers = [
134
+ 'DHL_EXPRESS' => ['DHL', 'Express - iGlobal'],
135
+ 'DHL_GLOBAL_MAIL'=> ['DHL', 'Global Mail - iGlobal'],
136
+ 'FEDEX_ECONOMY'=> ['FedExl', 'Economy - iGlobal'],
137
+ 'FEDEX_GROUND'=> ['FedEx', 'Ground - iGlobal'],
138
+ 'FEDEX_PRIORITY'=> ['FedEx', 'Priority - iGlobal'],
139
+ 'UPS_EXPEDITED'=> ['UPS', 'Expedited - iGlobal'],
140
+ 'UPS_EXPRESS'=> ['UPS', 'Express - iGlobal'],
141
+ 'UPS_EXPRESS_SAVER' => ['UPS', 'Express Saver - iGlobal'],
142
+ 'UPS_GROUND' => ['UPS', 'Canada Ground - iGlobal'],
143
+ 'UPS_STANDARD'=> ['UPS', 'Canada Standard - iGlobal'],
144
+ 'USPS_FIRST_CLASS_MAIL_INTERNATIONAL'=> ['USPS', 'First Class Mail, International - iGlobal'],
145
+ 'USPS_PRIORITY_MAIL_EXPRESS_INTERNATIONAL'=> ['USPS', 'Priority Mail Express, International - iGlobal'],
146
+ 'USPS_PRIORITY_MAIL_INTERNATIONAL'=> ['USPS', 'Priority Mail, International - iGlobal'],
147
+ 'APC_EXPEDITED_MAIL'=> ['UPS', 'APC Expedited 3-5 Days - iGlobal'],
148
+ 'APC_PRIORITY_MAIL'=> ['UPS', 'APC Priority Mail 4-9 Days - iGlobal'],
149
+ 'CANADA_POST_EXPEDITED'=> ['UPS', 'Canada Post Expedited - iGlobal'],
150
+ 'FEDEX_IPD'=> ['UPS', 'FedEx IPD - iGlobal'],
151
+ 'UPS_2ND_DAY_AIR'=> ['UPS', 'UPS 2 Day Air - iGlobal'],
152
+ 'UPS_3_DAY_AIR'=> ['UPS', 'UPS 3 Day Air - iGlobal'],
153
+ 'UPS_FREIGHT'=> ['UPS', 'UPS Freight - iGlobal'],
154
+ 'UPS_MAIL_INNOVATIONS'=> ['UPS', 'Bodyguardz - UPS Mail Innovations - iGlobal'],
155
+ 'UPS_NEXT_DAY_AIR_SAVER'=>['UPS', 'UPS Next Day Air Saver - iGlobal'],
156
+ 'UPS_WORLDEASE'=> ['UPS', 'UPS WorldEase - iGlobal'],
157
+ 'USPS_EPACKET'=> ['UPS', 'USPS ePacket - iGlobal'],
158
+ 'USPS_EXPRESS_1'=> ['UPS', 'Express 1 Mail - iGlobal'],
159
+ 'USPS_IPA'=> ['UPS', 'USPS IPA - iGlobal'],
160
+ 'LANDMARK_LGINTREGU' => ['iGlobal', 'Landmark'],
161
+ 'LANDMARK_LGINTSTD' => ['iGlobal', 'Landmark'],
162
+ 'LANDMARK_LGINTSTDU' => ['iGlobal', 'Landmark'],
163
+ 'MSI_PARCEL' => ['iGlobal', 'Landmark'],
164
+ 'MSI_PRIORITY' => ['iGlobal', 'Landmark'],
165
+ 'default' => ['iGlobal', 'International Shipping'],
166
+ ];
167
+ $carrierMethod = $this->iglobal_order->shippingCarrierServiceLevel;
168
+ if (!isset($shippers[$carrierMethod]))
169
+ {
170
+ $carrierMethod = 'default';
171
+ }
172
+ $shipper = $shippers[$carrierMethod];
173
+
174
+ //Add things to the register so they can be used by the shipping method
175
+ Mage::register('shipping_cost', $this->iglobal_order->shippingTotal);
176
+ Mage::register('shipping_carriertitle', $shipper[0]);
177
+ Mage::register('shipping_methodtitle', $shipper[1]);
178
+ $shippingAddress->setCollectShippingRates(true)
179
+ ->collectShippingRates()
180
+ ->setShippingMethod('excellence_excellence');
181
+ return $shippingAddress;
182
+ }
183
+
184
+ protected function setPayment($address)
185
+ {
186
+ $address->setPaymentMethod('iGlobalCreditCard');
187
+
188
+ //updates payment type in Magento Admin area
189
+ $paymentMethod = $this->iglobal_order->paymentProcessing->paymentGateway;
190
+ if($paymentMethod === 'iGlobal_CC'){
191
+ $paymentType = 'iGlobalCreditCard';
192
+ } else if ($paymentMethod === 'iGlobal PayPal') {
193
+ $paymentType = 'iGlobalPaypal';
194
+ } else {
195
+ $paymentType = 'iGlobal';
196
+ }
197
+
198
+ $this->quote->getPayment()->importData(array('method' => $paymentType));
199
+ }
200
+
201
+ protected function createOrder()
202
+ {
203
+
204
+ $this->quote->collectTotals()->save();
205
+ $this->quote->setIsActive(0)->save();
206
+
207
+ $service = Mage::getModel('stores/service_quote', $this->quote);
208
+ $service->submitAll();
209
+ $order = $service->getOrder();
210
+
211
+ // cleaning up
212
+ Mage::getSingleton('checkout/session')->clear();
213
+
214
+ $id = $order->getEntityId();
215
+
216
+ if (!Mage::helper('sales')->canSendNewOrderEmail($storeId) && Mage::getStoreConfig('iglobal_integration/apireqs/send_order_email')) {
217
+ $order->sendNewOrderEmail();
218
+ }
219
+ Mage::getSingleton('checkout/session')->setLastOrderId($order->getId());
220
+ Mage::getSingleton('checkout/session')->setLastRealOrderId($order->getIncrementId());
221
+
222
+
223
+ $transId = Mage::getSingleton('checkout/session')->getLastRealOrderId($order->getIncrementId());
224
+ //Save Order Invoice as paid
225
+ $commentMessage = 'Order automatically imported from iGlobal order ID: '. $this->iglobal_order_id;
226
+
227
+ try {
228
+ $order = Mage::getModel("sales/order")->load($id);
229
+ //add trans ID
230
+ $transaction_id = '34234234234'; //todo: this needs to be set dynamically
231
+ $transaction = Mage::getModel('sales/order_payment_transaction');
232
+ $transaction->setOrderPaymentObject($order->getPayment());
233
+ $transaction->setTxnType(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
234
+ $transaction->setTxnId($transaction_id);
235
+ $transaction->save();
236
+
237
+ $invoices = Mage::getModel('sales/order_invoice')->getCollection()->addAttributeToFilter('order_id', array('eq'=>$order->getId()));
238
+ $invoices->getSelect()->limit(1);
239
+ if ((int)$invoices->count() == 0 && $order->getState() == Mage_Sales_Model_Order::STATE_NEW) {
240
+ if(!$order->canInvoice()) {
241
+ $order->addStatusHistoryComment($commentMessage, false);
242
+ $order->addStatusHistoryComment('iGlobal: Order cannot be invoiced', false);
243
+ $order->save();
244
+ } else {
245
+ $order->addStatusHistoryComment($commentMessage, false);
246
+ $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
247
+ $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_OFFLINE);
248
+ $invoice->register();
249
+ $invoice->getOrder()->setCustomerNoteNotify(false);
250
+ $invoice->getOrder()->setIsInProcess(true);
251
+ $order->addStatusHistoryComment('Automatically INVOICED by iGlobal', false);
252
+ $transactionSave = Mage::getModel('core/resource_transaction')
253
+ ->addObject($invoice)
254
+ ->addObject($invoice->getOrder());
255
+ $transactionSave->save();
256
+ }
257
+ }
258
+ } catch (Exception $e) {
259
+ $order->addStatusHistoryComment('iGlobal Invoicer: Exception occurred during automatically invoicing. Exception message: '.$e->getMessage(), false);
260
+ $order->save();
261
+ }
262
+ $tableName = Mage::getSingleton("core/resource")->getTableName("sales_flat_order");
263
+ if ($this->iglobal_order->testOrder) {
264
+ //Set the international_order flag and the ig_order_number on the order and mark as a test order
265
+ $query = "UPDATE `" . $tableName . "` SET `international_order` = 1, `ig_order_number` = '{$this->iglobal_order_id}', `iglobal_test_order` = 1 WHERE `entity_id` = '{$id}'";
266
+ Mage::getSingleton('core/resource')->getConnection('core_write')->query($query);
267
+ } else {
268
+ //Set the international_order flag and the ig_order_number on the order
269
+ $query = "UPDATE `" . $tableName . "` SET `international_order` = 1, `ig_order_number` = '{$this->iglobal_order_id}' WHERE `entity_id` = '{$id}'";
270
+ Mage::getSingleton('core/resource')->getConnection('core_write')->query($query);
271
+ }
272
+
273
+ //Send the magento id to iGlobal
274
+ $this->rest->sendMagentoOrderId($this->iglobal_order_id, $id);
275
+ return $order;
276
+ }
277
+
278
+
279
+ }
app/code/community/Iglobal/Stores/Model/Rest.php ADDED
@@ -0,0 +1,75 @@
1
+ <?php
2
+
3
+ class Iglobal_Stores_Model_Rest extends Mage_Core_Model_Abstract
4
+ {
5
+ protected $_entryPoint = 'https://api.iglobalstores.com/v1/';
6
+ protected $_store = 3; // default store ID
7
+ protected $_key = '';
8
+
9
+ protected function _construct()
10
+ {
11
+ //set store ID
12
+ if (Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid')) {
13
+ $this->_store = Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid');
14
+ }
15
+ //Set API Key
16
+ if (Mage::getStoreConfig('iglobal_integration/apireqs/secret')) {
17
+ $this->_key = Mage::getStoreConfig('iglobal_integration/apireqs/secret');
18
+ }
19
+ }
20
+
21
+ protected function callApi($path, $data, $headers=array())
22
+ {
23
+ $client = new Zend_Http_Client($this->_entryPoint . $path);
24
+ $data = json_encode(array_merge($data, array('store' => $this->_store, 'secret' => $this->_key)));
25
+ $response = $client
26
+ ->setRawData($data, 'application/json')
27
+ ->setHeaders($headers)
28
+ ->request('POST');
29
+
30
+ if ($response->isSuccessful())
31
+ {
32
+ return json_decode($response->getBody());
33
+ }
34
+ return false;
35
+
36
+ }
37
+
38
+ public function getAllOrders()
39
+ {
40
+ $data = array('sinceDate'=>'20100101');
41
+ return $this->callApi('orderNumbers', $data);
42
+ }
43
+
44
+ public function getAllOrdersSinceDate($data)
45
+ {
46
+ $data = array('sinceDate'=>$data);
47
+ return $this->callApi('orderNumbers', $data);
48
+ }
49
+
50
+ public function getOrder($order)
51
+ {
52
+ $data = array('orderId' => $order);
53
+ return $this->callApi('orderDetail', $data);
54
+ }
55
+
56
+ public function sendMagentoOrderId($igc_order_id, $magento_order_id) {
57
+ $data = array('orderId' => $igc_order_id, 'merchantOrderId' => $magento_order_id);
58
+ return $this->callApi('updateMerchantOrderId', $data);
59
+ }
60
+
61
+ public function createTempCart(array $data)
62
+ {
63
+ return $this->callApi('createTempCart', $data);
64
+ }
65
+
66
+ public function getRegionId($countryId, $region, $orderid)
67
+ {
68
+ $data = array('countryCode'=> $countryId,'region'=> $region, 'orderId' => $orderid);
69
+ return $this->callApi(
70
+ 'magento-region',
71
+ $data,
72
+ ["serviceToken" => "31ae7155-5b9e-461f-8353-9a8c3f8ae35974ffec3a-88dc-4acb-8420-270df7967338"]
73
+ );
74
+ }
75
+ }
app/code/community/Iglobal/Stores/Model/Rest/Order.php DELETED
@@ -1,86 +0,0 @@
1
- <?php
2
-
3
- class Iglobal_Stores_Model_Rest_Order extends Mage_Core_Model_Abstract
4
- {
5
- protected $_entryPoint = null;
6
-
7
- protected function _construct()
8
- {
9
- //set store ID
10
- if (Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid')){
11
- //use custom ID
12
- $this->_store = Mage::getStoreConfig('iglobal_integration/apireqs/iglobalid');
13
- } else {
14
- //default store ID
15
- $this->_store = 3;
16
- }
17
-
18
- //Set API Key
19
- if (Mage::getStoreConfig('iglobal_integration/apireqs/secret')){
20
- //use custom key
21
- $this->_key = Mage::getStoreConfig('iglobal_integration/apireqs/secret');
22
- } else {
23
- //default key
24
- $this->_key = '';
25
- }
26
-
27
- //set entryPoint
28
- $this->_entryPoint = 'https://checkout.iglobalstores.com';
29
-
30
- }
31
-
32
- protected function getRestClient()
33
- {
34
- return new Zend_Rest_Client($this->_entryPoint);
35
- }
36
-
37
- protected function addCredentials(array $data)
38
- {
39
- return array_merge($data, array('store'=>$this->_store, 'secret'=>$this->_key));
40
- }
41
-
42
- public function getOrders(array $data)
43
- {
44
- $data = array_merge($data, array('operation'=>'orderNumbers'));
45
- $client = $this->getRestClient();
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);
69
- $client = $this->getRestClient();
70
- $result = $client->restPost('iglobalstores/services/OrderRestService/v1.06', $this->addCredentials($data))->getBody();
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
-
79
- public function sendMagentoOrderId($igc_order_id, $magento_order_id) {
80
- $data = array('operation'=>'updateMerchantOrderId', 'orderId' => $igc_order_id, 'merchantOrderId' => $magento_order_id);
81
- $client = $this->getRestClient();
82
- $client->restPost('iglobalstores/services/OrderRestService', $this->addCredentials($data))->getBody();
83
- }
84
-
85
- }
86
- ?>
app/code/community/Iglobal/Stores/Model/Rest/Region.php DELETED
@@ -1,42 +0,0 @@
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/Model/Sales/Quote/Address/Total/Fee.php ADDED
@@ -0,0 +1,17 @@
1
+ <?php
2
+ class Iglobal_Stores_Model_Sales_Quote_Address_Total_Fee extends Mage_Sales_Model_Quote_Address_Total_Tax
3
+ {
4
+ public function collect(Mage_Sales_Model_Quote_Address $address)
5
+ {
6
+
7
+ $fee = Mage::registry('duty_tax');
8
+ if ($fee) {
9
+ // Do not override taxes if there is no duty_tax set.
10
+ $this->_setAddress($address);
11
+ $this->_setAmount($fee);
12
+ $this->_setBaseAmount($fee);
13
+ } else {
14
+ parent::collect($address);
15
+ }
16
+ }
17
+ }
app/code/community/Iglobal/Stores/controllers/CheckoutController.php CHANGED
@@ -1,43 +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
}
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/InternationalController.php DELETED
@@ -1,32 +0,0 @@
1
-
2
- <?php
3
-
4
- class Iglobal_Stores_InternationalController extends Mage_Core_Controller_Front_Action
5
- {
6
- public function indexAction()
7
- {
8
- echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
9
- <html xmlns="http://www.w3.org/1999/xhtml">
10
- <head>
11
- <title>Test Layout</title>
12
- <style type="text/css">
13
- body, html
14
- {
15
- margin: 0; padding: 0; height: 100%; overflow: hidden;
16
- }
17
-
18
- #content
19
- {
20
- position:absolute; left: 0; right: 0; bottom: 0; top: 0px;
21
- }
22
- </style>
23
- </head>
24
- <body>
25
- <div id="content">
26
- <iframe width="100%" height="100%" frameborder="0" src="https://jessiesteele.iglobalstores.com/?store=324&tempCartUUID=e5fa40f6-758c-4b63-af09-0a99783c1609&country=AL" />
27
- </div>
28
- </body>
29
- </html> ';
30
- }
31
-
32
- }
app/code/community/Iglobal/Stores/controllers/SuccessController.php CHANGED
@@ -1,386 +1,50 @@
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
- $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();
379
-
380
- $lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
381
- Mage::dispatchEvent('checkout_onepage_controller_success_action', array('order_ids' => array($lastOrderId)));
382
-
383
- $this->renderLayout();
384
- }
385
-
386
- }
1
+ <?php
2
+
3
+ class Iglobal_Stores_SuccessController extends Mage_Core_Controller_Front_Action
4
+ {
5
+ public function indexAction()
6
+ {
7
+
8
+
9
+ $_order = $this->getRequest()->getParam('orderId', null);
10
+ try
11
+ {
12
+ $quote = Mage::getSingleton('checkout/session')->getQuote()->setStoreId(Mage::app()->getStore()->getId());
13
+ $table = "sales_flat_order";
14
+ $tableName = Mage::getSingleton("core/resource")->getTableName($table);
15
+ $existsQuery = "SELECT `entity_id` FROM `" . $tableName. "` WHERE `ig_order_number` = '{$_order}'";
16
+ $orderExists = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchRow($existsQuery);
17
+
18
+ if(!$_order || $orderExists) {
19
+ header('Location: /');
20
+ die();
21
+ }
22
+
23
+ $order = Mage::getModel('stores/order');
24
+ $order->setQuote($quote);
25
+ $order->processOrder($_order);
26
+ }
27
+ catch(Exception $e)
28
+ {
29
+ $adminEmail = false;
30
+ //die($e);
31
+ if (Mage::getStoreConfig('iglobal_integration/apireqs/admin_email')) {
32
+ $adminEmail = Mage::getStoreConfig('iglobal_integration/apireqs/admin_email');
33
+ }
34
+ mail('monitoring@iglobalstores.com', 'Magento Integration Error - International order failed to import', 'International order# '. $_order .'.'. ' Exception Message: '.$e->getMessage());
35
+ mail('magentomissedorders@iglobalstores.com', 'Magento Integration Error - International order failed to import', 'International order# '. $_order .'.'. ' Exception Message: '.$e->getMessage());
36
+ if ($adminEmail) {
37
+ 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." );
38
+ }
39
+ Mage::log("International order #{$_order} failed to import!" .$e, Zend_Log::ERR, 'iglobal.log', true);
40
+ }
41
+
42
+ $this->loadLayout();
43
+
44
+ $lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
45
+ Mage::dispatchEvent('checkout_onepage_controller_success_action', array('order_ids' => array($lastOrderId)));
46
+
47
+ $this->renderLayout();
48
+ }
49
+
50
+ }
app/code/community/Iglobal/Stores/etc/config.xml CHANGED
@@ -181,6 +181,16 @@
181
</routers>
182
</admin>
183
<global>
184
<events>
185
<core_block_abstract_prepare_layout_before>
186
<observers>
181
</routers>
182
</admin>
183
<global>
184
+ <sales>
185
+ <quote>
186
+ <totals>
187
+ <tax>
188
+ <class>stores/sales_quote_address_total_fee</class>
189
+ <before>subtotal</before>
190
+ </tax>
191
+ </totals>
192
+ </quote>
193
+ </sales>
194
<events>
195
<core_block_abstract_prepare_layout_before>
196
<observers>
app/code/community/Iglobal/Stores/etc/system.xml CHANGED
@@ -7,15 +7,15 @@
7
<sort_order>150</sort_order>
8
</iglobal>
9
</tabs>
10
-
11
<sections>
12
<general>
13
-
14
<groups>
15
<country>
16
-
17
<fields>
18
-
19
<ig_domestic_countries>
20
<label>Domestic Shipping Countries</label>
21
<comment>Hold down Ctrl to select more than one. Select each country to which you will ship. iGlobal will not service these countries, and customers will use your checkout system.</comment>
@@ -27,14 +27,14 @@
27
<show_in_store>1</show_in_store>
28
<can_be_empty>1</can_be_empty>
29
</ig_domestic_countries>
30
-
31
</fields>
32
</country>
33
</groups>
34
-
35
</general>
36
</sections>
37
-
38
<sections>
39
<iglobal_integration translate="label" module="stores">
40
<label>iGlobal Integration Options</label>
@@ -44,7 +44,7 @@
44
<show_in_default>1</show_in_default>
45
<show_in_website>1</show_in_website>
46
<show_in_store>1</show_in_store>
47
-
48
<groups>
49
<apireqs translate="label">
50
<label>Store Setup</label>
@@ -54,9 +54,9 @@
54
<show_in_default>1</show_in_default>
55
<show_in_website>1</show_in_website>
56
<show_in_store>1</show_in_store>
57
-
58
<fields>
59
-
60
<heading_id translate="label">
61
<label>Store Identification</label>
62
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
@@ -65,7 +65,7 @@
65
<show_in_website>1</show_in_website>
66
<show_in_store>0</show_in_store>
67
</heading_id>
68
-
69
<iglobalid>
70
<label>iGlobal Store ID Number</label>
71
<comment>Paste the provided 3 digit store number here.</comment>
@@ -73,9 +73,9 @@
73
<sort_order>20</sort_order>
74
<show_in_default>1</show_in_default>
75
<show_in_website>1</show_in_website>
76
- <show_in_store>1</show_in_store>
77
</iglobalid>
78
-
79
<secret>
80
<label>iGlobal API Key</label>
81
<comment>Paste the provided API secret security key here.</comment>
@@ -83,9 +83,9 @@
83
<sort_order>30</sort_order>
84
<show_in_default>1</show_in_default>
85
<show_in_website>1</show_in_website>
86
- <show_in_store>1</show_in_store>
87
- </secret>
88
-
89
<igsubdomain>
90
<label>iGlobal Hosted Checkout Subdomain</label>
91
<comment>Paste the provided subdomain here.</comment>
@@ -93,9 +93,9 @@
93
<sort_order>35</sort_order>
94
<show_in_default>1</show_in_default>
95
<show_in_website>1</show_in_website>
96
- <show_in_store>1</show_in_store>
97
- </igsubdomain>
98
-
99
<heading_includes translate="label">
100
<label>Included Files</label>
101
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
@@ -103,8 +103,8 @@
103
<show_in_default>1</show_in_default>
104
<show_in_website>1</show_in_website>
105
<show_in_store>0</show_in_store>
106
- </heading_includes>
107
-
108
<ice>
109
<label>ICE script</label>
110
<comment>Paste the provided link here. Please Be sure to include "https://" at the begining.</comment>
@@ -112,9 +112,9 @@
112
<sort_order>50</sort_order>
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>
120
<comment>Turn on to enable iGlobal International Checkout. Leave this off until setup and testing has been completed!</comment>
@@ -147,29 +147,49 @@
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>
153
<frontend_model>adminhtml/system_config_form_field_heading</frontend_model>
154
- <sort_order>90</sort_order>
155
<show_in_default>1</show_in_default>
156
<show_in_website>1</show_in_website>
157
<show_in_store>1</show_in_store>
158
- </heading_error>
159
-
160
<admin_email>
161
<label>Admin Email Address</label>
162
<comment>This email address will receive notices of errors</comment>
163
<frontend_type>text</frontend_type>
164
- <sort_order>100</sort_order>
165
<show_in_default>1</show_in_default>
166
<show_in_website>1</show_in_website>
167
- <show_in_store>1</show_in_store>
168
</admin_email>
169
-
170
</fields>
171
</apireqs>
172
-
173
<igmat translate="label">
174
<label>iGlobal Welcome Mat</label>
175
<frontend_type>text</frontend_type>
@@ -180,9 +200,9 @@
180
<comment>
181
<![CDATA[ <div style="padding:10px;background-color:#fff;border:1px solid #ddd;margin-bottom:7px;">iGlobal's unique welcome mat will recognize your customers' location and automatically tailor their shopping experience to make it seamless and increase your conversions! If you have any questions or problems <a href="http://www.iglobalstores.com/contact-us.html" target="_blank">contact us online</a> or call 1-800-942-0721.<br /></div>]]>
182
</comment>
183
-
184
- <fields>
185
-
186
<welcome_mat_active translate="label comment">
187
<label>Use the Welcome Mat?</label>
188
<comment>For testing purposes you may use the default Welcome Mat by leaving the "Welcome Mat Script" field blank. This may result in poor appearance or strange behavior, and should be used only for testing and development. Please contact us at 1-800-942-0721 to have use make a customized script to match your site's style and design.</comment>
@@ -193,7 +213,7 @@
193
<show_in_website>1</show_in_website>
194
<show_in_store>1</show_in_store>
195
</welcome_mat_active>
196
-
197
<welcome_mat_script translate="label comment">
198
<label>Welcome Mat Script File</label>
199
<frontend_type>file</frontend_type>
@@ -205,7 +225,7 @@
205
<show_in_store>1</show_in_store>
206
<!--<depends><welcome_mat_active>1</welcome_mat_active></depends>-->
207
</welcome_mat_script>
208
-
209
<welcome_mat_css translate="label comment">
210
<label>Welcome Mat CSS File</label>
211
<frontend_type>file</frontend_type>
@@ -217,7 +237,7 @@
217
<show_in_store>1</show_in_store>
218
<!--<depends><welcome_mat_active>1</welcome_mat_active></depends>-->
219
</welcome_mat_css>
220
-
221
<flag_parent>
222
<label>Flag postition selector</label>
223
<comment>Enter the code provided to customize the location of the Welcome Mat flag, or leave blank to use the default location.</comment>
@@ -225,10 +245,10 @@
225
<sort_order>40</sort_order>
226
<show_in_default>1</show_in_default>
227
<show_in_website>1</show_in_website>
228
- <show_in_store>1</show_in_store>
229
- <!--<depends><welcome_mat_active>1</welcome_mat_active></depends>-->
230
</flag_parent>
231
-
232
<!-- <flag_method>
233
<label>Flag attachement method</label>
234
<comment>Enter the code provided to customize the location of the Welcome Mat flag, or leave blank to use the default location.</comment>
@@ -237,12 +257,12 @@
237
<sort_order>41</sort_order>
238
<show_in_default>1</show_in_default>
239
<show_in_website>1</show_in_website>
240
- <show_in_store>1</show_in_store>
241
<depends>
242
<welcome_mat_active>1</welcome_mat_active>
243
- </depends>
244
</flag_method> -->
245
-
246
<flag_method>
247
<label>Flag insertion method</label>
248
<comment>Enter the code provided to customize the location of the Welcome Mat flag, or leave blank to use the default location.</comment>
@@ -250,10 +270,10 @@
250
<sort_order>42</sort_order>
251
<show_in_default>1</show_in_default>
252
<show_in_website>1</show_in_website>
253
- <show_in_store>1</show_in_store>
254
- <!--<depends><welcome_mat_active>1</welcome_mat_active></depends>-->
255
</flag_method>
256
-
257
<flag_code>
258
<label>Flag insertion code</label>
259
<comment>Enter the code provided to customize the location of the Welcome Mat flag, or leave blank to use the default location.</comment>
@@ -261,10 +281,10 @@
261
<sort_order>42</sort_order>
262
<show_in_default>1</show_in_default>
263
<show_in_website>1</show_in_website>
264
- <show_in_store>1</show_in_store>
265
- <!--<depends><welcome_mat_active>1</welcome_mat_active></depends>-->
266
</flag_code>
267
-
268
<store_logo>
269
<label>Your Store's Logo URL</label>
270
<comment>Enter the URL provided to customize the look of the welcome mat, showing customers your logo.</comment>
@@ -272,14 +292,14 @@
272
<sort_order>50</sort_order>
273
<show_in_default>1</show_in_default>
274
<show_in_website>1</show_in_website>
275
- <show_in_store>1</show_in_store>
276
- <!--<depends><welcome_mat_active>1</welcome_mat_active></depends>-->
277
</store_logo>
278
-
279
</fields>
280
-
281
</igmat>
282
-
283
<igjq translate="label">
284
<label>jQuery Settings</label>
285
<frontend_type>text</frontend_type>
@@ -290,9 +310,9 @@
290
<comment>
291
<![CDATA[<div style="padding:10px;background-color:#fff;border:1px solid #ddd;margin-bottom:7px;">To avoid conflicts, please select Yes ONLY if you do not currently have jQuery running on your site. If you are unsure, please contact us at 1-800-942-0721 and we will assist you. </div>]]>
292
</comment>
293
-
294
<fields>
295
-
296
<enabled translate="label">
297
<label>Enabled</label>
298
<frontend_type>select</frontend_type>
@@ -313,12 +333,12 @@
313
<show_in_website>1</show_in_website>
314
<show_in_store>1</show_in_store>
315
</iglogging>
316
-
317
</fields>
318
</igjq>
319
-
320
</groups>
321
-
322
</iglobal_integration>
323
324
<payment translate="label" module="payment">
7
<sort_order>150</sort_order>
8
</iglobal>
9
</tabs>
10
+
11
<sections>
12
<general>
13
+
14
<groups>
15
<country>
16
+
17
<fields>
18
+
19
<ig_domestic_countries>
20
<label>Domestic Shipping Countries</label>
21
<comment>Hold down Ctrl to select more than one. Select each country to which you will ship. iGlobal will not service these countries, and customers will use your checkout system.</comment>
27
<show_in_store>1</show_in_store>
28
<can_be_empty>1</can_be_empty>
29
</ig_domestic_countries>
30
+
31
</fields>
32
</country>
33
<