Aramex_Shipping_Tracking_API - Version 2.2.0

Version Notes

version 2.2.0

Download this release

Release Info

Developer Aramex
Extension Aramex_Shipping_Tracking_API
Version 2.2.0
Comparing to
See all releases


Code changes from version 2.0.1 to 2.2.0

Files changed (25) hide show
  1. app/code/community/Aramex/Core/etc/config.xml +7 -0
  2. app/code/community/Aramex/Core/etc/system.xml +175 -2
  3. app/code/community/Aramex/Shipment/Block/Sales/Order/View.php +66 -15
  4. app/code/community/Aramex/Shipment/Helper/Data.php +3 -0
  5. app/code/community/Aramex/Shipment/controllers/IndexController.php +9 -1
  6. app/code/community/Aramex/Shipment/controllers/ShipmentController.php +67 -22
  7. app/code/community/Aramex/Shipment/etc/config.xml +3 -14
  8. app/code/community/Aramex/Shipment/etc/wsdl/Aramex/TestMode/Tracking.wsdl +176 -0
  9. app/code/community/Aramex/Shipment/etc/wsdl/Aramex/TestMode/aramex-rates-calculator-wsdl.wsdl +206 -0
  10. app/code/community/Aramex/Shipment/etc/wsdl/Aramex/TestMode/shipping.wsdl +486 -0
  11. app/code/community/Aramex/Shipping/Model/Carrier/Aramex.php +123 -11
  12. app/code/community/Aramex/Shipping/Model/Carrier/Aramex/Source/DomesticAdditionalServices.php +49 -0
  13. app/code/community/Aramex/Shipping/Model/Carrier/Aramex/Source/Domesticmethods.php +69 -0
  14. app/code/community/Aramex/Shipping/Model/Carrier/Aramex/Source/InternationalAdditionalServices.php +52 -0
  15. app/code/community/Aramex/Shipping/Model/Carrier/Aramex/Source/Internationalmethods.php +53 -0
  16. app/code/community/Aramex/Shipping/Model/Carrier/Aramex/Source/Productgroup.php +36 -0
  17. app/code/community/Aramex/Shipping/etc/config.xml +8 -14
  18. app/code/community/Aramex/Shipping/etc/system.xml +110 -356
  19. app/design/adminhtml/default/default/layout/aramex.xml +1 -0
  20. app/design/adminhtml/default/default/template/aramex/calculate_rate.phtml +52 -13
  21. app/design/adminhtml/default/default/template/aramex/schedule_puckup.phtml +46 -2
  22. app/design/adminhtml/default/default/template/aramex/shipment.phtml +209 -73
  23. app/etc/modules/Aramex_Shipping.xml +9 -0
  24. package.xml +6 -6
  25. skin/adminhtml/default/default/aramex/js/jquery.chained.js +106 -0
app/code/community/Aramex/Core/etc/config.xml CHANGED
@@ -44,10 +44,17 @@
44
  </adminhtml>
45
  <default>
46
  <aramexsettings>
 
 
 
 
 
 
47
  <template>
48
  <shipment_template>aramexsettings_template_shipment_template</shipment_template>
49
  <copy_method>bcc</copy_method>
50
  </template>
51
  </aramexsettings>
 
52
  </default>
53
  </config>
44
  </adminhtml>
45
  <default>
46
  <aramexsettings>
47
+ <config>
48
+ <allowed_domestic_methods>OND,ONP,CDA</allowed_domestic_methods>
49
+ <allowed_international_methods>IBD,PDX,PLX</allowed_international_methods>
50
+ <report_id>9729</report_id>
51
+ <sandbox_flag>0</sandbox_flag>
52
+ </config>
53
  <template>
54
  <shipment_template>aramexsettings_template_shipment_template</shipment_template>
55
  <copy_method>bcc</copy_method>
56
  </template>
57
  </aramexsettings>
58
+
59
  </default>
60
  </config>
app/code/community/Aramex/Core/etc/system.xml CHANGED
@@ -73,11 +73,184 @@
73
  <show_in_store>1</show_in_store>
74
  </password>
75
  </fields>
76
- </settings> <shipperdetail translate="label"> <label>Shipper Details</label> <frontend_type>text</frontend_type> <sort_order>2</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> <fields> <name> <label>Name</label> <frontend_type>text</frontend_type> <sort_order>1</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </name> <email> <label>Email</label> <frontend_type>text</frontend_type> <sort_order>2</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </email> <company> <label>Company</label> <frontend_type>text</frontend_type> <sort_order>3</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </company> <address> <label>Address</label> <frontend_type>text</frontend_type> <sort_order>4</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </address> <country> <label>Country Code</label> <frontend_type>text</frontend_type> <sort_order>5</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </country> <city> <label>City</label> <frontend_type>text</frontend_type> <sort_order>6</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </city> <postalcode> <label>Postal Code</label> <frontend_type>text</frontend_type> <sort_order>7</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </postalcode> <state> <label>State</label> <frontend_type>text</frontend_type> <sort_order>8</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </state> <phone> <label>Phone</label> <frontend_type>text</frontend_type> <sort_order>9</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </phone> </fields> </shipperdetail>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  <template>
78
  <label>Shipment Email Template</label>
79
  <frontend_type>text</frontend_type>
80
- <sort_order>3</sort_order>
81
  <show_in_default>1</show_in_default>
82
  <show_in_website>1</show_in_website>
83
  <show_in_store>1</show_in_store>
73
  <show_in_store>1</show_in_store>
74
  </password>
75
  </fields>
76
+ </settings>
77
+ <config>
78
+ <label>Service Configuration</label>
79
+ <frontend_type>text</frontend_type>
80
+ <sort_order>2</sort_order>
81
+ <show_in_default>1</show_in_default>
82
+ <show_in_website>1</show_in_website>
83
+ <show_in_store>1</show_in_store>
84
+ <fields>
85
+ <sandbox_flag translate="label">
86
+ <label>Test Mode</label>
87
+ <frontend_type>select</frontend_type>
88
+ <source_model>adminhtml/system_config_source_yesno</source_model>
89
+ <sort_order>1</sort_order>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>1</show_in_website>
92
+ <show_in_store>1</show_in_store>
93
+ </sandbox_flag>
94
+
95
+ <!--<allowed_product_group translate="label">
96
+ <label>Allowed Product Group</label>
97
+ <frontend_type>multiselect</frontend_type>
98
+ <source_model>aramex/carrier_aramex_source_productgroup</source_model>
99
+ <sort_order>2</sort_order>
100
+ <show_in_default>1</show_in_default>
101
+ <show_in_website>1</show_in_website>
102
+ <show_in_store>1</show_in_store>
103
+ <can_be_empty>1</can_be_empty>
104
+ </allowed_product_group>-->
105
+
106
+ <report_id>
107
+ <label>Report ID</label>
108
+ <frontend_type>text</frontend_type>
109
+ <sort_order>2</sort_order>
110
+ <show_in_default>1</show_in_default>
111
+ <show_in_website>1</show_in_website>
112
+ <show_in_store>1</show_in_store>
113
+ </report_id>
114
+
115
+ <allowed_domestic_methods translate="label">
116
+ <label>Allowed Domestic Methods</label>
117
+ <frontend_type>multiselect</frontend_type>
118
+ <frontend_class>required-entry</frontend_class>
119
+ <source_model>aramex/carrier_aramex_source_domesticmethods</source_model>
120
+ <sort_order>3</sort_order>
121
+ <show_in_default>1</show_in_default>
122
+ <show_in_website>1</show_in_website>
123
+ <show_in_store>1</show_in_store>
124
+ <!--<can_be_empty>0</can_be_empty>-->
125
+ <required>1</required>
126
+ </allowed_domestic_methods>
127
+
128
+
129
+ <allowed_domestic_additional_services translate="label">
130
+ <label>Allowed Domestic Additional Services</label>
131
+ <frontend_type>multiselect</frontend_type>
132
+ <frontend_class>required-entry</frontend_class>
133
+ <source_model>aramex/carrier_aramex_source_domesticAdditionalServices</source_model>
134
+ <sort_order>4</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
+ <required>1</required>
139
+ </allowed_domestic_additional_services>
140
+
141
+
142
+ <allowed_international_methods translate="label">
143
+ <label>Allowed International Methods</label>
144
+ <frontend_type>multiselect</frontend_type>
145
+ <source_model>aramex/carrier_aramex_source_internationalmethods</source_model>
146
+ <sort_order>5</sort_order>
147
+ <show_in_default>1</show_in_default>
148
+ <show_in_website>1</show_in_website>
149
+ <show_in_store>1</show_in_store>
150
+ <frontend_class>required-entry</frontend_class>
151
+ <required>1</required>
152
+ </allowed_international_methods>
153
+
154
+ <allowed_international_additional_services translate="label">
155
+ <label>Allowed International Additional Services</label>
156
+ <frontend_type>multiselect</frontend_type>
157
+ <source_model>aramex/carrier_aramex_source_internationalAdditionalServices</source_model>
158
+ <sort_order>6</sort_order>
159
+ <show_in_default>1</show_in_default>
160
+ <show_in_website>1</show_in_website>
161
+ <show_in_store>1</show_in_store>
162
+ <frontend_class>required-entry</frontend_class>
163
+ <required>1</required>
164
+ </allowed_international_additional_services>
165
+
166
+ </fields>
167
+ </config>
168
+ <shipperdetail translate="label">
169
+ <label>Shipper Details</label>
170
+ <frontend_type>text</frontend_type>
171
+ <sort_order>3</sort_order>
172
+ <show_in_default>1</show_in_default>
173
+ <show_in_website>1</show_in_website>
174
+ <show_in_store>1</show_in_store>
175
+ <fields>
176
+ <name>
177
+ <label>Name</label>
178
+ <frontend_type>text</frontend_type>
179
+ <sort_order>1</sort_order>
180
+ <show_in_default>1</show_in_default>
181
+ <show_in_website>1</show_in_website>
182
+ <show_in_store>1</show_in_store>
183
+ </name>
184
+ <email>
185
+ <label>Email</label>
186
+ <frontend_type>text</frontend_type>
187
+ <sort_order>2</sort_order>
188
+ <show_in_default>1</show_in_default>
189
+ <show_in_website>1</show_in_website>
190
+ <show_in_store>1</show_in_store>
191
+ </email>
192
+ <company>
193
+ <label>Company</label>
194
+ <frontend_type>text</frontend_type>
195
+ <sort_order>3</sort_order>
196
+ <show_in_default>1</show_in_default>
197
+ <show_in_website>1</show_in_website>
198
+ <show_in_store>1</show_in_store>
199
+ </company>
200
+ <address>
201
+ <label>Address</label>
202
+ <frontend_type>text</frontend_type>
203
+ <sort_order>4</sort_order>
204
+ <show_in_default>1</show_in_default>
205
+ <show_in_website>1</show_in_website>
206
+ <show_in_store>1</show_in_store>
207
+ </address>
208
+ <country>
209
+ <label>Country Code</label>
210
+ <frontend_type>text</frontend_type>
211
+ <sort_order>5</sort_order>
212
+ <show_in_default>1</show_in_default>
213
+ <show_in_website>1</show_in_website>
214
+ <show_in_store>1</show_in_store>
215
+ </country>
216
+ <city>
217
+ <label>City</label>
218
+ <frontend_type>text</frontend_type>
219
+ <sort_order>6</sort_order>
220
+ <show_in_default>1</show_in_default>
221
+ <show_in_website>1</show_in_website>
222
+ <show_in_store>1</show_in_store>
223
+ </city>
224
+ <postalcode>
225
+ <label>Postal Code</label>
226
+ <frontend_type>text</frontend_type>
227
+ <sort_order>7</sort_order>
228
+ <show_in_default>1</show_in_default>
229
+ <show_in_website>1</show_in_website>
230
+ <show_in_store>1</show_in_store>
231
+ </postalcode>
232
+ <state>
233
+ <label>State</label>
234
+ <frontend_type>text</frontend_type>
235
+ <sort_order>8</sort_order>
236
+ <show_in_default>1</show_in_default>
237
+ <show_in_website>1</show_in_website>
238
+ <show_in_store>1</show_in_store>
239
+ </state>
240
+ <phone>
241
+ <label>Phone</label>
242
+ <frontend_type>text</frontend_type>
243
+ <sort_order>9</sort_order>
244
+ <show_in_default>1</show_in_default>
245
+ <show_in_website>1</show_in_website>
246
+ <show_in_store>1</show_in_store>
247
+ </phone>
248
+ </fields>
249
+ </shipperdetail>
250
  <template>
251
  <label>Shipment Email Template</label>
252
  <frontend_type>text</frontend_type>
253
+ <sort_order>4</sort_order>
254
  <show_in_default>1</show_in_default>
255
  <show_in_website>1</show_in_website>
256
  <show_in_store>1</show_in_store>
app/code/community/Aramex/Shipment/Block/Sales/Order/View.php CHANGED
@@ -2,23 +2,74 @@
2
  class Aramex_Shipment_Block_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View
3
  {
4
  function __construct()
5
- { $itemscount = 0; $totalWeight = 0; $_order = Mage::getModel('sales/order')->load($this->getRequest()->getParam('order_id')); $itemsv = $_order->getAllVisibleItems(); foreach($itemsv as $itemvv){ if($itemvv->getQtyOrdered() > $itemvv->getQtyShipped()){ $itemscount += $itemvv->getQtyOrdered() - $itemvv->getQtyShipped(); } if($itemvv->getWeight() != 0){ $weight = $itemvv->getWeight()*$itemvv->getQtyOrdered(); } else { $weight = 0.5*$itemvv->getQtyOrdered(); } $totalWeight += $weight; }
6
- $this->_addButton('create_aramex_shipment', array(
7
- 'label' => Mage::helper('Sales')->__('Prepare Aramex Shipment'),
8
- 'onclick' => 'aramexpop('.$itemscount.')',
9
- 'class' => 'go'
10
- ), 0, 100, 'header', 'header');
11
- //barry code
12
- if($itemscount==0){
13
- $this->_addButton('print_aramex_label', array(
14
- 'label' => Mage::helper('Sales')->__('Aramex Print Label'),
15
- 'onclick' => "myObj.printLabel()",
16
- 'class' => 'go'
17
- ), 0, 200, 'header', 'header');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  }
19
- //barry code end here
 
 
 
 
 
 
 
20
 
21
- parent::__construct();
 
 
 
 
 
 
 
 
 
 
22
  }
23
  }
24
  ?>
2
  class Aramex_Shipment_Block_Sales_Order_View extends Mage_Adminhtml_Block_Sales_Order_View
3
  {
4
  function __construct()
5
+ {
6
+ $itemscount = 0;
7
+ $totalWeight = 0;
8
+ $_order = Mage::getModel('sales/order')->load($this->getRequest()->getParam('order_id'));
9
+ $itemsv = $_order->getAllVisibleItems();
10
+ foreach($itemsv as $itemvv){
11
+ if($itemvv->getQtyOrdered() > $itemvv->getQtyShipped()){
12
+ $itemscount += $itemvv->getQtyOrdered() - $itemvv->getQtyShipped();
13
+ }
14
+ if($itemvv->getWeight() != 0){
15
+ $weight = $itemvv->getWeight()*$itemvv->getQtyOrdered();
16
+ } else {
17
+ $weight = 0.5*$itemvv->getQtyOrdered();
18
+ }
19
+ $totalWeight += $weight;
20
+ }
21
+
22
+ $shipments = Mage::getResourceModel('sales/order_shipment_collection')
23
+ ->addAttributeToSelect('*')
24
+ ->addFieldToFilter("order_id",$_order->getId())->join("sales/shipment_comment",'main_table.entity_id=parent_id','comment')->addFieldToFilter('comment', array('like'=>"%{$_order->getIncrementId()}%"))->load();
25
+
26
+ $aramex_return_button = false;
27
+
28
+ if($shipments->count()){
29
+ foreach($shipments as $key=>$comment){
30
+ if (version_compare(PHP_VERSION, '5.3.0') <= 0) {
31
+ $awbno=substr($comment->getComment(),0, strpos($comment->getComment(),"- Order No"));
32
+ }
33
+ else{
34
+ $awbno=strstr($comment->getComment(),"- Order No",true);
35
+ }
36
+ $awbno=trim($awbno,"AWB No.");
37
+ break;
38
+ }
39
+ if((int) $awbno)
40
+ $aramex_return_button = true;
41
+ }
42
+
43
+
44
+
45
+
46
+ if($_order->canShip()){
47
+ $this->_addButton('create_aramex_shipment', array(
48
+ 'label' => Mage::helper('Sales')->__('Prepare Aramex Shipment'),
49
+ 'onclick' => 'aramexpop('.$itemscount.')',
50
+ 'class' => 'go'
51
+ ), 0, 100, 'header', 'header');
52
  }
53
+ elseif(!$_order->canShip() && $aramex_return_button){
54
+ $this->_addButton('create_aramex_shipment', array(
55
+ 'label' => Mage::helper('Sales')->__('Return Aramex Shipment'),
56
+ 'onclick' => 'aramexreturnpop('.$itemscount.')',
57
+ 'class' => 'go'
58
+ ), 0, 100, 'header', 'header');
59
+ }
60
+
61
 
62
+ //barry code
63
+ if($itemscount==0){
64
+ $this->_addButton('print_aramex_label', array(
65
+ 'label' => Mage::helper('Sales')->__('Aramex Print Label'),
66
+ 'onclick' => "myObj.printLabel()",
67
+ 'class' => 'go'
68
+ ), 0, 200, 'header', 'header');
69
+ }
70
+ //barry code end here
71
+
72
+ parent::__construct();
73
  }
74
  }
75
  ?>
app/code/community/Aramex/Shipment/Helper/Data.php CHANGED
@@ -22,6 +22,9 @@ class Aramex_Shipment_Helper_Data extends Mage_Core_Helper_Abstract
22
  }
23
  public function getWsdlPath(){
24
  $wsdlBasePath = Mage::getModuleDir('etc', 'Aramex_Shipment') . DS . 'wsdl' . DS . 'Aramex' . DS;
 
 
 
25
  return $wsdlBasePath;
26
  }
27
 
22
  }
23
  public function getWsdlPath(){
24
  $wsdlBasePath = Mage::getModuleDir('etc', 'Aramex_Shipment') . DS . 'wsdl' . DS . 'Aramex' . DS;
25
+ if(Mage::getStoreConfig('aramexsettings/config/sandbox_flag')==1){
26
+ $wsdlBasePath .='TestMode'.DS;
27
+ }
28
  return $wsdlBasePath;
29
  }
30
 
app/code/community/Aramex/Shipment/controllers/IndexController.php CHANGED
@@ -1 +1,9 @@
1
- <?php class Aramex_Shipment_IndexController extends Mage_Adminhtml_Controller_Action { public function indexAction() { $this->loadLayout(); $this->renderLayout(); } }?>
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class Aramex_Shipment_IndexController extends Mage_Adminhtml_Controller_Action
3
+ {
4
+ public function indexAction(){
5
+ $this->loadLayout();
6
+ $this->renderLayout();
7
+ }
8
+ }
9
+ ?>
app/code/community/Aramex/Shipment/controllers/ShipmentController.php CHANGED
@@ -255,16 +255,22 @@
255
  $major_par['Shipments'][] = $params;
256
  $clientInfo = Mage::helper('aramexshipment')->getClientInfo();
257
  $major_par['ClientInfo'] =$clientInfo;
 
 
 
 
 
258
 
259
  $major_par['LabelInfo'] = array(
260
- 'ReportID' => 9729, //'9201',
261
  'ReportType' => 'URL'
262
  );
 
263
 
264
  $formSession=Mage::getSingleton('adminhtml/session');
265
  $formSession->setData("form_data",$post);
266
  try {
267
- //create shipment call
268
  $auth_call = $soapClient->CreateShipments($major_par);
269
  if($auth_call->HasErrors){
270
  if(empty($auth_call->Shipments)){
@@ -283,11 +289,11 @@
283
  }
284
  Mage::throwException($notification_string);
285
  } else {
286
- Mage::throwException($this->__('Aramex: ' . $auth_call->Shipments->ProcessedShipment->Notifications->Notification->Code .' - '. $auth_call->Shipments->ProcessedShipment->Notifications->Notification->Message));Mage::throwException($this->__('Aramex: ' . $auth_call->Shipments->ProcessedShipment->Notifications->Notification->Code .' - '. $auth_call->Shipments->ProcessedShipment->Notifications->Notification->Message));
287
  }
288
  }
289
  } else {
290
- if($order->canShip()) {
291
 
292
  $shipmentid = Mage::getModel('sales/order_shipment_api')->create($order->getIncrementId(), $post['aramex_items'], "AWB No. ".$auth_call->Shipments->ProcessedShipment->ID." - Order No. ".$auth_call->Shipments->ProcessedShipment->Reference1." - <a href='javascript:void(0);' onclick='myObj.printLabel();'>Print Label</a>");
293
 
@@ -295,9 +301,9 @@
295
 
296
  $ship = Mage::getModel('sales/order_shipment_api')->addTrack($shipmentid, 'aramex', 'Aramex', $auth_call->Shipments->ProcessedShipment->ID);
297
 
298
- //sending mail
299
  if($ship){
300
- // if($post['aramex_email_customer'] == 'yes'){
301
 
302
  /* send shipment mail */
303
  $storeId = $order->getStore()->getId();
@@ -322,13 +328,13 @@
322
 
323
 
324
  if ($copyTo && $copyMethod == 'bcc') {
325
- // Add bcc to customer email
326
  foreach ($copyTo as $email) {
327
  $emailInfo->addBcc($email);
328
  }
329
  }
330
  $mailer->addEmailInfo($emailInfo);
331
- // Email copies are sent as separated emails if their copy method is 'copy'
332
  if ($copyTo && $copyMethod == 'copy') {
333
  foreach ($copyTo as $email) {
334
  $emailInfo = Mage::getModel('core/email_info');
@@ -341,7 +347,7 @@
341
  $senderName=Mage::getStoreConfig(self::XML_PATH_TRANS_IDENTITY_NAME,$storeId);
342
  $senderEmail=Mage::getStoreConfig(self::XML_PATH_TRANS_IDENTITY_EMAIL,$storeId);
343
 
344
- // Set all required params and send emails
345
  $mailer->setSender(array('name' => $senderName, 'email' =>$senderEmail));
346
  $mailer->setStoreId($storeId);
347
  $mailer->setTemplateId($templateId);
@@ -357,11 +363,22 @@
357
  Mage::getSingleton('core/session')
358
  ->addError('Unable to send email.');
359
  }
360
- // }
361
  }
362
 
363
  Mage::getSingleton('core/session')->addSuccess('Aramex Shipment Number: '.$auth_call->Shipments->ProcessedShipment->ID.' has been created.');
364
- //$order->setState('warehouse_pickup_shipped', true);
 
 
 
 
 
 
 
 
 
 
 
365
  }
366
  }
367
  } catch (Exception $e) {
@@ -397,18 +414,41 @@
397
  ->addAttributeToSelect('*')
398
  ->addFieldToFilter("order_id",$_order->getId())->join("sales/shipment_comment",'main_table.entity_id=parent_id','comment')->addFieldToFilter('comment', array('like'=>"%{$_order->getIncrementId()}%"))->load();
399
 
 
 
 
 
 
 
 
 
 
 
 
 
 
400
 
401
  if($shipments->count()){
402
- foreach($shipments as $key=>$comment){
403
- if (version_compare(PHP_VERSION, '5.3.0') <= 0) {
404
- $awbno=substr($comment->getComment(),0, strpos($comment->getComment(),"- Order No"));
405
- }
406
- else{
407
- $awbno=strstr($comment->getComment(),"- Order No",true);
 
 
 
 
 
 
408
  }
409
- $awbno=trim($awbno,"AWB No.");
410
- break;
 
 
 
411
  }
 
412
  $params = array(
413
 
414
  'ClientInfo' => $clientInfo,
@@ -421,13 +461,12 @@
421
  'Reference5' => '',
422
  ),
423
  'LabelInfo' => array(
424
- 'ReportID' => 9729,
425
  'ReportType' => 'URL',
426
  ),
427
  );
428
  $params['ShipmentNumber']=$awbno;
429
- /* print_r($params);
430
- exit; */
431
  try {
432
  $auth_call = $soapClient->PrintLabel($params);
433
  /* bof PDF demaged Fixes debug */
@@ -438,6 +477,7 @@
438
  }
439
  } else {
440
  Mage::throwException($this->__('Aramex: ' . $auth_call->Notifications->Notification->Code . ' - '. $auth_call->Notifications->Notification->Message));
 
441
  }
442
  }
443
  /* eof PDF demaged Fixes */
@@ -451,6 +491,11 @@
451
  Mage::getSingleton('adminhtml/session')->addError('Error : ' . $fault->faultstring);
452
  $this->_redirectUrl($previuosUrl);
453
  }
 
 
 
 
 
454
  }else{
455
  Mage::getSingleton('adminhtml/session')->addError($this->__('Shipment is empty or not created yet.'));
456
  $this->_redirectUrl($previuosUrl);
255
  $major_par['Shipments'][] = $params;
256
  $clientInfo = Mage::helper('aramexshipment')->getClientInfo();
257
  $major_par['ClientInfo'] =$clientInfo;
258
+
259
+ $report_id = (int) Mage::getStoreConfig('aramexsettings/config/report_id');
260
+ if(!$report_id){
261
+ $report_id =9729;
262
+ }
263
 
264
  $major_par['LabelInfo'] = array(
265
+ 'ReportID' => $report_id, //'9201',
266
  'ReportType' => 'URL'
267
  );
268
+
269
 
270
  $formSession=Mage::getSingleton('adminhtml/session');
271
  $formSession->setData("form_data",$post);
272
  try {
273
+ //create shipment call
274
  $auth_call = $soapClient->CreateShipments($major_par);
275
  if($auth_call->HasErrors){
276
  if(empty($auth_call->Shipments)){
289
  }
290
  Mage::throwException($notification_string);
291
  } else {
292
+ Mage::throwException($this->__('Aramex: ' . $auth_call->Shipments->ProcessedShipment->Notifications->Notification->Code .' - '. $auth_call->Shipments->ProcessedShipment->Notifications->Notification->Message));
293
  }
294
  }
295
  } else {
296
+ if($order->canShip() && $post['aramex_return_shipment_creation_date']=="create") {
297
 
298
  $shipmentid = Mage::getModel('sales/order_shipment_api')->create($order->getIncrementId(), $post['aramex_items'], "AWB No. ".$auth_call->Shipments->ProcessedShipment->ID." - Order No. ".$auth_call->Shipments->ProcessedShipment->Reference1." - <a href='javascript:void(0);' onclick='myObj.printLabel();'>Print Label</a>");
299
 
301
 
302
  $ship = Mage::getModel('sales/order_shipment_api')->addTrack($shipmentid, 'aramex', 'Aramex', $auth_call->Shipments->ProcessedShipment->ID);
303
 
304
+ /* sending mail */
305
  if($ship){
306
+ /* if($post['aramex_email_customer'] == 'yes'){ */
307
 
308
  /* send shipment mail */
309
  $storeId = $order->getStore()->getId();
328
 
329
 
330
  if ($copyTo && $copyMethod == 'bcc') {
331
+ /* Add bcc to customer email */
332
  foreach ($copyTo as $email) {
333
  $emailInfo->addBcc($email);
334
  }
335
  }
336
  $mailer->addEmailInfo($emailInfo);
337
+ /* Email copies are sent as separated emails if their copy method is 'copy' */
338
  if ($copyTo && $copyMethod == 'copy') {
339
  foreach ($copyTo as $email) {
340
  $emailInfo = Mage::getModel('core/email_info');
347
  $senderName=Mage::getStoreConfig(self::XML_PATH_TRANS_IDENTITY_NAME,$storeId);
348
  $senderEmail=Mage::getStoreConfig(self::XML_PATH_TRANS_IDENTITY_EMAIL,$storeId);
349
 
350
+ /* Set all required params and send emails */
351
  $mailer->setSender(array('name' => $senderName, 'email' =>$senderEmail));
352
  $mailer->setStoreId($storeId);
353
  $mailer->setTemplateId($templateId);
363
  Mage::getSingleton('core/session')
364
  ->addError('Unable to send email.');
365
  }
366
+ /* } */
367
  }
368
 
369
  Mage::getSingleton('core/session')->addSuccess('Aramex Shipment Number: '.$auth_call->Shipments->ProcessedShipment->ID.' has been created.');
370
+ /* $order->setState('warehouse_pickup_shipped', true); */
371
+ }
372
+ elseif($post['aramex_return_shipment_creation_date']=="return"){
373
+ $message = "Aramex Shipment Return Order AWB No. ".$auth_call->Shipments->ProcessedShipment->ID." - Order No. ".$auth_call->Shipments->ProcessedShipment->Reference1." - <a href='javascript:void(0);' onclick='myObj.printLabel();'>Print Label</a>";
374
+
375
+ Mage::getSingleton('core/session')->addSuccess('Aramex Shipment Return Order Number: '.$auth_call->Shipments->ProcessedShipment->ID.' has been created.');
376
+ $order->addStatusToHistory($order->getStatus(), $message, false);
377
+ $order->save();
378
+ }
379
+
380
+ else{
381
+ Mage::throwException($this->__('Cannot do shipment for the order.'));
382
  }
383
  }
384
  } catch (Exception $e) {
414
  ->addAttributeToSelect('*')
415
  ->addFieldToFilter("order_id",$_order->getId())->join("sales/shipment_comment",'main_table.entity_id=parent_id','comment')->addFieldToFilter('comment', array('like'=>"%{$_order->getIncrementId()}%"))->load();
416
 
417
+
418
+ $awbno ='';
419
+ $orderHistory = Mage::getModel('sales/order_status_history')->getCollection()
420
+ ->addFieldToFilter('parent_id', $_order->getId())->setOrder('created_at','desc');
421
+ foreach($orderHistory as $history){
422
+ $comments = $history->getComment();
423
+ if($comments && preg_match('/Aramex Shipment Return Order AWB No. ([0-9]+)/',$comments,$cmatches)){
424
+ $awbno = $cmatches[1];
425
+ break;
426
+ }
427
+ }
428
+
429
+
430
 
431
  if($shipments->count()){
432
+
433
+ if($awbno == ''){
434
+ foreach($shipments as $key=>$comment){
435
+ if (version_compare(PHP_VERSION, '5.3.0') <= 0) {
436
+ $awbno=substr($comment->getComment(),0, strpos($comment->getComment(),"- Order No"));
437
+ }
438
+ else{
439
+ $awbno=strstr($comment->getComment(),"- Order No",true);
440
+ }
441
+ $awbno=trim($awbno,"AWB No.");
442
+ break;
443
+ }
444
  }
445
+
446
+
447
+ $report_id = (int) Mage::getStoreConfig('aramexsettings/config/report_id');
448
+ if(!$report_id){
449
+ $report_id =9729;
450
  }
451
+
452
  $params = array(
453
 
454
  'ClientInfo' => $clientInfo,
461
  'Reference5' => '',
462
  ),
463
  'LabelInfo' => array(
464
+ 'ReportID' => $report_id,
465
  'ReportType' => 'URL',
466
  ),
467
  );
468
  $params['ShipmentNumber']=$awbno;
469
+
 
470
  try {
471
  $auth_call = $soapClient->PrintLabel($params);
472
  /* bof PDF demaged Fixes debug */
477
  }
478
  } else {
479
  Mage::throwException($this->__('Aramex: ' . $auth_call->Notifications->Notification->Code . ' - '. $auth_call->Notifications->Notification->Message));
480
+
481
  }
482
  }
483
  /* eof PDF demaged Fixes */
491
  Mage::getSingleton('adminhtml/session')->addError('Error : ' . $fault->faultstring);
492
  $this->_redirectUrl($previuosUrl);
493
  }
494
+ catch (Exception $e) {
495
+ $aramex_errors = true;
496
+ Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
497
+ $this->_redirectUrl($previuosUrl);
498
+ }
499
  }else{
500
  Mage::getSingleton('adminhtml/session')->addError($this->__('Shipment is empty or not created yet.'));
501
  $this->_redirectUrl($previuosUrl);
app/code/community/Aramex/Shipment/etc/config.xml CHANGED
@@ -12,17 +12,7 @@
12
  <sales_order_view>Aramex_Shipment_Block_Sales_Order_View</sales_order_view>
13
  </rewrite>
14
  </adminhtml>
15
- </blocks>
16
- <template>
17
- <email>
18
- <aramex_general_email_template>
19
- <label>Aramex New Shipment</label>
20
- <file>aramex_shipment_created.html</file>
21
- <type>html</type>
22
- </aramex_general_email_template>
23
- </email>
24
- </template>
25
-
26
  </global>
27
  <admin>
28
  <routers>
@@ -68,7 +58,7 @@
68
  <name>aramex</name>
69
  <gateway_url>aramex/Tracking.wsdl</gateway_url>
70
  <price>10.00</price>
71
- <title>aramex</title>
72
  <specificerrmsg>
73
  This shipping method is currently unavailable.If you would like to ship using this shipping method, please contact us.
74
  </specificerrmsg>
@@ -122,7 +112,6 @@
122
  </connection>
123
  <!-- Use group alias_setup -->
124
  </aramex_setup>
125
- </resources>
126
-
127
  </global>
128
  </config>
12
  <sales_order_view>Aramex_Shipment_Block_Sales_Order_View</sales_order_view>
13
  </rewrite>
14
  </adminhtml>
15
+ </blocks>
 
 
 
 
 
 
 
 
 
 
16
  </global>
17
  <admin>
18
  <routers>
58
  <name>aramex</name>
59
  <gateway_url>aramex/Tracking.wsdl</gateway_url>
60
  <price>10.00</price>
61
+ <title>Aramex</title>
62
  <specificerrmsg>
63
  This shipping method is currently unavailable.If you would like to ship using this shipping method, please contact us.
64
  </specificerrmsg>
112
  </connection>
113
  <!-- Use group alias_setup -->
114
  </aramex_setup>
115
+ </resources>
 
116
  </global>
117
  </config>
app/code/community/Aramex/Shipment/etc/wsdl/Aramex/TestMode/Tracking.wsdl ADDED
@@ -0,0 +1,176 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <wsdl:definitions xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:i0="http://ws.aramex.net/ShippingAPI/v1" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:tns="http://ws.aramex.net/ShippingAPI/v1/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ws.aramex.net/ShippingAPI/v1/" name="Service_1_0">
3
+ <wsdl:binding type="i0:Service_1_0" name="BasicHttpBinding_Service_1_0">
4
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
5
+ <wsdl:operation name="TrackShipments">
6
+ <soap:operation style="document" soapAction="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/TrackShipments"/>
7
+ <wsdl:input name="ShipmentTrackingRequest">
8
+ <soap:body use="literal"/>
9
+ </wsdl:input>
10
+ <wsdl:output name="ShipmentTrackingResponse">
11
+ <soap:body use="literal"/>
12
+ </wsdl:output>
13
+ </wsdl:operation>
14
+ </wsdl:binding>
15
+ <wsdl:types>
16
+ <xsd:schema targetNamespace="http://ws.aramex.net/ShippingAPI/v1/" elementFormDefault="qualified">
17
+ <xsd:element name="ShipmentTrackingRequest">
18
+ <xsd:complexType>
19
+ <xsd:sequence>
20
+ <xsd:element type="tns:ClientInfo" name="ClientInfo" nillable="true" minOccurs="0"/>
21
+ <xsd:element type="tns:Transaction" name="Transaction" nillable="true" minOccurs="0"/>
22
+ <xsd:element type="q1:ArrayOfstring" name="Shipments" nillable="true" minOccurs="0" xmlns:q1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
23
+ <xsd:element type="xsd:boolean" name="GetLastTrackingUpdateOnly" minOccurs="0"/>
24
+ </xsd:sequence>
25
+ </xsd:complexType>
26
+ </xsd:element>
27
+ <xsd:complexType name="ClientInfo">
28
+ <xsd:sequence>
29
+ <xsd:element type="xsd:string" name="UserName" nillable="true"/>
30
+ <xsd:element type="xsd:string" name="Password" nillable="true"/>
31
+ <xsd:element type="xsd:string" name="Version" nillable="true"/>
32
+ <xsd:element type="xsd:string" name="AccountNumber" nillable="true"/>
33
+ <xsd:element type="xsd:string" name="AccountPin" nillable="true"/>
34
+ <xsd:element type="xsd:string" name="AccountEntity" nillable="true"/>
35
+ <xsd:element type="xsd:string" name="AccountCountryCode" nillable="true"/>
36
+ </xsd:sequence>
37
+ </xsd:complexType>
38
+ <xsd:element type="tns:ClientInfo" name="ClientInfo" nillable="true"/>
39
+ <xsd:complexType name="Transaction">
40
+ <xsd:sequence>
41
+ <xsd:element type="xsd:string" name="Reference1" nillable="true"/>
42
+ <xsd:element type="xsd:string" name="Reference2" nillable="true"/>
43
+ <xsd:element type="xsd:string" name="Reference3" nillable="true"/>
44
+ <xsd:element type="xsd:string" name="Reference4" nillable="true"/>
45
+ <xsd:element type="xsd:string" name="Reference5" nillable="true"/>
46
+ </xsd:sequence>
47
+ </xsd:complexType>
48
+ <xsd:element type="tns:Transaction" name="Transaction" nillable="true"/>
49
+ <xsd:element name="ShipmentTrackingResponse">
50
+ <xsd:complexType>
51
+ <xsd:sequence>
52
+ <xsd:element type="tns:Transaction" name="Transaction" nillable="true" minOccurs="0"/>
53
+ <xsd:element type="tns:ArrayOfNotification" name="Notifications" nillable="true" minOccurs="0"/>
54
+ <xsd:element type="xsd:boolean" name="HasErrors" minOccurs="0"/>
55
+ <xsd:element type="q2:ArrayOfKeyValueOfstringArrayOfTrackingResultmFAkxlpY" name="TrackingResults" nillable="true" minOccurs="0" xmlns:q2="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
56
+ </xsd:sequence>
57
+ </xsd:complexType>
58
+ </xsd:element>
59
+ <xsd:complexType name="ArrayOfNotification">
60
+ <xsd:sequence>
61
+ <xsd:element type="tns:Notification" name="Notification" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
62
+ </xsd:sequence>
63
+ </xsd:complexType>
64
+ <xsd:element type="tns:ArrayOfNotification" name="ArrayOfNotification" nillable="true"/>
65
+ <xsd:complexType name="Notification">
66
+ <xsd:sequence>
67
+ <xsd:element type="xsd:string" name="Code" nillable="true"/>
68
+ <xsd:element type="xsd:string" name="Message" nillable="true"/>
69
+ </xsd:sequence>
70
+ </xsd:complexType>
71
+ <xsd:element type="tns:Notification" name="Notification" nillable="true"/>
72
+ <xsd:complexType name="ArrayOfTrackingResult">
73
+ <xsd:sequence>
74
+ <xsd:element type="tns:TrackingResult" name="TrackingResult" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
75
+ </xsd:sequence>
76
+ </xsd:complexType>
77
+ <xsd:element type="tns:ArrayOfTrackingResult" name="ArrayOfTrackingResult" nillable="true"/>
78
+ <xsd:complexType name="TrackingResult">
79
+ <xsd:sequence>
80
+ <xsd:element type="xsd:string" name="WaybillNumber" nillable="true"/>
81
+ <xsd:element type="xsd:string" name="UpdateCode" nillable="true"/>
82
+ <xsd:element type="xsd:string" name="UpdateDescription" nillable="true"/>
83
+ <xsd:element type="xsd:dateTime" name="UpdateDateTime"/>
84
+ <xsd:element type="xsd:string" name="UpdateLocation" nillable="true"/>
85
+ <xsd:element type="xsd:string" name="Comments" nillable="true"/>
86
+ <xsd:element type="xsd:string" name="ProblemCode" nillable="true"/>
87
+ </xsd:sequence>
88
+ </xsd:complexType>
89
+ <xsd:element type="tns:TrackingResult" name="TrackingResult" nillable="true"/>
90
+ </xsd:schema>
91
+ <xsd:schema xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/Arrays" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/Arrays" elementFormDefault="qualified">
92
+ <xsd:complexType name="ArrayOfstring">
93
+ <xsd:sequence>
94
+ <xsd:element type="xsd:string" name="string" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
95
+ </xsd:sequence>
96
+ </xsd:complexType>
97
+ <xsd:element type="tns:ArrayOfstring" name="ArrayOfstring" nillable="true"/>
98
+ <xsd:complexType name="ArrayOfKeyValueOfstringArrayOfTrackingResultmFAkxlpY">
99
+ <xsd:annotation>
100
+ <xsd:appinfo>
101
+ <IsDictionary xmlns="http://schemas.microsoft.com/2003/10/Serialization/">true</IsDictionary>
102
+ </xsd:appinfo>
103
+ </xsd:annotation>
104
+ <xsd:sequence>
105
+ <xsd:element name="KeyValueOfstringArrayOfTrackingResultmFAkxlpY" minOccurs="0" maxOccurs="unbounded">
106
+ <xsd:complexType>
107
+ <xsd:sequence>
108
+ <xsd:element type="xsd:string" name="Key" nillable="true"/>
109
+ <xsd:element type="q3:ArrayOfTrackingResult" name="Value" nillable="true" xmlns:q3="http://ws.aramex.net/ShippingAPI/v1/"/>
110
+ </xsd:sequence>
111
+ </xsd:complexType>
112
+ </xsd:element>
113
+ </xsd:sequence>
114
+ </xsd:complexType>
115
+ <xsd:element type="tns:ArrayOfKeyValueOfstringArrayOfTrackingResultmFAkxlpY" name="ArrayOfKeyValueOfstringArrayOfTrackingResultmFAkxlpY" nillable="true"/>
116
+ </xsd:schema>
117
+ <xs:schema xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified">
118
+ <xs:element type="xs:anyType" name="anyType" nillable="true"/>
119
+ <xs:element type="xs:anyURI" name="anyURI" nillable="true"/>
120
+ <xs:element type="xs:base64Binary" name="base64Binary" nillable="true"/>
121
+ <xs:element type="xs:boolean" name="boolean" nillable="true"/>
122
+ <xs:element type="xs:byte" name="byte" nillable="true"/>
123
+ <xs:element type="xs:dateTime" name="dateTime" nillable="true"/>
124
+ <xs:element type="xs:decimal" name="decimal" nillable="true"/>
125
+ <xs:element type="xs:double" name="double" nillable="true"/>
126
+ <xs:element type="xs:float" name="float" nillable="true"/>
127
+ <xs:element type="xs:int" name="int" nillable="true"/>
128
+ <xs:element type="xs:long" name="long" nillable="true"/>
129
+ <xs:element type="xs:QName" name="QName" nillable="true"/>
130
+ <xs:element type="xs:short" name="short" nillable="true"/>
131
+ <xs:element type="xs:string" name="string" nillable="true"/>
132
+ <xs:element type="xs:unsignedByte" name="unsignedByte" nillable="true"/>
133
+ <xs:element type="xs:unsignedInt" name="unsignedInt" nillable="true"/>
134
+ <xs:element type="xs:unsignedLong" name="unsignedLong" nillable="true"/>
135
+ <xs:element type="xs:unsignedShort" name="unsignedShort" nillable="true"/>
136
+ <xs:element type="tns:char" name="char" nillable="true"/>
137
+ <xs:simpleType name="char">
138
+ <xs:restriction base="xs:int"/>
139
+ </xs:simpleType>
140
+ <xs:element type="tns:duration" name="duration" nillable="true"/>
141
+ <xs:simpleType name="duration">
142
+ <xs:restriction base="xs:duration">
143
+ <xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
144
+ <xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
145
+ <xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
146
+ </xs:restriction>
147
+ </xs:simpleType>
148
+ <xs:element type="tns:guid" name="guid" nillable="true"/>
149
+ <xs:simpleType name="guid">
150
+ <xs:restriction base="xs:string">
151
+ <xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
152
+ </xs:restriction>
153
+ </xs:simpleType>
154
+ <xs:attribute type="xs:QName" name="FactoryType"/>
155
+ <xs:attribute type="xs:ID" name="Id"/>
156
+ <xs:attribute type="xs:IDREF" name="Ref"/>
157
+ </xs:schema>
158
+ </wsdl:types>
159
+ <wsdl:message name="ShipmentTrackingRequest">
160
+ <wsdl:part name="parameters" element="tns:ShipmentTrackingRequest"/>
161
+ </wsdl:message>
162
+ <wsdl:message name="ShipmentTrackingResponse">
163
+ <wsdl:part name="parameters" element="tns:ShipmentTrackingResponse"/>
164
+ </wsdl:message>
165
+ <wsdl:portType name="Service_1_0">
166
+ <wsdl:operation name="TrackShipments">
167
+ <wsdl:input name="ShipmentTrackingRequest" message="tns:ShipmentTrackingRequest" wsaw:Action="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/TrackShipments"/>
168
+ <wsdl:output name="ShipmentTrackingResponse" message="tns:ShipmentTrackingResponse" wsaw:Action="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/TrackShipmentsResponse"/>
169
+ </wsdl:operation>
170
+ </wsdl:portType>
171
+ <wsdl:service name="Service_1_0">
172
+ <wsdl:port name="BasicHttpBinding_Service_1_0" binding="i0:BasicHttpBinding_Service_1_0">
173
+ <soap:address location="http://ws.dev.aramex.net/shippingapi/tracking/service_1_0.svc"/>
174
+ </wsdl:port>
175
+ </wsdl:service>
176
+ </wsdl:definitions>
app/code/community/Aramex/Shipment/etc/wsdl/Aramex/TestMode/aramex-rates-calculator-wsdl.wsdl ADDED
@@ -0,0 +1,206 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <wsdl:definitions xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:i0="http://ws.aramex.net/ShippingAPI/v1" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:tns="http://ws.aramex.net/ShippingAPI/v1/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ws.aramex.net/ShippingAPI/v1/" name="Service_1_0">
3
+ <wsdl:binding type="i0:Service_1_0" name="BasicHttpBinding_Service_1_0">
4
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
5
+ <wsdl:operation name="CalculateRate">
6
+ <soap:operation style="document" soapAction="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/CalculateRate"/>
7
+ <wsdl:input name="RateCalculatorRequest">
8
+ <soap:body use="literal"/>
9
+ </wsdl:input>
10
+ <wsdl:output name="RateCalculatorResponse">
11
+ <soap:body use="literal"/>
12
+ </wsdl:output>
13
+ </wsdl:operation>
14
+ </wsdl:binding>
15
+ <wsdl:types>
16
+ <xsd:schema targetNamespace="http://ws.aramex.net/ShippingAPI/v1/" elementFormDefault="qualified">
17
+ <xsd:element name="RateCalculatorRequest">
18
+ <xsd:complexType>
19
+ <xsd:sequence>
20
+ <xsd:element type="tns:ClientInfo" name="ClientInfo" nillable="true" minOccurs="0"/>
21
+ <xsd:element type="tns:Transaction" name="Transaction" nillable="true" minOccurs="0"/>
22
+ <xsd:element type="tns:Address" name="OriginAddress" nillable="true" minOccurs="0"/>
23
+ <xsd:element type="tns:Address" name="DestinationAddress" nillable="true" minOccurs="0"/>
24
+ <xsd:element type="tns:ShipmentDetails" name="ShipmentDetails" nillable="true" minOccurs="0"/>
25
+ </xsd:sequence>
26
+ </xsd:complexType>
27
+ </xsd:element>
28
+ <xsd:complexType name="ClientInfo">
29
+ <xsd:sequence>
30
+ <xsd:element type="xsd:string" name="UserName" nillable="true"/>
31
+ <xsd:element type="xsd:string" name="Password" nillable="true"/>
32
+ <xsd:element type="xsd:string" name="Version" nillable="true"/>
33
+ <xsd:element type="xsd:string" name="AccountNumber" nillable="true"/>
34
+ <xsd:element type="xsd:string" name="AccountPin" nillable="true"/>
35
+ <xsd:element type="xsd:string" name="AccountEntity" nillable="true"/>
36
+ <xsd:element type="xsd:string" name="AccountCountryCode" nillable="true"/>
37
+ </xsd:sequence>
38
+ </xsd:complexType>
39
+ <xsd:element type="tns:ClientInfo" name="ClientInfo" nillable="true"/>
40
+ <xsd:complexType name="Transaction">
41
+ <xsd:sequence>
42
+ <xsd:element type="xsd:string" name="Reference1" nillable="true"/>
43
+ <xsd:element type="xsd:string" name="Reference2" nillable="true"/>
44
+ <xsd:element type="xsd:string" name="Reference3" nillable="true"/>
45
+ <xsd:element type="xsd:string" name="Reference4" nillable="true"/>
46
+ <xsd:element type="xsd:string" name="Reference5" nillable="true"/>
47
+ </xsd:sequence>
48
+ </xsd:complexType>
49
+ <xsd:element type="tns:Transaction" name="Transaction" nillable="true"/>
50
+ <xsd:complexType name="Address">
51
+ <xsd:sequence>
52
+ <xsd:element type="xsd:string" name="Line1" nillable="true"/>
53
+ <xsd:element type="xsd:string" name="Line2" nillable="true"/>
54
+ <xsd:element type="xsd:string" name="Line3" nillable="true"/>
55
+ <xsd:element type="xsd:string" name="City" nillable="true"/>
56
+ <xsd:element type="xsd:string" name="StateOrProvinceCode" nillable="true" minOccurs="0"/>
57
+ <xsd:element type="xsd:string" name="PostCode" nillable="true"/>
58
+ <xsd:element type="xsd:string" name="CountryCode" nillable="true"/>
59
+ </xsd:sequence>
60
+ </xsd:complexType>
61
+ <xsd:element type="tns:Address" name="Address" nillable="true"/>
62
+ <xsd:complexType name="ShipmentDetails">
63
+ <xsd:sequence>
64
+ <xsd:element type="tns:Dimensions" name="Dimensions" nillable="true"/>
65
+ <xsd:element type="tns:Weight" name="ActualWeight" nillable="true"/>
66
+ <xsd:element type="tns:Weight" name="ChargeableWeight" nillable="true"/>
67
+ <xsd:element type="xsd:string" name="DescriptionOfGoods" nillable="true"/>
68
+ <xsd:element type="xsd:string" name="GoodsOriginCountry" nillable="true"/>
69
+ <xsd:element type="xsd:int" name="NumberOfPieces"/>
70
+ <xsd:element type="xsd:string" name="ProductGroup" nillable="true"/>
71
+ <xsd:element type="xsd:string" name="ProductType" nillable="true"/>
72
+ <xsd:element type="xsd:string" name="PaymentType" nillable="true"/>
73
+ <xsd:element type="xsd:string" name="PaymentOptions" nillable="true"/>
74
+ <xsd:element type="tns:Money" name="CustomsValueAmount" nillable="true" minOccurs="0"/>
75
+ <xsd:element type="tns:Money" name="CashOnDeliveryAmount" nillable="true" minOccurs="0"/>
76
+ <xsd:element type="tns:Money" name="InsuranceAmount" nillable="true" minOccurs="0"/>
77
+ <xsd:element type="tns:Money" name="CashAdditionalAmount" nillable="true" minOccurs="0"/>
78
+ <xsd:element type="tns:Money" name="CollectAmount" nillable="true" minOccurs="0"/>
79
+ <xsd:element type="xsd:string" name="Services" nillable="true" minOccurs="0"/>
80
+ <xsd:element type="tns:ArrayOfShipmentItem" name="Items" nillable="true" minOccurs="0"/>
81
+ </xsd:sequence>
82
+ </xsd:complexType>
83
+ <xsd:element type="tns:ShipmentDetails" name="ShipmentDetails" nillable="true"/>
84
+ <xsd:complexType name="Dimensions">
85
+ <xsd:sequence>
86
+ <xsd:element type="xsd:int" name="Length"/>
87
+ <xsd:element type="xsd:int" name="Width"/>
88
+ <xsd:element type="xsd:int" name="Height"/>
89
+ <xsd:element type="xsd:string" name="Unit" nillable="true"/>
90
+ </xsd:sequence>
91
+ </xsd:complexType>
92
+ <xsd:element type="tns:Dimensions" name="Dimensions" nillable="true"/>
93
+ <xsd:complexType name="Weight">
94
+ <xsd:sequence>
95
+ <xsd:element type="xsd:string" name="Unit" nillable="true"/>
96
+ <xsd:element type="xsd:double" name="Value"/>
97
+ </xsd:sequence>
98
+ </xsd:complexType>
99
+ <xsd:element type="tns:Weight" name="Weight" nillable="true"/>
100
+ <xsd:complexType name="Money">
101
+ <xsd:sequence>
102
+ <xsd:element type="xsd:string" name="CurrencyCode" nillable="true"/>
103
+ <xsd:element type="xsd:double" name="Value"/>
104
+ </xsd:sequence>
105
+ </xsd:complexType>
106
+ <xsd:element type="tns:Money" name="Money" nillable="true"/>
107
+ <xsd:complexType name="ArrayOfShipmentItem">
108
+ <xsd:sequence>
109
+ <xsd:element type="tns:ShipmentItem" name="ShipmentItem" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
110
+ </xsd:sequence>
111
+ </xsd:complexType>
112
+ <xsd:element type="tns:ArrayOfShipmentItem" name="ArrayOfShipmentItem" nillable="true"/>
113
+ <xsd:complexType name="ShipmentItem">
114
+ <xsd:sequence>
115
+ <xsd:element type="xsd:string" name="PackageType" nillable="true"/>
116
+ <xsd:element type="xsd:int" name="Quantity"/>
117
+ <xsd:element type="tns:Weight" name="Weight" nillable="true"/>
118
+ <xsd:element type="xsd:string" name="Comments" nillable="true" minOccurs="0"/>
119
+ <xsd:element type="xsd:string" name="Reference" nillable="true" minOccurs="0"/>
120
+ </xsd:sequence>
121
+ </xsd:complexType>
122
+ <xsd:element type="tns:ShipmentItem" name="ShipmentItem" nillable="true"/>
123
+ <xsd:element name="RateCalculatorResponse">
124
+ <xsd:complexType>
125
+ <xsd:sequence>
126
+ <xsd:element type="tns:Transaction" name="Transaction" nillable="true" minOccurs="0"/>
127
+ <xsd:element type="tns:ArrayOfNotification" name="Notifications" nillable="true" minOccurs="0"/>
128
+ <xsd:element type="xsd:boolean" name="HasErrors" minOccurs="0"/>
129
+ <xsd:element type="tns:Money" name="TotalAmount" nillable="true" minOccurs="0"/>
130
+ </xsd:sequence>
131
+ </xsd:complexType>
132
+ </xsd:element>
133
+ <xsd:complexType name="ArrayOfNotification">
134
+ <xsd:sequence>
135
+ <xsd:element type="tns:Notification" name="Notification" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
136
+ </xsd:sequence>
137
+ </xsd:complexType>
138
+ <xsd:element type="tns:ArrayOfNotification" name="ArrayOfNotification" nillable="true"/>
139
+ <xsd:complexType name="Notification">
140
+ <xsd:sequence>
141
+ <xsd:element type="xsd:string" name="Code" nillable="true"/>
142
+ <xsd:element type="xsd:string" name="Message" nillable="true"/>
143
+ </xsd:sequence>
144
+ </xsd:complexType>
145
+ <xsd:element type="tns:Notification" name="Notification" nillable="true"/>
146
+ </xsd:schema>
147
+ <xs:schema xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified">
148
+ <xs:element type="xs:anyType" name="anyType" nillable="true"/>
149
+ <xs:element type="xs:anyURI" name="anyURI" nillable="true"/>
150
+ <xs:element type="xs:base64Binary" name="base64Binary" nillable="true"/>
151
+ <xs:element type="xs:boolean" name="boolean" nillable="true"/>
152
+ <xs:element type="xs:byte" name="byte" nillable="true"/>
153
+ <xs:element type="xs:dateTime" name="dateTime" nillable="true"/>
154
+ <xs:element type="xs:decimal" name="decimal" nillable="true"/>
155
+ <xs:element type="xs:double" name="double" nillable="true"/>
156
+ <xs:element type="xs:float" name="float" nillable="true"/>
157
+ <xs:element type="xs:int" name="int" nillable="true"/>
158
+ <xs:element type="xs:long" name="long" nillable="true"/>
159
+ <xs:element type="xs:QName" name="QName" nillable="true"/>
160
+ <xs:element type="xs:short" name="short" nillable="true"/>
161
+ <xs:element type="xs:string" name="string" nillable="true"/>
162
+ <xs:element type="xs:unsignedByte" name="unsignedByte" nillable="true"/>
163
+ <xs:element type="xs:unsignedInt" name="unsignedInt" nillable="true"/>
164
+ <xs:element type="xs:unsignedLong" name="unsignedLong" nillable="true"/>
165
+ <xs:element type="xs:unsignedShort" name="unsignedShort" nillable="true"/>
166
+ <xs:element type="tns:char" name="char" nillable="true"/>
167
+ <xs:simpleType name="char">
168
+ <xs:restriction base="xs:int"/>
169
+ </xs:simpleType>
170
+ <xs:element type="tns:duration" name="duration" nillable="true"/>
171
+ <xs:simpleType name="duration">
172
+ <xs:restriction base="xs:duration">
173
+ <xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
174
+ <xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
175
+ <xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
176
+ </xs:restriction>
177
+ </xs:simpleType>
178
+ <xs:element type="tns:guid" name="guid" nillable="true"/>
179
+ <xs:simpleType name="guid">
180
+ <xs:restriction base="xs:string">
181
+ <xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
182
+ </xs:restriction>
183
+ </xs:simpleType>
184
+ <xs:attribute type="xs:QName" name="FactoryType"/>
185
+ <xs:attribute type="xs:ID" name="Id"/>
186
+ <xs:attribute type="xs:IDREF" name="Ref"/>
187
+ </xs:schema>
188
+ </wsdl:types>
189
+ <wsdl:message name="RateCalculatorRequest">
190
+ <wsdl:part name="parameters" element="tns:RateCalculatorRequest"/>
191
+ </wsdl:message>
192
+ <wsdl:message name="RateCalculatorResponse">
193
+ <wsdl:part name="parameters" element="tns:RateCalculatorResponse"/>
194
+ </wsdl:message>
195
+ <wsdl:portType name="Service_1_0">
196
+ <wsdl:operation name="CalculateRate">
197
+ <wsdl:input name="RateCalculatorRequest" message="tns:RateCalculatorRequest" wsaw:Action="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/CalculateRate"/>
198
+ <wsdl:output name="RateCalculatorResponse" message="tns:RateCalculatorResponse" wsaw:Action="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/CalculateRateResponse"/>
199
+ </wsdl:operation>
200
+ </wsdl:portType>
201
+ <wsdl:service name="Service_1_0">
202
+ <wsdl:port name="BasicHttpBinding_Service_1_0" binding="i0:BasicHttpBinding_Service_1_0">
203
+ <soap:address location="http://ws.dev.aramex.net/shippingapi/ratecalculator/service_1_0.svc"/>
204
+ </wsdl:port>
205
+ </wsdl:service>
206
+ </wsdl:definitions>
app/code/community/Aramex/Shipment/etc/wsdl/Aramex/TestMode/shipping.wsdl ADDED
@@ -0,0 +1,486 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <wsdl:definitions xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:tns="http://ws.aramex.net/ShippingAPI/v1/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ws.aramex.net/ShippingAPI/v1/" name="Service_1_0">
3
+ <wsdl:types>
4
+ <xsd:schema targetNamespace="http://ws.aramex.net/ShippingAPI/v1/" xmlns:ser="http://schemas.microsoft.com/2003/10/Serialization/" elementFormDefault="qualified">
5
+ <xsd:element name="ShipmentCreationRequest">
6
+ <xsd:complexType>
7
+ <xsd:sequence>
8
+ <xsd:element type="tns:ClientInfo" name="ClientInfo" nillable="true" minOccurs="0"/>
9
+ <xsd:element type="tns:Transaction" name="Transaction" nillable="true" minOccurs="0"/>
10
+ <xsd:element type="tns:ArrayOfShipment" name="Shipments" nillable="true" minOccurs="0"/>
11
+ <xsd:element type="tns:LabelInfo" name="LabelInfo" nillable="true" minOccurs="0"/>
12
+ </xsd:sequence>
13
+ </xsd:complexType>
14
+ </xsd:element>
15
+ <xsd:complexType name="ClientInfo">
16
+ <xsd:sequence>
17
+ <xsd:element type="xsd:string" name="UserName" nillable="true"/>
18
+ <xsd:element type="xsd:string" name="Password" nillable="true"/>
19
+ <xsd:element type="xsd:string" name="Version" nillable="true"/>
20
+ <xsd:element type="xsd:string" name="AccountNumber" nillable="true"/>
21
+ <xsd:element type="xsd:string" name="AccountPin" nillable="true"/>
22
+ <xsd:element type="xsd:string" name="AccountEntity" nillable="true"/>
23
+ <xsd:element type="xsd:string" name="AccountCountryCode" nillable="true"/>
24
+ </xsd:sequence>
25
+ </xsd:complexType>
26
+ <xsd:element type="tns:ClientInfo" name="ClientInfo" nillable="true"/>
27
+ <xsd:complexType name="Transaction">
28
+ <xsd:sequence>
29
+ <xsd:element type="xsd:string" name="Reference1" nillable="true"/>
30
+ <xsd:element type="xsd:string" name="Reference2" nillable="true"/>
31
+ <xsd:element type="xsd:string" name="Reference3" nillable="true"/>
32
+ <xsd:element type="xsd:string" name="Reference4" nillable="true"/>
33
+ <xsd:element type="xsd:string" name="Reference5" nillable="true"/>
34
+ </xsd:sequence>
35
+ </xsd:complexType>
36
+ <xsd:element type="tns:Transaction" name="Transaction" nillable="true"/>
37
+ <xsd:complexType name="ArrayOfShipment">
38
+ <xsd:sequence>
39
+ <xsd:element type="tns:Shipment" name="Shipment" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
40
+ </xsd:sequence>
41
+ </xsd:complexType>
42
+ <xsd:element type="tns:ArrayOfShipment" name="ArrayOfShipment" nillable="true"/>
43
+ <xsd:complexType name="Shipment">
44
+ <xsd:sequence>
45
+ <xsd:element type="xsd:string" name="Reference1" nillable="true" minOccurs="0"/>
46
+ <xsd:element type="xsd:string" name="Reference2" nillable="true" minOccurs="0"/>
47
+ <xsd:element type="xsd:string" name="Reference3" nillable="true" minOccurs="0"/>
48
+ <xsd:element type="tns:Party" name="Shipper" nillable="true"/>
49
+ <xsd:element type="tns:Party" name="Consignee" nillable="true"/>
50
+ <xsd:element type="tns:Party" name="ThirdParty" nillable="true" minOccurs="0"/>
51
+ <xsd:element type="xsd:dateTime" name="ShippingDateTime"/>
52
+ <xsd:element type="xsd:dateTime" name="DueDate" minOccurs="0"/>
53
+ <xsd:element type="xsd:string" name="Comments" nillable="true" minOccurs="0"/>
54
+ <xsd:element type="xsd:string" name="PickupLocation" nillable="true" minOccurs="0"/>
55
+ <xsd:element type="xsd:string" name="OperationsInstructions" nillable="true" minOccurs="0"/>
56
+ <xsd:element type="xsd:string" name="AccountingInstrcutions" nillable="true" minOccurs="0"/>
57
+ <xsd:element type="tns:ShipmentDetails" name="Details" nillable="true" minOccurs="0"/>
58
+ <xsd:element type="tns:ArrayOfAttachment" name="Attachments" nillable="true" minOccurs="0"/>
59
+ <xsd:element type="xsd:string" name="ForeignHAWB" nillable="true" minOccurs="0"/>
60
+ <xsd:element type="xsd:int" name="TransportType_x0020_" minOccurs="0"/>
61
+ <xsd:element type="xsd:string" name="PickupGUID" nillable="true" minOccurs="0"/>
62
+ </xsd:sequence>
63
+ </xsd:complexType>
64
+ <xsd:element type="tns:Shipment" name="Shipment" nillable="true"/>
65
+ <xsd:complexType name="Party">
66
+ <xsd:sequence>
67
+ <xsd:element type="xsd:string" name="Reference1" nillable="true" minOccurs="0"/>
68
+ <xsd:element type="xsd:string" name="Reference2" nillable="true" minOccurs="0"/>
69
+ <xsd:element type="xsd:string" name="AccountNumber" nillable="true" minOccurs="0"/>
70
+ <xsd:element type="tns:Address" name="PartyAddress" nillable="true"/>
71
+ <xsd:element type="tns:Contact" name="Contact" nillable="true"/>
72
+ </xsd:sequence>
73
+ </xsd:complexType>
74
+ <xsd:element type="tns:Party" name="Party" nillable="true"/>
75
+ <xsd:complexType name="Address">
76
+ <xsd:sequence>
77
+ <xsd:element type="xsd:string" name="Line1" nillable="true"/>
78
+ <xsd:element type="xsd:string" name="Line2" nillable="true"/>
79
+ <xsd:element type="xsd:string" name="Line3" nillable="true"/>
80
+ <xsd:element type="xsd:string" name="City" nillable="true"/>
81
+ <xsd:element type="xsd:string" name="StateOrProvinceCode" nillable="true" minOccurs="0"/>
82
+ <xsd:element type="xsd:string" name="PostCode" nillable="true"/>
83
+ <xsd:element type="xsd:string" name="CountryCode" nillable="true"/>
84
+ </xsd:sequence>
85
+ </xsd:complexType>
86
+ <xsd:element type="tns:Address" name="Address" nillable="true"/>
87
+ <xsd:complexType name="Contact">
88
+ <xsd:sequence>
89
+ <xsd:element type="xsd:string" name="Department" nillable="true" minOccurs="0"/>
90
+ <xsd:element type="xsd:string" name="PersonName" nillable="true"/>
91
+ <xsd:element type="xsd:string" name="Title" nillable="true" minOccurs="0"/>
92
+ <xsd:element type="xsd:string" name="CompanyName" nillable="true" minOccurs="0"/>
93
+ <xsd:element type="xsd:string" name="PhoneNumber1" nillable="true"/>
94
+ <xsd:element type="xsd:string" name="PhoneNumber1Ext" nillable="true" minOccurs="0"/>
95
+ <xsd:element type="xsd:string" name="PhoneNumber2" nillable="true"/>
96
+ <xsd:element type="xsd:string" name="PhoneNumber2Ext" nillable="true" minOccurs="0"/>
97
+ <xsd:element type="xsd:string" name="FaxNumber" nillable="true" minOccurs="0"/>
98
+ <xsd:element type="xsd:string" name="CellPhone" nillable="true" minOccurs="0"/>
99
+ <xsd:element type="xsd:string" name="EmailAddress" nillable="true" minOccurs="0"/>
100
+ <xsd:element type="xsd:string" name="Type" nillable="true"/>
101
+ </xsd:sequence>
102
+ </xsd:complexType>
103
+ <xsd:element type="tns:Contact" name="Contact" nillable="true"/>
104
+ <xsd:complexType name="ShipmentDetails">
105
+ <xsd:sequence>
106
+ <xsd:element type="tns:Dimensions" name="Dimensions" nillable="true"/>
107
+ <xsd:element type="tns:Weight" name="ActualWeight" nillable="true"/>
108
+ <xsd:element type="tns:Weight" name="ChargeableWeight" nillable="true"/>
109
+ <xsd:element type="xsd:string" name="DescriptionOfGoods" nillable="true"/>
110
+ <xsd:element type="xsd:string" name="GoodsOriginCountry" nillable="true"/>
111
+ <xsd:element type="xsd:int" name="NumberOfPieces"/>
112
+ <xsd:element type="xsd:string" name="ProductGroup" nillable="true"/>
113
+ <xsd:element type="xsd:string" name="ProductType" nillable="true"/>
114
+ <xsd:element type="xsd:string" name="PaymentType" nillable="true"/>
115
+ <xsd:element type="xsd:string" name="PaymentOptions" nillable="true"/>
116
+ <xsd:element type="tns:Money" name="CustomsValueAmount" nillable="true" minOccurs="0"/>
117
+ <xsd:element type="tns:Money" name="CashOnDeliveryAmount" nillable="true" minOccurs="0"/>
118
+ <xsd:element type="tns:Money" name="InsuranceAmount" nillable="true" minOccurs="0"/>
119
+ <xsd:element type="tns:Money" name="CashAdditionalAmount" nillable="true" minOccurs="0"/>
120
+ <xsd:element type="xsd:string" name="CashAdditionalAmountDescription" nillable="true" minOccurs="0"/>
121
+ <xsd:element type="tns:Money" name="CollectAmount" nillable="true" minOccurs="0"/>
122
+ <xsd:element type="xsd:string" name="Services" nillable="true" minOccurs="0"/>
123
+ <xsd:element type="tns:ArrayOfShipmentItem" name="Items" nillable="true" minOccurs="0"/>
124
+ </xsd:sequence>
125
+ </xsd:complexType>
126
+ <xsd:element type="tns:ShipmentDetails" name="ShipmentDetails" nillable="true"/>
127
+ <xsd:complexType name="Dimensions">
128
+ <xsd:sequence>
129
+ <xsd:element type="xsd:double" name="Length"/>
130
+ <xsd:element type="xsd:double" name="Width"/>
131
+ <xsd:element type="xsd:double" name="Height"/>
132
+ <xsd:element type="xsd:string" name="Unit" nillable="true"/>
133
+ </xsd:sequence>
134
+ </xsd:complexType>
135
+ <xsd:element type="tns:Dimensions" name="Dimensions" nillable="true"/>
136
+ <xsd:complexType name="Weight">
137
+ <xsd:sequence>
138
+ <xsd:element type="xsd:string" name="Unit" nillable="true"/>
139
+ <xsd:element type="xsd:double" name="Value"/>
140
+ </xsd:sequence>
141
+ </xsd:complexType>
142
+ <xsd:element type="tns:Weight" name="Weight" nillable="true"/>
143
+ <xsd:complexType name="Money">
144
+ <xsd:sequence>
145
+ <xsd:element type="xsd:string" name="CurrencyCode" nillable="true"/>
146
+ <xsd:element type="xsd:double" name="Value"/>
147
+ </xsd:sequence>
148
+ </xsd:complexType>
149
+ <xsd:element type="tns:Money" name="Money" nillable="true"/>
150
+ <xsd:complexType name="ArrayOfShipmentItem">
151
+ <xsd:sequence>
152
+ <xsd:element type="tns:ShipmentItem" name="ShipmentItem" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
153
+ </xsd:sequence>
154
+ </xsd:complexType>
155
+ <xsd:element type="tns:ArrayOfShipmentItem" name="ArrayOfShipmentItem" nillable="true"/>
156
+ <xsd:complexType name="ShipmentItem">
157
+ <xsd:sequence>
158
+ <xsd:element type="xsd:string" name="PackageType" nillable="true"/>
159
+ <xsd:element type="xsd:int" name="Quantity"/>
160
+ <xsd:element type="tns:Weight" name="Weight" nillable="true"/>
161
+ <xsd:element type="xsd:string" name="Comments" nillable="true" minOccurs="0"/>
162
+ <xsd:element type="xsd:string" name="Reference" nillable="true" minOccurs="0"/>
163
+ </xsd:sequence>
164
+ </xsd:complexType>
165
+ <xsd:element type="tns:ShipmentItem" name="ShipmentItem" nillable="true"/>
166
+ <xsd:complexType name="ArrayOfAttachment">
167
+ <xsd:sequence>
168
+ <xsd:element type="tns:Attachment" name="Attachment" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
169
+ </xsd:sequence>
170
+ </xsd:complexType>
171
+ <xsd:element type="tns:ArrayOfAttachment" name="ArrayOfAttachment" nillable="true"/>
172
+ <xsd:complexType name="Attachment">
173
+ <xsd:sequence>
174
+ <xsd:element type="xsd:string" name="FileName" nillable="true"/>
175
+ <xsd:element type="xsd:string" name="FileExtension" nillable="true"/>
176
+ <xsd:element type="xsd:base64Binary" name="FileContents" nillable="true"/>
177
+ </xsd:sequence>
178
+ </xsd:complexType>
179
+ <xsd:element type="tns:Attachment" name="Attachment" nillable="true"/>
180
+ <xsd:complexType name="LabelInfo">
181
+ <xsd:sequence>
182
+ <xsd:element type="xsd:int" name="ReportID"/>
183
+ <xsd:element type="xsd:string" name="ReportType" nillable="true"/>
184
+ </xsd:sequence>
185
+ </xsd:complexType>
186
+ <xsd:element type="tns:LabelInfo" name="LabelInfo" nillable="true"/>
187
+ <xsd:element name="ShipmentCreationResponse">
188
+ <xsd:complexType>
189
+ <xsd:sequence>
190
+ <xsd:element type="tns:Transaction" name="Transaction" nillable="true" minOccurs="0"/>
191
+ <xsd:element type="tns:ArrayOfNotification" name="Notifications" nillable="true" minOccurs="0"/>
192
+ <xsd:element type="xsd:boolean" name="HasErrors" minOccurs="0"/>
193
+ <xsd:element type="tns:ArrayOfProcessedShipment" name="Shipments" nillable="true" minOccurs="0"/>
194
+ </xsd:sequence>
195
+ </xsd:complexType>
196
+ </xsd:element>
197
+ <xsd:complexType name="ArrayOfNotification">
198
+ <xsd:sequence>
199
+ <xsd:element type="tns:Notification" name="Notification" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
200
+ </xsd:sequence>
201
+ </xsd:complexType>
202
+ <xsd:element type="tns:ArrayOfNotification" name="ArrayOfNotification" nillable="true"/>
203
+ <xsd:complexType name="Notification">
204
+ <xsd:sequence>
205
+ <xsd:element type="xsd:string" name="Code" nillable="true"/>
206
+ <xsd:element type="xsd:string" name="Message" nillable="true"/>
207
+ </xsd:sequence>
208
+ </xsd:complexType>
209
+ <xsd:element type="tns:Notification" name="Notification" nillable="true"/>
210
+ <xsd:complexType name="ArrayOfProcessedShipment">
211
+ <xsd:sequence>
212
+ <xsd:element type="tns:ProcessedShipment" name="ProcessedShipment" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
213
+ </xsd:sequence>
214
+ </xsd:complexType>
215
+ <xsd:element type="tns:ArrayOfProcessedShipment" name="ArrayOfProcessedShipment" nillable="true"/>
216
+ <xsd:complexType name="ProcessedShipment">
217
+ <xsd:sequence>
218
+ <xsd:element type="xsd:string" name="ID" nillable="true"/>
219
+ <xsd:element type="xsd:string" name="Reference1" nillable="true"/>
220
+ <xsd:element type="xsd:string" name="Reference2" nillable="true"/>
221
+ <xsd:element type="xsd:string" name="Reference3" nillable="true"/>
222
+ <xsd:element type="xsd:string" name="ForeignHAWB" nillable="true"/>
223
+ <xsd:element type="xsd:boolean" name="HasErrors"/>
224
+ <xsd:element type="tns:ArrayOfNotification" name="Notifications" nillable="true"/>
225
+ <xsd:element type="tns:ShipmentLabel" name="ShipmentLabel" nillable="true"/>
226
+ </xsd:sequence>
227
+ </xsd:complexType>
228
+ <xsd:element type="tns:ProcessedShipment" name="ProcessedShipment" nillable="true"/>
229
+ <xsd:complexType name="ShipmentLabel">
230
+ <xsd:sequence>
231
+ <xsd:element type="xsd:string" name="LabelURL" nillable="true"/>
232
+ <xsd:element type="xsd:base64Binary" name="LabelFileContents" nillable="true"/>
233
+ </xsd:sequence>
234
+ </xsd:complexType>
235
+ <xsd:element type="tns:ShipmentLabel" name="ShipmentLabel" nillable="true"/>
236
+ <xsd:element name="LabelPrintingRequest">
237
+ <xsd:complexType>
238
+ <xsd:sequence>
239
+ <xsd:element type="tns:ClientInfo" name="ClientInfo" nillable="true" minOccurs="0"/>
240
+ <xsd:element type="tns:Transaction" name="Transaction" nillable="true" minOccurs="0"/>
241
+ <xsd:element type="xsd:string" name="ShipmentNumber" nillable="true" minOccurs="0"/>
242
+ <xsd:element type="xsd:string" name="ProductGroup" nillable="true" minOccurs="0"/>
243
+ <xsd:element type="xsd:string" name="OriginEntity" nillable="true" minOccurs="0"/>
244
+ <xsd:element type="tns:LabelInfo" name="LabelInfo" nillable="true" minOccurs="0"/>
245
+ </xsd:sequence>
246
+ </xsd:complexType>
247
+ </xsd:element>
248
+ <xsd:element name="LabelPrintingResponse">
249
+ <xsd:complexType>
250
+ <xsd:sequence>
251
+ <xsd:element type="tns:Transaction" name="Transaction" nillable="true" minOccurs="0"/>
252
+ <xsd:element type="tns:ArrayOfNotification" name="Notifications" nillable="true" minOccurs="0"/>
253
+ <xsd:element type="xsd:boolean" name="HasErrors" minOccurs="0"/>
254
+ <xsd:element type="xsd:string" name="ShipmentNumber" nillable="true" minOccurs="0"/>
255
+ <xsd:element type="tns:ShipmentLabel" name="ShipmentLabel" nillable="true" minOccurs="0"/>
256
+ </xsd:sequence>
257
+ </xsd:complexType>
258
+ </xsd:element>
259
+ <xsd:element name="PickupCreationRequest">
260
+ <xsd:complexType>
261
+ <xsd:sequence>
262
+ <xsd:element type="tns:ClientInfo" name="ClientInfo" nillable="true" minOccurs="0"/>
263
+ <xsd:element type="tns:Transaction" name="Transaction" nillable="true" minOccurs="0"/>
264
+ <xsd:element type="tns:Pickup" name="Pickup" nillable="true" minOccurs="0"/>
265
+ <xsd:element type="tns:LabelInfo" name="LabelInfo" nillable="true" minOccurs="0"/>
266
+ </xsd:sequence>
267
+ </xsd:complexType>
268
+ </xsd:element>
269
+ <xsd:complexType name="Pickup">
270
+ <xsd:sequence>
271
+ <xsd:element type="tns:Address" name="PickupAddress" nillable="true"/>
272
+ <xsd:element type="tns:Contact" name="PickupContact" nillable="true"/>
273
+ <xsd:element type="xsd:string" name="PickupLocation" nillable="true"/>
274
+ <xsd:element type="xsd:dateTime" name="PickupDate"/>
275
+ <xsd:element type="xsd:dateTime" name="ReadyTime"/>
276
+ <xsd:element type="xsd:dateTime" name="LastPickupTime"/>
277
+ <xsd:element type="xsd:dateTime" name="ClosingTime"/>
278
+ <xsd:element type="xsd:string" name="Comments" nillable="true"/>
279
+ <xsd:element type="xsd:string" name="Reference1" nillable="true" minOccurs="0"/>
280
+ <xsd:element type="xsd:string" name="Reference2" nillable="true" minOccurs="0"/>
281
+ <xsd:element type="xsd:string" name="Vehicle" nillable="true"/>
282
+ <xsd:element type="tns:ArrayOfShipment" name="Shipments" nillable="true" minOccurs="0"/>
283
+ <xsd:element type="tns:ArrayOfPickupItemDetail" name="PickupItems" nillable="true"/>
284
+ <xsd:element type="xsd:string" name="Status" nillable="true" minOccurs="0"/>
285
+ </xsd:sequence>
286
+ </xsd:complexType>
287
+ <xsd:element type="tns:Pickup" name="Pickup" nillable="true"/>
288
+ <xsd:complexType name="ArrayOfPickupItemDetail">
289
+ <xsd:sequence>
290
+ <xsd:element type="tns:PickupItemDetail" name="PickupItemDetail" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
291
+ </xsd:sequence>
292
+ </xsd:complexType>
293
+ <xsd:element type="tns:ArrayOfPickupItemDetail" name="ArrayOfPickupItemDetail" nillable="true"/>
294
+ <xsd:complexType name="PickupItemDetail">
295
+ <xsd:sequence>
296
+ <xsd:element type="xsd:string" name="ProductGroup" nillable="true"/>
297
+ <xsd:element type="xsd:string" name="ProductType" nillable="true"/>
298
+ <xsd:element type="xsd:int" name="NumberOfShipments"/>
299
+ <xsd:element type="xsd:string" name="PackageType" nillable="true"/>
300
+ <xsd:element type="xsd:string" name="Payment" nillable="true"/>
301
+ <xsd:element type="tns:Weight" name="ShipmentWeight" nillable="true"/>
302
+ <xsd:element type="tns:Volume" name="ShipmentVolume" nillable="true"/>
303
+ <xsd:element type="xsd:int" name="NumberOfPieces"/>
304
+ <xsd:element type="tns:Money" name="CashAmount" nillable="true"/>
305
+ <xsd:element type="tns:Money" name="ExtraCharges" nillable="true"/>
306
+ <xsd:element type="tns:Dimensions" name="ShipmentDimensions" nillable="true"/>
307
+ <xsd:element type="xsd:string" name="Comments" nillable="true"/>
308
+ </xsd:sequence>
309
+ </xsd:complexType>
310
+ <xsd:element type="tns:PickupItemDetail" name="PickupItemDetail" nillable="true"/>
311
+ <xsd:complexType name="Volume">
312
+ <xsd:sequence>
313
+ <xsd:element type="xsd:string" name="Unit" nillable="true"/>
314
+ <xsd:element type="xsd:double" name="Value"/>
315
+ </xsd:sequence>
316
+ </xsd:complexType>
317
+ <xsd:element type="tns:Volume" name="Volume" nillable="true"/>
318
+ <xsd:element name="PickupCreationResponse">
319
+ <xsd:complexType>
320
+ <xsd:sequence>
321
+ <xsd:element type="tns:Transaction" name="Transaction" nillable="true" minOccurs="0"/>
322
+ <xsd:element type="tns:ArrayOfNotification" name="Notifications" nillable="true" minOccurs="0"/>
323
+ <xsd:element type="xsd:boolean" name="HasErrors" minOccurs="0"/>
324
+ <xsd:element type="tns:ProcessedPickup" name="ProcessedPickup" nillable="true" minOccurs="0"/>
325
+ </xsd:sequence>
326
+ </xsd:complexType>
327
+ </xsd:element>
328
+ <xsd:complexType name="ProcessedPickup">
329
+ <xsd:sequence>
330
+ <xsd:element type="xsd:string" name="ID" nillable="true"/>
331
+ <xsd:element type="ser:guid" name="GUID"/>
332
+ <xsd:element type="xsd:string" name="Reference1" nillable="true"/>
333
+ <xsd:element type="xsd:string" name="Reference2" nillable="true"/>
334
+ <xsd:element type="tns:ArrayOfProcessedShipment" name="ProcessedShipments" nillable="true"/>
335
+ </xsd:sequence>
336
+ </xsd:complexType>
337
+ <xsd:element type="tns:ProcessedPickup" name="ProcessedPickup" nillable="true"/>
338
+ <xsd:element name="PickupCancelationRequest">
339
+ <xsd:complexType>
340
+ <xsd:sequence>
341
+ <xsd:element type="tns:ClientInfo" name="ClientInfo" nillable="true" minOccurs="0"/>
342
+ <xsd:element type="tns:Transaction" name="Transaction" nillable="true" minOccurs="0"/>
343
+ <xsd:element type="xsd:string" name="PickupGUID" nillable="true" minOccurs="0"/>
344
+ <xsd:element type="xsd:string" name="Comments" nillable="true" minOccurs="0"/>
345
+ </xsd:sequence>
346
+ </xsd:complexType>
347
+ </xsd:element>
348
+ <xsd:element name="PickupCancelationResponse">
349
+ <xsd:complexType>
350
+ <xsd:sequence>
351
+ <xsd:element type="tns:Transaction" name="Transaction" nillable="true" minOccurs="0"/>
352
+ <xsd:element type="tns:ArrayOfNotification" name="Notifications" nillable="true" minOccurs="0"/>
353
+ <xsd:element type="xsd:boolean" name="HasErrors" minOccurs="0"/>
354
+ </xsd:sequence>
355
+ </xsd:complexType>
356
+ </xsd:element>
357
+ </xsd:schema>
358
+ <xs:schema xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified">
359
+ <xs:element type="xs:anyType" name="anyType" nillable="true"/>
360
+ <xs:element type="xs:anyURI" name="anyURI" nillable="true"/>
361
+ <xs:element type="xs:base64Binary" name="base64Binary" nillable="true"/>
362
+ <xs:element type="xs:boolean" name="boolean" nillable="true"/>
363
+ <xs:element type="xs:byte" name="byte" nillable="true"/>
364
+ <xs:element type="xs:dateTime" name="dateTime" nillable="true"/>
365
+ <xs:element type="xs:decimal" name="decimal" nillable="true"/>
366
+ <xs:element type="xs:double" name="double" nillable="true"/>
367
+ <xs:element type="xs:float" name="float" nillable="true"/>
368
+ <xs:element type="xs:int" name="int" nillable="true"/>
369
+ <xs:element type="xs:long" name="long" nillable="true"/>
370
+ <xs:element type="xs:QName" name="QName" nillable="true"/>
371
+ <xs:element type="xs:short" name="short" nillable="true"/>
372
+ <xs:element type="xs:string" name="string" nillable="true"/>
373
+ <xs:element type="xs:unsignedByte" name="unsignedByte" nillable="true"/>
374
+ <xs:element type="xs:unsignedInt" name="unsignedInt" nillable="true"/>
375
+ <xs:element type="xs:unsignedLong" name="unsignedLong" nillable="true"/>
376
+ <xs:element type="xs:unsignedShort" name="unsignedShort" nillable="true"/>
377
+ <xs:element type="tns:char" name="char" nillable="true"/>
378
+ <xs:simpleType name="char">
379
+ <xs:restriction base="xs:int"/>
380
+ </xs:simpleType>
381
+ <xs:element type="tns:duration" name="duration" nillable="true"/>
382
+ <xs:simpleType name="duration">
383
+ <xs:restriction base="xs:duration">
384
+ <xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
385
+ <xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
386
+ <xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
387
+ </xs:restriction>
388
+ </xs:simpleType>
389
+ <xs:element type="tns:guid" name="guid" nillable="true"/>
390
+ <xs:simpleType name="guid">
391
+ <xs:restriction base="xs:string">
392
+ <xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
393
+ </xs:restriction>
394
+ </xs:simpleType>
395
+ <xs:attribute type="xs:QName" name="FactoryType"/>
396
+ <xs:attribute type="xs:ID" name="Id"/>
397
+ <xs:attribute type="xs:IDREF" name="Ref"/>
398
+ </xs:schema>
399
+ </wsdl:types>
400
+ <wsdl:message name="ShipmentCreationRequest">
401
+ <wsdl:part name="parameters" element="tns:ShipmentCreationRequest"/>
402
+ </wsdl:message>
403
+ <wsdl:message name="ShipmentCreationResponse">
404
+ <wsdl:part name="parameters" element="tns:ShipmentCreationResponse"/>
405
+ </wsdl:message>
406
+ <wsdl:message name="LabelPrintingRequest">
407
+ <wsdl:part name="parameters" element="tns:LabelPrintingRequest"/>
408
+ </wsdl:message>
409
+ <wsdl:message name="LabelPrintingResponse">
410
+ <wsdl:part name="parameters" element="tns:LabelPrintingResponse"/>
411
+ </wsdl:message>
412
+ <wsdl:message name="PickupCreationRequest">
413
+ <wsdl:part name="parameters" element="tns:PickupCreationRequest"/>
414
+ </wsdl:message>
415
+ <wsdl:message name="PickupCreationResponse">
416
+ <wsdl:part name="parameters" element="tns:PickupCreationResponse"/>
417
+ </wsdl:message>
418
+ <wsdl:message name="PickupCancelationRequest">
419
+ <wsdl:part name="parameters" element="tns:PickupCancelationRequest"/>
420
+ </wsdl:message>
421
+ <wsdl:message name="PickupCancelationResponse">
422
+ <wsdl:part name="parameters" element="tns:PickupCancelationResponse"/>
423
+ </wsdl:message>
424
+ <wsdl:portType name="Service_1_0">
425
+ <wsdl:operation name="CreateShipments">
426
+ <wsdl:input name="ShipmentCreationRequest" message="tns:ShipmentCreationRequest" wsaw:Action="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/CreateShipments"/>
427
+ <wsdl:output name="ShipmentCreationResponse" message="tns:ShipmentCreationResponse" wsaw:Action="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/CreateShipmentsResponse"/>
428
+ </wsdl:operation>
429
+ <wsdl:operation name="PrintLabel">
430
+ <wsdl:input name="LabelPrintingRequest" message="tns:LabelPrintingRequest" wsaw:Action="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/PrintLabel"/>
431
+ <wsdl:output name="LabelPrintingResponse" message="tns:LabelPrintingResponse" wsaw:Action="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/PrintLabelResponse"/>
432
+ </wsdl:operation>
433
+ <wsdl:operation name="CreatePickup">
434
+ <wsdl:input name="PickupCreationRequest" message="tns:PickupCreationRequest" wsaw:Action="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/CreatePickup"/>
435
+ <wsdl:output name="PickupCreationResponse" message="tns:PickupCreationResponse" wsaw:Action="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/CreatePickupResponse"/>
436
+ </wsdl:operation>
437
+ <wsdl:operation name="CancelPickup">
438
+ <wsdl:input name="PickupCancelationRequest" message="tns:PickupCancelationRequest" wsaw:Action="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/CancelPickup"/>
439
+ <wsdl:output name="PickupCancelationResponse" message="tns:PickupCancelationResponse" wsaw:Action="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/CancelPickupResponse"/>
440
+ </wsdl:operation>
441
+ </wsdl:portType>
442
+ <wsdl:binding type="tns:Service_1_0" name="Service_1_0">
443
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
444
+ <wsdl:operation name="CreateShipments">
445
+ <soap:operation style="document" soapAction="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/CreateShipments"/>
446
+ <wsdl:input name="ShipmentCreationRequest">
447
+ <soap:body use="literal"/>
448
+ </wsdl:input>
449
+ <wsdl:output name="ShipmentCreationResponse">
450
+ <soap:body use="literal"/>
451
+ </wsdl:output>
452
+ </wsdl:operation>
453
+ <wsdl:operation name="PrintLabel">
454
+ <soap:operation style="document" soapAction="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/PrintLabel"/>
455
+ <wsdl:input name="LabelPrintingRequest">
456
+ <soap:body use="literal"/>
457
+ </wsdl:input>
458
+ <wsdl:output name="LabelPrintingResponse">
459
+ <soap:body use="literal"/>
460
+ </wsdl:output>
461
+ </wsdl:operation>
462
+ <wsdl:operation name="CreatePickup">
463
+ <soap:operation style="document" soapAction="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/CreatePickup"/>
464
+ <wsdl:input name="PickupCreationRequest">
465
+ <soap:body use="literal"/>
466
+ </wsdl:input>
467
+ <wsdl:output name="PickupCreationResponse">
468
+ <soap:body use="literal"/>
469
+ </wsdl:output>
470
+ </wsdl:operation>
471
+ <wsdl:operation name="CancelPickup">
472
+ <soap:operation style="document" soapAction="http://ws.aramex.net/ShippingAPI/v1/Service_1_0/CancelPickup"/>
473
+ <wsdl:input name="PickupCancelationRequest">
474
+ <soap:body use="literal"/>
475
+ </wsdl:input>
476
+ <wsdl:output name="PickupCancelationResponse">
477
+ <soap:body use="literal"/>
478
+ </wsdl:output>
479
+ </wsdl:operation>
480
+ </wsdl:binding>
481
+ <wsdl:service name="Service_1_0">
482
+ <wsdl:port name="Service_1_0" binding="tns:Service_1_0">
483
+ <soap:address location="https://ws.dev.aramex.net/shippingapi/shipping/service_1_0.svc"/>
484
+ </wsdl:port>
485
+ </wsdl:service>
486
+ </wsdl:definitions>
app/code/community/Aramex/Shipping/Model/Carrier/Aramex.php CHANGED
@@ -32,7 +32,7 @@ class Aramex_Shipping_Model_Carrier_Aramex extends Mage_Usa_Model_Shipping_Carri
32
  protected $_defaultGatewayUrl = null;
33
 
34
  function __construct()
35
- {
36
  $this->_defaultGatewayUrl = Mage::helper('aramexshipment')->getWsdlPath().'Tracking.wsdl';
37
  }
38
 
@@ -43,23 +43,25 @@ class Aramex_Shipping_Model_Carrier_Aramex extends Mage_Usa_Model_Shipping_Carri
43
 
44
  public function collectRates(Mage_Shipping_Model_Rate_Request $request)
45
  {
 
46
  if (!$this->getConfigFlag($this->_activeFlag)) {
47
  return false;
48
  }
 
49
 
50
- $this->setRequest($request);
51
-
52
- $this->_result = $this->_getQuotes();
53
-
54
- $this->_updateFreeMethodQuote($request);
55
-
56
  return $this->getResult();
57
  }
58
 
 
 
59
  public function setRequest(Mage_Shipping_Model_Rate_Request $request) {
60
  $this->_request = $request;
61
 
62
  $r = new Varien_Object();
 
63
 
64
  if ($request->getLimitMethod()) {
65
  $r->setService($request->getLimitMethod());
@@ -74,12 +76,12 @@ class Aramex_Shipping_Model_Carrier_Aramex extends Mage_Usa_Model_Shipping_Carri
74
  }
75
  $r->setUserId($userId);
76
 
77
- if ($request->getAramexContainer()) {
78
  $container = $request->getAramexContainer();
79
  } else {
80
  $container = $this->getConfigData('container');
81
  }
82
- $r->setContainer($container);
83
 
84
  if ($request->getAramexSize()) {
85
  $size = $request->getAramexSize();
@@ -125,10 +127,13 @@ class Aramex_Shipping_Model_Carrier_Aramex extends Mage_Usa_Model_Shipping_Carri
125
 
126
  $weight = $this->getTotalNumOfBoxes($request->getPackageWeight());
127
  $r->setWeightPounds(floor($weight));
 
 
128
  $r->setWeightOunces(round(($weight - floor($weight)) * 16, 1));
129
  if ($request->getFreeMethodWeight() != $request->getPackageWeight()) {
130
  $r->setFreeMethodWeight($request->getFreeMethodWeight());
131
  }
 
132
 
133
  $r->setValue($request->getPackageValue());
134
  $r->setValueWithDiscount($request->getPackageValueWithDiscount());
@@ -143,7 +148,8 @@ class Aramex_Shipping_Model_Carrier_Aramex extends Mage_Usa_Model_Shipping_Carri
143
  }
144
 
145
  protected function _getQuotes() {
146
- return false;
 
147
  }
148
 
149
  public function getResult() {
@@ -166,11 +172,15 @@ class Aramex_Shipping_Model_Carrier_Aramex extends Mage_Usa_Model_Shipping_Carri
166
  */
167
  public function getAllowedMethods()
168
  {
169
- $allowed = explode(',', $this->getConfigData('allowed_methods'));
170
  $arr = array();
171
  foreach ($allowed as $k) {
172
  $arr[$k] = $this->getCode('method', $k);
173
  }
 
 
 
 
174
  return $arr;
175
  }
176
 
@@ -325,6 +335,108 @@ class Aramex_Shipping_Model_Carrier_Aramex extends Mage_Usa_Model_Shipping_Carri
325
 
326
  return $_resultTable;
327
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
328
  }
329
 
330
  ?>
32
  protected $_defaultGatewayUrl = null;
33
 
34
  function __construct()
35
+ {
36
  $this->_defaultGatewayUrl = Mage::helper('aramexshipment')->getWsdlPath().'Tracking.wsdl';
37
  }
38
 
43
 
44
  public function collectRates(Mage_Shipping_Model_Rate_Request $request)
45
  {
46
+
47
  if (!$this->getConfigFlag($this->_activeFlag)) {
48
  return false;
49
  }
50
+
51
 
52
+ $this->setRequest($request);
53
+ $this->_result = $this->_getQuotes();
54
+ $this->_updateFreeMethodQuote($request);
 
 
 
55
  return $this->getResult();
56
  }
57
 
58
+
59
+
60
  public function setRequest(Mage_Shipping_Model_Rate_Request $request) {
61
  $this->_request = $request;
62
 
63
  $r = new Varien_Object();
64
+
65
 
66
  if ($request->getLimitMethod()) {
67
  $r->setService($request->getLimitMethod());
76
  }
77
  $r->setUserId($userId);
78
 
79
+ /* if ($request->getAramexContainer()) {
80
  $container = $request->getAramexContainer();
81
  } else {
82
  $container = $this->getConfigData('container');
83
  }
84
+ $r->setContainer($container); */
85
 
86
  if ($request->getAramexSize()) {
87
  $size = $request->getAramexSize();
127
 
128
  $weight = $this->getTotalNumOfBoxes($request->getPackageWeight());
129
  $r->setWeightPounds(floor($weight));
130
+ $r->setPackageQty($request->getPackageQty());
131
+
132
  $r->setWeightOunces(round(($weight - floor($weight)) * 16, 1));
133
  if ($request->getFreeMethodWeight() != $request->getPackageWeight()) {
134
  $r->setFreeMethodWeight($request->getFreeMethodWeight());
135
  }
136
+ $r->setDestState($request->getDestRegionCode());
137
 
138
  $r->setValue($request->getPackageValue());
139
  $r->setValueWithDiscount($request->getPackageValueWithDiscount());
148
  }
149
 
150
  protected function _getQuotes() {
151
+ return $this->_getAramexQuotes();
152
+ /*return false; */
153
  }
154
 
155
  public function getResult() {
172
  */
173
  public function getAllowedMethods()
174
  {
175
+ /*$allowed = explode(',', $this->getConfigData('allowed_methods'));
176
  $arr = array();
177
  foreach ($allowed as $k) {
178
  $arr[$k] = $this->getCode('method', $k);
179
  }
180
+ Mage::log($arr);*/
181
+ $arr['SFC'] = 'Surface Cargo (India)';
182
+ $arr['OND'] = 'Overnight (Document)';
183
+ $arr['ONP'] = 'Overnight (Parcel)';
184
  return $arr;
185
  }
186
 
335
 
336
  return $_resultTable;
337
  }
338
+
339
+ public function _getAramexQuotes(){
340
+ $r = $this->_rawRequest;
341
+ $pkgWeight = $r->getWeightPounds();
342
+ $pkgQty = $r->getPackageQty();
343
+
344
+
345
+ $product_group = 'EXP';
346
+ $allowed_methods_key = 'allowed_international_methods';
347
+ $allowed_methods = Mage::getSingleton('aramex/carrier_aramex_source_internationalmethods')->toKeyArray();
348
+ if(Mage::getStoreConfig('aramexsettings/shipperdetail/country') == $r->getDestCountryId()){
349
+ $product_group = 'DOM';
350
+ $allowed_methods = Mage::getSingleton('aramex/carrier_aramex_source_domesticmethods')->toKeyArray();
351
+ $allowed_methods_key = 'allowed_domestic_methods';
352
+ }
353
+
354
+ $admin_allowed_methods = explode(',',$this->getConfigData($allowed_methods_key));
355
+ $admin_allowed_methods = array_flip($admin_allowed_methods);
356
+ $allowed_methods = array_intersect_key($allowed_methods,$admin_allowed_methods);
357
+
358
+ $baseUrl = Mage::helper('aramexshipment')->getWsdlPath();
359
+ $clientInfo = Mage::helper('aramexshipment')->getClientInfo();
360
+ $OriginAddress = array(
361
+ 'StateOrProvinceCode' => Mage::getStoreConfig('aramexsettings/shipperdetail/state'),
362
+ 'City' => Mage::getStoreConfig('aramexsettings/shipperdetail/city'),
363
+ 'PostCode' => Mage::getStoreConfig('aramexsettings/shipperdetail/postalcode'),
364
+ 'CountryCode' => Mage::getStoreConfig('aramexsettings/shipperdetail/country'),
365
+ );
366
+ $DestinationAddress = array(
367
+ 'StateOrProvinceCode' =>$r->getDestState(),
368
+ 'City' => '',
369
+ 'PostCode' => Mage_Usa_Model_Shipping_Carrier_Abstract::USA_COUNTRY_ID == $r->getDestCountryId() ? substr($r->getDestPostal(), 0, 5) : $r->getDestPostal(),
370
+ 'CountryCode' => $r->getDestCountryId(),
371
+ );
372
+ $ShipmentDetails = array(
373
+ 'PaymentType' => 'P',
374
+ 'ProductGroup' => $product_group,
375
+ 'ProductType' => '',
376
+ 'ActualWeight' => array('Value' => $pkgWeight, 'Unit' => 'LB'),
377
+ 'ChargeableWeight' => array('Value' => $pkgWeight, 'Unit' => 'LB'),
378
+ 'NumberOfPieces' => $pkgQty
379
+ );
380
+
381
+ $params = array('ClientInfo' => $clientInfo, 'OriginAddress' => $OriginAddress, 'DestinationAddress' => $DestinationAddress, 'ShipmentDetails' => $ShipmentDetails);
382
+
383
+
384
+ //SOAP object
385
+ $soapClient = new SoapClient($baseUrl . 'aramex-rates-calculator-wsdl.wsdl');
386
+ $priceArr = array();
387
+ foreach($allowed_methods as $m_value =>$m_title){
388
+ $params['ShipmentDetails']['ProductType'] = $m_value;
389
+
390
+ try{
391
+ $results = $soapClient->CalculateRate($params);
392
+
393
+ if($results->HasErrors){
394
+ if(count($results->Notifications->Notification) > 1){
395
+ $error="";
396
+ foreach($results->Notifications->Notification as $notify_error){
397
+ $error.=$this->__('Aramex: ' . $notify_error->Code .' - '. $notify_error->Message)."<br>";
398
+ }
399
+ $response['error']=$error;
400
+ }else{
401
+ $response['error']=$this->__('Aramex: ' . $results->Notifications->Notification->Code . ' - '. $results->Notifications->Notification->Message);
402
+ }
403
+ $response['type']='error';
404
+ }else{
405
+ $response['type']='success';
406
+ $priceArr[$m_value] = array('label' => $m_title, 'amount'=> $results->TotalAmount->Value);
407
+
408
+ }
409
+ } catch (Exception $e) {
410
+ $response['type']='error';
411
+ $response['error']=$e->getMessage();
412
+ }
413
+ }
414
+ $result = Mage::getModel('shipping/rate_result');
415
+ $defaults = $this->getDefaults();
416
+ if (empty($priceArr)) {
417
+ $error = Mage::getModel('shipping/rate_result_error');
418
+ $error->setCarrier($this->_code);
419
+ $error->setCarrierTitle($this->getConfigData('title'));
420
+ $error->setErrorMessage($this->getConfigData('specificerrmsg'));
421
+ $result->append($error);
422
+ } else {
423
+ foreach ($priceArr as $method=>$values) {
424
+ $rate = Mage::getModel('shipping/rate_result_method');
425
+ $rate->setCarrier($this->_code);
426
+ $rate->setCarrierTitle($this->getConfigData('title'));
427
+ $rate->setMethod($method);
428
+ $rate->setMethodTitle($values['label']);
429
+ $rate->setCost($values['amount']);
430
+ $rate->setPrice($values['amount']);
431
+ $result->append($rate);
432
+ }
433
+ }
434
+
435
+ return $result;
436
+ }
437
+
438
+
439
+
440
  }
441
 
442
  ?>
app/code/community/Aramex/Shipping/Model/Carrier/Aramex/Source/DomesticAdditionalServices.php ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-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@magentocommerce.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.magentocommerce.com for more information.
20
+ *
21
+ * @category Aramex
22
+ * @package Aramex_Shipping
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ class Aramex_Shipping_Model_Carrier_Aramex_Source_DomesticAdditionalServices
29
+ {
30
+ public function toOptionArray()
31
+ {
32
+ $arr[] = array('value'=>'AM10', 'label'=>'Morning delivery');
33
+ $arr[] = array('value'=>'CHST', 'label'=>'Chain Stores Delivery');
34
+ $arr[] = array('value'=>'CODS', 'label'=>'Cash On Delivery Service');
35
+ $arr[] = array('value'=>'COMM', 'label'=>'Commercial');
36
+ $arr[] = array('value'=>'CRDT', 'label'=>'Credit Card');
37
+
38
+ $arr[] = array('value'=>'DDP', 'label'=>'DDP - Delivery Duty Paid - For European Use');
39
+ $arr[] = array('value'=>'DDU', 'label'=>'DDU - Delivery Duty Unpaid - For the European Freight');
40
+ $arr[] = array('value'=>'EXW', 'label'=>'Not An Aramex Customer - For European Freight');
41
+ $arr[] = array('value'=>'INSR', 'label'=>'Insurance');
42
+ $arr[] = array('value'=>'RTRN', 'label'=>'Return');
43
+
44
+ $arr[] = array('value'=>'SPCL', 'label'=>'Special Services');
45
+
46
+
47
+ return $arr;
48
+ }
49
+ }
app/code/community/Aramex/Shipping/Model/Carrier/Aramex/Source/Domesticmethods.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-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@magentocommerce.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.magentocommerce.com for more information.
20
+ *
21
+ * @category Aramex
22
+ * @package Aramex_Shipping
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ class Aramex_Shipping_Model_Carrier_Aramex_Source_Domesticmethods
29
+ {
30
+ public function toOptionArray()
31
+ {
32
+ $arr[] = array('value'=>'BLK', 'label'=>'Special: Bulk Mail Delivery');
33
+ $arr[] = array('value'=>'BLT', 'label'=>'Domestic - Bullet Delivery');
34
+ $arr[] = array('value'=>'CDA', 'label'=>'Special Delivery');
35
+ $arr[] = array('value'=>'CDS', 'label'=>'Special: Credit Cards Delivery');
36
+ $arr[] = array('value'=>'CGO', 'label'=>'Air Cargo (India)');
37
+
38
+ $arr[] = array('value'=>'COM', 'label'=>'Special: Cheque Collection');
39
+ $arr[] = array('value'=>'DEC', 'label'=>'Special: Invoice Delivery');
40
+ $arr[] = array('value'=>'EMD', 'label'=>'Early Morning delivery');
41
+ $arr[] = array('value'=>'FIX', 'label'=>'Special: Bank Branches Run');
42
+ $arr[] = array('value'=>'LGS', 'label'=>'Logistic Shipment');
43
+
44
+ $arr[] = array('value'=>'OND', 'label'=>'Overnight (Document)');
45
+ $arr[] = array('value'=>'ONP', 'label'=>'Overnight (Parcel)');
46
+ $arr[] = array('value'=>'P24', 'label'=>'Road Freight 24 hours service');
47
+ $arr[] = array('value'=>'P48', 'label'=>'Road Freight 48 hours service');
48
+ $arr[] = array('value'=>'PEC', 'label'=>'Economy Delivery');
49
+
50
+ $arr[] = array('value'=>'PEX', 'label'=>'Road Express');
51
+ $arr[] = array('value'=>'SFC', 'label'=>'Surface Cargo (India)');
52
+ $arr[] = array('value'=>'SMD', 'label'=>'Same Day (Document)');
53
+ $arr[] = array('value'=>'SMP', 'label'=>'Same Day (Parcel)');
54
+ $arr[] = array('value'=>'SPD', 'label'=>'Special: Legal Branches Mail Service');
55
+
56
+ $arr[] = array('value'=>'SPL', 'label'=>'Special : Legal Notifications Delivery');
57
+
58
+ return $arr;
59
+ }
60
+
61
+ public function toKeyArray(){
62
+ $result = array();
63
+ $options = $this->toOptionArray();
64
+ foreach($options as $option){
65
+ $result[$option['value']] = $option['label'];
66
+ }
67
+ return $result;
68
+ }
69
+ }
app/code/community/Aramex/Shipping/Model/Carrier/Aramex/Source/InternationalAdditionalServices.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-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@magentocommerce.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.magentocommerce.com for more information.
20
+ *
21
+ * @category Aramex
22
+ * @package Aramex_Shipping
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ class Aramex_Shipping_Model_Carrier_Aramex_Source_InternationalAdditionalServices
29
+ {
30
+ public function toOptionArray()
31
+ {
32
+ $arr[] = array('value'=>'AM10', 'label'=>'Morning delivery');
33
+ $arr[] = array('value'=>'CODS', 'label'=>'Cash On Delivery');
34
+ $arr[] = array('value'=>'CSTM', 'label'=>'CSTM');
35
+ $arr[] = array('value'=>'EUCO', 'label'=>'NULL');
36
+ $arr[] = array('value'=>'FDAC', 'label'=>'FDAC');
37
+
38
+ /*$arr[] = array('value'=>'FRD1', 'label'=>'Free Domicile');*/
39
+ $arr[] = array('value'=>'FRDM', 'label'=>'FRDM');
40
+ $arr[] = array('value'=>'INSR', 'label'=>'Insurance');
41
+ $arr[] = array('value'=>'NOON', 'label'=>'Noon Delivery');
42
+ $arr[] = array('value'=>'ODDS', 'label'=>'Over Size');
43
+
44
+ $arr[] = array('value'=>'RTRN', 'label'=>'RTRN');
45
+ $arr[] = array('value'=>'SIGR', 'label'=>'Signature Required');
46
+ $arr[] = array('value'=>'SPCL', 'label'=>'Special Services');
47
+
48
+
49
+
50
+ return $arr;
51
+ }
52
+ }
app/code/community/Aramex/Shipping/Model/Carrier/Aramex/Source/Internationalmethods.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-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@magentocommerce.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.magentocommerce.com for more information.
20
+ *
21
+ * @category Aramex
22
+ * @package Aramex_Shipment
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ class Aramex_Shipping_Model_Carrier_Aramex_Source_Internationalmethods
29
+ {
30
+ public function toOptionArray()
31
+ {
32
+ $arr[] = array('value'=>'DPX', 'label'=>'Value Express Parcels');
33
+ $arr[] = array('value'=>'EDX', 'label'=>'Economy Document Express');
34
+ $arr[] = array('value'=>'EPX', 'label'=>'Economy Parcel Express');
35
+ $arr[] = array('value'=>'GDX', 'label'=>'Ground Document Express');
36
+ $arr[] = array('value'=>'GPX', 'label'=>'Ground Parcel Express');
37
+
38
+ $arr[] = array('value'=>'IBD', 'label'=>'International defered');
39
+ $arr[] = array('value'=>'PDX', 'label'=>'Priority Document Express');
40
+ $arr[] = array('value'=>'PLX', 'label'=>'Priority Letter Express (<.5 kg Docs)');
41
+ $arr[] = array('value'=>'PPX', 'label'=>'Priority Parcel Express');
42
+
43
+ return $arr;
44
+ }
45
+ public function toKeyArray(){
46
+ $result = array();
47
+ $options = $this->toOptionArray();
48
+ foreach($options as $option){
49
+ $result[$option['value']] = $option['label'];
50
+ }
51
+ return $result;
52
+ }
53
+ }
app/code/community/Aramex/Shipping/Model/Carrier/Aramex/Source/Productgroup.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Magento
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-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@magentocommerce.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.magentocommerce.com for more information.
20
+ *
21
+ * @category Aramex
22
+ * @package Aramex_Shipment
23
+ * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+
28
+ class Aramex_Shipping_Model_Carrier_Aramex_Source_Productgroup
29
+ {
30
+ public function toOptionArray()
31
+ {
32
+ $arr[] = array('value'=>'DOM', 'label'=>'Domestic');
33
+ $arr[] = array('value'=>'EXP', 'label'=>'International Express');
34
+ return $arr;
35
+ }
36
+ }
app/code/community/Aramex/Shipping/etc/config.xml CHANGED
@@ -15,20 +15,14 @@
15
  <carriers>
16
  <!-- Use group alias -->
17
  <aramex>
18
- <active>1</active>
19
- <sallowspecific>0</sallowspecific>
20
- <!--model>shipping/carrier_aramex</model-->
21
- <!--model>newmodule/carrier_newmodule</model-->
22
-
23
  <model>Aramex_Shipping_Model_Carrier_Aramex</model>
24
- <name>aramex</name>
25
- <gateway_url>aramex/Tracking.wsdl</gateway_url>
26
- <price>10.00</price>
27
- <title>aramex</title>
28
- <specificerrmsg>
29
- This shipping method is currently unavailable.If you would like to ship using this shipping method, please contact us.
30
- </specificerrmsg>
31
- <handling_type>F</handling_type>
32
  </aramex>
33
  </carriers>
34
  </default>
@@ -38,7 +32,7 @@
38
  <!-- Use module name_Shipping -->
39
  <Aramex_Shipping>
40
  <!-- this version number will be used for database upgrades -->
41
- <version>0.6.0</version>
42
  <!-- Use module name_Shipping -->
43
  </Aramex_Shipping>
44
  </modules>
15
  <carriers>
16
  <!-- Use group alias -->
17
  <aramex>
18
+ <active>0</active>
19
+ <sallowspecific>0</sallowspecific>
 
 
 
20
  <model>Aramex_Shipping_Model_Carrier_Aramex</model>
21
+ <name>Aramex</name>
22
+ <max_package_weight>250</max_package_weight>
23
+ <title>Aramex</title>
24
+ <specificerrmsg>This shipping method is currently unavailable.If you would like to ship using this shipping method, please contact us.
25
+ </specificerrmsg>
 
 
 
26
  </aramex>
27
  </carriers>
28
  </default>
32
  <!-- Use module name_Shipping -->
33
  <Aramex_Shipping>
34
  <!-- this version number will be used for database upgrades -->
35
+ <version>0.6.1</version>
36
  <!-- Use module name_Shipping -->
37
  </Aramex_Shipping>
38
  </modules>
app/code/community/Aramex/Shipping/etc/system.xml CHANGED
@@ -4,369 +4,123 @@
4
  <carriers>
5
  <groups>
6
  <aramex translate="label" module="shipping">
7
- <label>aramex</label>
8
  <frontend_type>text</frontend_type>
9
  <sort_order>13</sort_order>
10
  <show_in_default>1</show_in_default>
11
  <show_in_website>1</show_in_website>
12
  <show_in_store>1</show_in_store>
13
  <fields>
14
- <!--
15
- <account translate="label">
16
- <label>Account number</label>
17
- <frontend_type>text</frontend_type>
18
- <sort_order>7</sort_order>
19
- <show_in_default>1</show_in_default>
20
- <show_in_website>1</show_in_website>
21
- <show_in_store>1</show_in_store>
22
- </account>
23
- -->
24
- <active translate="label">
25
- <label>Enabled</label>
26
- <frontend_type>select</frontend_type>
27
- <source_model>adminhtml/system_config_source_yesno</source_model>
28
- <sort_order>1</sort_order>
29
- <show_in_default>1</show_in_default>
30
- <show_in_website>1</show_in_website>
31
- <show_in_store>1</show_in_store>
32
- </active>
33
- <!--
34
- <contentdesc translate="label">
35
-
36
- <label>Package Description</label>
37
-
38
- <frontend_type>text</frontend_type>
39
-
40
- <sort_order>12</sort_order>
41
-
42
- <show_in_default>1</show_in_default>
43
-
44
- <show_in_website>1</show_in_website>
45
-
46
- <show_in_store>1</show_in_store>
47
-
48
- </contentdesc>
49
-
50
-
51
-
52
- If the free_shipping_enable flag enable, the system will check free_shipping_subtotal to give free shipping
53
-
54
- otherwise will use shopping cart price rule behaviour
55
-
56
- -->
57
- <!--
58
- <free_shipping_enable translate="label">
59
-
60
- <label>Free shipping with minimum order amount</label>
61
-
62
- <frontend_type>select</frontend_type>
63
-
64
- <source_model>adminhtml/system_config_source_enabledisable</source_model>
65
-
66
- <sort_order>21</sort_order>
67
-
68
- <show_in_default>1</show_in_default>
69
-
70
- <show_in_website>1</show_in_website>
71
-
72
- <show_in_store>1</show_in_store>
73
-
74
- </free_shipping_enable>
75
-
76
- <free_shipping_subtotal translate="label">
77
-
78
- <label>Minimum order amount for free shipping</label>
79
-
80
- <frontend_type>text</frontend_type>
81
-
82
- <sort_order>22</sort_order>
83
-
84
- <show_in_default>1</show_in_default>
85
-
86
- <show_in_website>1</show_in_website>
87
-
88
- <show_in_store>1</show_in_store>
89
-
90
- </free_shipping_subtotal>
91
-
92
- <dutiable translate="label">
93
- <label>Shipment Dutiable</label>
94
-
95
- <frontend_type>select</frontend_type>
96
-
97
- <source_model>adminhtml/system_config_source_yesno</source_model>
98
-
99
- <sort_order>13</sort_order>
100
-
101
- <show_in_default>1</show_in_default>
102
-
103
- <show_in_website>1</show_in_website>
104
-
105
- <show_in_store>1</show_in_store>
106
-
107
- </dutiable>
108
- -->
109
- <gateway_url translate="label">
110
-
111
- <label>Gateway URL</label>
112
-
113
- <frontend_type>text</frontend_type>
114
-
115
- <sort_order>2</sort_order>
116
-
117
- <show_in_default>1</show_in_default>
118
-
119
- <show_in_website>1</show_in_website>
120
-
121
- <show_in_store>1</show_in_store>
122
-
123
- </gateway_url>
124
- <!--
125
- <handling_type translate="label">
126
- <label>Calculate Handling Fee</label>
127
-
128
- <frontend_type>select</frontend_type>
129
-
130
- <source_model>shipping/source_handlingType</source_model>
131
-
132
- <sort_order>10</sort_order>
133
-
134
- <show_in_default>1</show_in_default>
135
-
136
- <show_in_website>1</show_in_website>
137
-
138
- <show_in_store>0</show_in_store>
139
-
140
- </handling_type>
141
-
142
- <handling_action translate="label">
143
-
144
- <label>Handling Applied</label>
145
-
146
- <frontend_type>select</frontend_type>
147
-
148
- <source_model>shipping/source_handlingAction</source_model>
149
-
150
- <sort_order>11</sort_order>
151
-
152
- <show_in_default>1</show_in_default>
153
-
154
- <show_in_website>1</show_in_website>
155
-
156
- <show_in_store>0</show_in_store>
157
-
158
- </handling_action>
159
-
160
- <handling_fee translate="label">
161
-
162
- <label>Handling fee</label>
163
-
164
- <frontend_type>text</frontend_type>
165
-
166
- <sort_order>12</sort_order>
167
-
168
- <show_in_default>1</show_in_default>
169
-
170
- <show_in_website>1</show_in_website>
171
-
172
- <show_in_store>1</show_in_store>
173
-
174
- </handling_fee>
175
-
176
- <max_package_weight translate="label">
177
-
178
- <label>Maximum Package Weight (Please consult your shipping carrier for maximum supported shipping weight)</label>
179
-
180
- <frontend_type>text</frontend_type>
181
-
182
- <sort_order>13</sort_order>
183
-
184
- <show_in_default>1</show_in_default>
185
-
186
- <show_in_website>1</show_in_website>
187
-
188
- <show_in_store>1</show_in_store>
189
-
190
- </max_package_weight>
191
-
192
- <id translate="label">
193
-
194
- <label>Access ID</label>
195
-
196
- <frontend_type>text</frontend_type>
197
-
198
- <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
199
-
200
- <sort_order>5</sort_order>
201
-
202
- <show_in_default>1</show_in_default>
203
-
204
- <show_in_website>1</show_in_website>
205
-
206
- <show_in_store>1</show_in_store>
207
-
208
- </id>
209
-
210
- <password translate="label">
211
-
212
- <label>Password</label>
213
-
214
- <frontend_type>text</frontend_type>
215
-
216
- <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
217
-
218
- <sort_order>6</sort_order>
219
-
220
- <show_in_default>1</show_in_default>
221
-
222
- <show_in_website>1</show_in_website>
223
-
224
- <show_in_store>1</show_in_store>
225
-
226
- </password>
227
-
228
- <shipping_intlkey translate="label">
229
-
230
- <label>Shipping key (International)</label>
231
-
232
- <frontend_type>text</frontend_type>
233
-
234
- <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
235
-
236
- <sort_order>8</sort_order>
237
-
238
- <show_in_default>1</show_in_default>
239
-
240
- <show_in_website>1</show_in_website>
241
-
242
- <show_in_store>1</show_in_store>
243
-
244
- </shipping_intlkey>
245
-
246
- <shipping_key translate="label">
247
-
248
- <label>Shipping key</label>
249
-
250
- <frontend_type>text</frontend_type>
251
-
252
- <backend_model>adminhtml/system_config_backend_encrypted</backend_model>
253
-
254
- <sort_order>8</sort_order>
255
-
256
- <show_in_default>1</show_in_default>
257
-
258
- <show_in_website>1</show_in_website>
259
-
260
- <show_in_store>1</show_in_store>
261
-
262
- </shipping_key>
263
-
264
- <sort_order translate="label">
265
-
266
- <label>Sort order</label>
267
-
268
- <frontend_type>text</frontend_type>
269
-
270
- <sort_order>100</sort_order>
271
-
272
- <show_in_default>1</show_in_default>
273
-
274
- <show_in_website>1</show_in_website>
275
-
276
- <show_in_store>1</show_in_store>
277
-
278
- </sort_order>
279
- -->
280
- <title translate="label">
281
-
282
- <label>Title</label>
283
-
284
- <frontend_type>text</frontend_type>
285
-
286
- <sort_order>2</sort_order>
287
-
288
- <show_in_default>1</show_in_default>
289
-
290
- <show_in_website>1</show_in_website>
291
-
292
- <show_in_store>1</show_in_store>
293
-
294
- </title>
295
- <!--
296
- <sallowspecific translate="label">
297
-
298
- <label>Ship to applicable countries</label>
299
-
300
- <frontend_type>select</frontend_type>
301
-
302
- <sort_order>90</sort_order>
303
-
304
- <frontend_class>shipping-applicable-country</frontend_class>
305
-
306
- <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
307
-
308
- <show_in_default>1</show_in_default>
309
-
310
- <show_in_website>1</show_in_website>
311
-
312
- <show_in_store>1</show_in_store>
313
-
314
- </sallowspecific>
315
-
316
- <specificcountry translate="label">
317
-
318
- <label>Ship to Specific countries</label>
319
-
320
- <frontend_type>multiselect</frontend_type>
321
-
322
- <sort_order>91</sort_order>
323
-
324
- <source_model>adminhtml/system_config_source_country</source_model>
325
-
326
- <show_in_default>1</show_in_default>
327
-
328
- <show_in_website>1</show_in_website>
329
-
330
- <show_in_store>1</show_in_store>
331
-
332
- </specificcountry>
333
-
334
- <showmethod translate="label">
335
-
336
- <label>Show method if not applicable</label>
337
-
338
- <frontend_type>select</frontend_type>
339
-
340
- <sort_order>92</sort_order>
341
-
342
- <source_model>adminhtml/system_config_source_yesno</source_model>
343
-
344
- <show_in_default>1</show_in_default>
345
-
346
- <show_in_website>1</show_in_website>
347
-
348
- <show_in_store>1</show_in_store>
349
-
350
- </showmethod>
351
-
352
- <specificerrmsg translate="label">
353
-
354
- <label>Displayed Error Message</label>
355
-
356
- <frontend_type>textarea</frontend_type>
357
-
358
- <sort_order>80</sort_order>
359
-
360
- <show_in_default>1</show_in_default>
361
-
362
- <show_in_website>1</show_in_website>
363
-
364
- <show_in_store>1</show_in_store>
365
-
366
- </specificerrmsg>
367
- -->
368
  </fields>
369
-
370
  </aramex>
371
  </groups>
372
  </carriers>
4
  <carriers>
5
  <groups>
6
  <aramex translate="label" module="shipping">
7
+ <label>Aramex</label>
8
  <frontend_type>text</frontend_type>
9
  <sort_order>13</sort_order>
10
  <show_in_default>1</show_in_default>
11
  <show_in_website>1</show_in_website>
12
  <show_in_store>1</show_in_store>
13
  <fields>
14
+ <active translate="label">
15
+ <label>Enabled for Checkout</label>
16
+ <frontend_type>select</frontend_type>
17
+ <source_model>adminhtml/system_config_source_yesno</source_model>
18
+ <sort_order>10</sort_order>
19
+ <show_in_default>1</show_in_default>
20
+ <show_in_website>1</show_in_website>
21
+ <show_in_store>0</show_in_store>
22
+ </active>
23
+ <title translate="label">
24
+ <label>Title</label>
25
+ <frontend_type>text</frontend_type>
26
+ <sort_order>40</sort_order>
27
+ <show_in_default>1</show_in_default>
28
+ <show_in_website>1</show_in_website>
29
+ <show_in_store>1</show_in_store>
30
+ </title>
31
+ <container translate="label">
32
+ <label>Container</label>
33
+ <frontend_type>select</frontend_type>
34
+ <source_model>usa/shipping_carrier_usps_source_container</source_model>
35
+ <sort_order>60</sort_order>
36
+ <show_in_default>1</show_in_default>
37
+ <show_in_website>1</show_in_website>
38
+ <show_in_store>0</show_in_store>
39
+ </container>
40
+
41
+ <max_package_weight translate="label">
42
+ <label>Maximum Package Weight (Please consult your shipping carrier for maximum supported shipping weight)</label>
43
+ <frontend_type>text</frontend_type>
44
+ <validate>validate-number validate-zero-or-greater</validate>
45
+ <sort_order>90</sort_order>
46
+ <show_in_default>1</show_in_default>
47
+ <show_in_website>1</show_in_website>
48
+ <show_in_store>0</show_in_store>
49
+ </max_package_weight>
50
+
51
+ <specificerrmsg translate="label">
52
+ <label>Displayed Error Message</label>
53
+ <frontend_type>textarea</frontend_type>
54
+ <sort_order>170</sort_order>
55
+ <show_in_default>1</show_in_default>
56
+ <show_in_website>1</show_in_website>
57
+ <show_in_store>1</show_in_store>
58
+ </specificerrmsg>
59
+ <sallowspecific translate="label">
60
+ <label>Ship to Applicable Countries</label>
61
+ <frontend_type>select</frontend_type>
62
+ <sort_order>180</sort_order>
63
+ <frontend_class>shipping-applicable-country</frontend_class>
64
+ <source_model>adminhtml/system_config_source_shipping_allspecificcountries</source_model>
65
+ <show_in_default>1</show_in_default>
66
+ <show_in_website>1</show_in_website>
67
+ <show_in_store>0</show_in_store>
68
+ </sallowspecific>
69
+ <specificcountry translate="label">
70
+ <label>Ship to Specific Countries</label>
71
+ <frontend_type>multiselect</frontend_type>
72
+ <sort_order>190</sort_order>
73
+ <source_model>adminhtml/system_config_source_country</source_model>
74
+ <show_in_default>1</show_in_default>
75
+ <show_in_website>1</show_in_website>
76
+ <show_in_store>0</show_in_store>
77
+ <can_be_empty>1</can_be_empty>
78
+ </specificcountry>
79
+
80
+ <allowed_domestic_methods translate="label">
81
+ <label>Allowed Domestic Methods</label>
82
+ <frontend_type>multiselect</frontend_type>
83
+ <frontend_class>required-entry</frontend_class>
84
+ <source_model>aramex/carrier_aramex_source_domesticmethods</source_model>
85
+ <sort_order>195</sort_order>
86
+ <show_in_default>1</show_in_default>
87
+ <show_in_website>1</show_in_website>
88
+ <show_in_store>1</show_in_store>
89
+ <!--<can_be_empty>0</can_be_empty>-->
90
+ <required>1</required>
91
+ </allowed_domestic_methods>
92
+
93
+ <allowed_international_methods translate="label">
94
+ <label>Allowed International Methods</label>
95
+ <frontend_type>multiselect</frontend_type>
96
+ <source_model>aramex/carrier_aramex_source_internationalmethods</source_model>
97
+ <sort_order>198</sort_order>
98
+ <show_in_default>1</show_in_default>
99
+ <show_in_website>1</show_in_website>
100
+ <show_in_store>1</show_in_store>
101
+ <frontend_class>required-entry</frontend_class>
102
+ <required>1</required>
103
+ </allowed_international_methods>
104
+
105
+ <showmethod translate="label">
106
+ <label>Show Method if Not Applicable</label>
107
+ <frontend_type>select</frontend_type>
108
+ <sort_order>210</sort_order>
109
+ <frontend_class>shipping-skip-hide</frontend_class>
110
+ <source_model>adminhtml/system_config_source_yesno</source_model>
111
+ <show_in_default>1</show_in_default>
112
+ <show_in_website>1</show_in_website>
113
+ <show_in_store>0</show_in_store>
114
+ </showmethod>
115
+ <sort_order translate="label">
116
+ <label>Sort Order</label>
117
+ <frontend_type>text</frontend_type>
118
+ <sort_order>220</sort_order>
119
+ <show_in_default>1</show_in_default>
120
+ <show_in_website>1</show_in_website>
121
+ <show_in_store>0</show_in_store>
122
+ </sort_order>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  </fields>
 
124
  </aramex>
125
  </groups>
126
  </carriers>
app/design/adminhtml/default/default/layout/aramex.xml CHANGED
@@ -4,6 +4,7 @@
4
  <reference name="head">
5
  <action method="addItem"><type>skin_js</type><name>aramex/js/jquery.min.js</name></action>
6
  <action method="addItem"><type>skin_js</type><name>aramex/js/common.js</name></action>
 
7
  <action method="addItem"><type>skin_css</type><name>aramex/css/aramex.css</name></action>
8
  </reference>
9
  <reference name="before_body_end">
4
  <reference name="head">
5
  <action method="addItem"><type>skin_js</type><name>aramex/js/jquery.min.js</name></action>
6
  <action method="addItem"><type>skin_js</type><name>aramex/js/common.js</name></action>
7
+ <action method="addItem"><type>skin_js</type><name>aramex/js/jquery.chained.js</name></action>
8
  <action method="addItem"><type>skin_css</type><name>aramex/css/aramex.css</name></action>
9
  </reference>
10
  <reference name="before_body_end">
app/design/adminhtml/default/default/template/aramex/calculate_rate.phtml CHANGED
@@ -132,8 +132,55 @@ $_order = Mage::getModel('sales/order')->load($this->getRequest()->getParam('ord
132
  <div class="clearfix mar-10">
133
  <div class="field fl width-270">
134
  <label><span>*</span>Service Type</label>
135
- <select name="service_type" class="fl" id="service_type">
136
- <option <?php if($shipping) {echo ($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')) ? 'selected="selected"' : '';} ?> value="ONP" class="local" style="<?php if($shipping->getCountry() != Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>">Overnight Parcel</option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
137
  <option value="OND" class="local" style="<?php if($shipping->getCountry() != Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>">Overnight Document</option>
138
  <option value="CDA" class="local" style="<?php if($shipping->getCountry() != Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>">Cash on Delivery</option>
139
  <option <?php if($shipping) {echo ($shipping->getCountry() != Mage::getStoreConfig('aramexsettings/shipperdetail/country')) ? 'selected="selected"' : '';} ?> value="PDX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Priority Document Express</option>
@@ -142,7 +189,7 @@ $_order = Mage::getModel('sales/order')->load($this->getRequest()->getParam('ord
142
  <option value="DDX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Deferred Document Express</option>
143
  <option value="DPX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Deferred Parcel Express</option>
144
  <option value="GDX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Ground Document Express</option>
145
- <option value="GPX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Ground Parcel Express</option>
146
  </select>
147
  </div>
148
  <div class="field fl">
@@ -185,16 +232,8 @@ $_order = Mage::getModel('sales/order')->load($this->getRequest()->getParam('ord
185
  if (this.validate()) {
186
  myObj.calcRate();
187
  }
188
- }
189
- Event.observe('calc-product-group', 'change', function(){
190
- var e=document.getElementById('service_type');
191
- if(this.value=='EXP'){
192
- e.options[3].selected=true;
193
- jQuery('.non-local').show();jQuery('.local').hide(); }
194
- else{
195
- e.options[0].selected=true;
196
- jQuery('.non-local').hide();jQuery('.local').show(); }
197
- });
198
  <?php $_url=Mage::helper("adminhtml")->getUrl('aramexshipment/shipment/printLabel/order_id/'.$this->getRequest()->getParam('order_id'));?>
199
  myObj.printLabelUrl='<?php echo $_url;?>';
200
 
132
  <div class="clearfix mar-10">
133
  <div class="field fl width-270">
134
  <label><span>*</span>Service Type</label>
135
+ <select name="service_type" class="fl" id="service_type">
136
+ <?php
137
+ $allowed_domestic_methods = explode(',', Mage::getStoreConfig('aramexsettings/config/allowed_domestic_methods'));
138
+ $allowed_international_methods = explode(',', Mage::getStoreConfig('aramexsettings/config/allowed_international_methods'));
139
+ $domestic_methods = Mage::getModel('aramex/carrier_aramex_source_domesticmethods')->toOptionArray();
140
+ $international_methods = Mage::getModel('aramex/carrier_aramex_source_internationalmethods')->toOptionArray();
141
+
142
+
143
+ $shipperdetail_country = Mage::getStoreConfig('aramexsettings/shipperdetail/country');
144
+ $shipping_country = is_object($shipping)?$shipping->getCountry():'';
145
+
146
+
147
+ ?>
148
+
149
+ <?php if(count($allowed_domestic_methods)>0){
150
+ $i=1;
151
+ foreach($domestic_methods as $key=>$val){
152
+ if(in_array($val['value'],$allowed_domestic_methods)){
153
+
154
+ /* style="<?php if($shipping_country != $shipperdetail_country) { echo 'display: none'; } ?>"*/
155
+
156
+ ?>
157
+ <option <?php echo ($i == 1 and $shipping_country == $shipperdetail_country) ? 'selected="selected"' : ''; ?> value="<?php echo $val['value'];?>" id="calc_<?php echo $val['value'];?>" class="local DOM">
158
+ <?php echo $val['label']; ?></option>
159
+ <?php
160
+ $i++;
161
+ }
162
+ }
163
+ } ?>
164
+ <?php if(count($allowed_international_methods)>0){
165
+ $i=1;
166
+ foreach($international_methods as $key=>$val){
167
+ if(in_array($val['value'],$allowed_international_methods)){
168
+
169
+ /* style="<?php if($shipping_country == $shipperdetail_country) { echo 'display: none'; } ?>" */
170
+
171
+ ?>
172
+ <option <?php echo ($i == 1 and $shipping_country != $shipperdetail_country) ? 'selected="selected"' : ''; ?> value="<?php echo $val['value'];?>" id="calc_<?php echo $val['value'];?>" class="non-local EXP">
173
+ <?php echo $val['label']; ?></option>
174
+ <?php
175
+ $i++;
176
+ }
177
+ }
178
+ } ?>
179
+
180
+
181
+
182
+ <?php /*
183
+ <option <?php if($shipping) {echo ($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')) ? 'selected="selected"' : '';} ?> value="ONP" class="local" style="<?php if($shipping->getCountry() != Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>">Overnight Parcel</option>
184
  <option value="OND" class="local" style="<?php if($shipping->getCountry() != Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>">Overnight Document</option>
185
  <option value="CDA" class="local" style="<?php if($shipping->getCountry() != Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>">Cash on Delivery</option>
186
  <option <?php if($shipping) {echo ($shipping->getCountry() != Mage::getStoreConfig('aramexsettings/shipperdetail/country')) ? 'selected="selected"' : '';} ?> value="PDX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Priority Document Express</option>
189
  <option value="DDX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Deferred Document Express</option>
190
  <option value="DPX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Deferred Parcel Express</option>
191
  <option value="GDX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Ground Document Express</option>
192
+ <option value="GPX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Ground Parcel Express</option>*/?>
193
  </select>
194
  </div>
195
  <div class="field fl">
232
  if (this.validate()) {
233
  myObj.calcRate();
234
  }
235
+ }
236
+ jQuery("#service_type").chained("#calc-product-group");
 
 
 
 
 
 
 
 
237
  <?php $_url=Mage::helper("adminhtml")->getUrl('aramexshipment/shipment/printLabel/order_id/'.$this->getRequest()->getParam('order_id'));?>
238
  myObj.printLabelUrl='<?php echo $_url;?>';
239
 
app/design/adminhtml/default/default/template/aramex/schedule_puckup.phtml CHANGED
@@ -139,7 +139,50 @@ $_order = Mage::getModel('sales/order')->load($this->getRequest()->getParam('ord
139
  <div class="field fl">
140
  <label><span>*</span>Product Type:</label>
141
  <select name="pickup[product_type]" class="fl" id="product_type">
142
- <option <?php if($shipping) {echo ($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')) ? 'selected="selected"' : '';} ?> value="ONP" class="local" style="<?php if($shipping->getCountry() != Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>">Overnight Parcel</option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  <option value="OND" class="local" style="<?php if($shipping->getCountry() != Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>">Overnight Document</option>
144
  <option value="CDA" class="local" style="<?php if($shipping->getCountry() != Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>">Cash on Delivery</option>
145
  <option <?php if($shipping) {echo ($shipping->getCountry() != Mage::getStoreConfig('aramexsettings/shipperdetail/country')) ? 'selected="selected"' : '';} ?> value="PDX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Priority Document Express</option>
@@ -148,7 +191,7 @@ $_order = Mage::getModel('sales/order')->load($this->getRequest()->getParam('ord
148
  <option value="DDX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Deferred Document Express</option>
149
  <option value="DPX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Deferred Parcel Express</option>
150
  <option value="GDX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Ground Document Express</option>
151
- <option value="GPX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Ground Parcel Express</option>
152
  </select>
153
  </div>
154
  </div>
@@ -273,6 +316,7 @@ $_order = Mage::getModel('sales/order')->load($this->getRequest()->getParam('ord
273
  </form>
274
  <script type="text/javascript">
275
  //<![CDATA[
 
276
  var H='<?php echo date("H",Mage::app()->getLocale()->storeTimeStamp());?>';
277
  var M='<?php echo date("i",Mage::app()->getLocale()->storeTimeStamp());?>';
278
  var D='<?php echo date("m/d/Y",Mage::app()->getLocale()->storeTimeStamp());?>';
139
  <div class="field fl">
140
  <label><span>*</span>Product Type:</label>
141
  <select name="pickup[product_type]" class="fl" id="product_type">
142
+
143
+ <?php
144
+ $allowed_domestic_methods = explode(',', Mage::getStoreConfig('aramexsettings/config/allowed_domestic_methods'));
145
+ $allowed_international_methods = explode(',', Mage::getStoreConfig('aramexsettings/config/allowed_international_methods'));
146
+ $domestic_methods = Mage::getModel('aramex/carrier_aramex_source_domesticmethods')->toOptionArray();
147
+ $international_methods = Mage::getModel('aramex/carrier_aramex_source_internationalmethods')->toOptionArray();
148
+
149
+
150
+ $shipperdetail_country = Mage::getStoreConfig('aramexsettings/shipperdetail/country');
151
+ $shipping_country = is_object($shipping)?$shipping->getCountry():'';
152
+
153
+
154
+ ?>
155
+
156
+ <?php if(count($allowed_domestic_methods)>0){
157
+ $i=1;
158
+ foreach($domestic_methods as $key=>$val){
159
+ if(in_array($val['value'],$allowed_domestic_methods)){
160
+ /*style="<?php if($shipping_country != $shipperdetail_country) { echo 'display: none'; } ?>"*/
161
+ ?>
162
+ <option <?php echo ($i == 1 and $shipping_country == $shipperdetail_country) ? 'selected="selected"' : ''; ?> value="<?php echo $val['value'];?>" id="calc_<?php echo $val['value'];?>" class="local DOM">
163
+ <?php echo $val['label']; ?></option>
164
+ <?php
165
+ $i++;
166
+ }
167
+ }
168
+ } ?>
169
+ <?php if(count($allowed_international_methods)>0){
170
+ $i=1;
171
+ foreach($international_methods as $key=>$val){
172
+ if(in_array($val['value'],$allowed_international_methods)){
173
+ /* style="<?php if($shipping_country == $shipperdetail_country) { echo 'display: none'; } ?>" */
174
+
175
+ ?>
176
+ <option <?php echo ($i == 1 and $shipping_country != $shipperdetail_country) ? 'selected="selected"' : ''; ?> value="<?php echo $val['value'];?>" id="calc_<?php echo $val['value'];?>" class="non-local EXP">
177
+ <?php echo $val['label']; ?></option>
178
+ <?php
179
+ $i++;
180
+ }
181
+ }
182
+ } ?>
183
+
184
+
185
+ <?php /*<option <?php if($shipping) {echo ($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')) ? 'selected="selected"' : '';} ?> value="ONP" class="local" style="<?php if($shipping->getCountry() != Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>">Overnight Parcel</option>
186
  <option value="OND" class="local" style="<?php if($shipping->getCountry() != Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>">Overnight Document</option>
187
  <option value="CDA" class="local" style="<?php if($shipping->getCountry() != Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>">Cash on Delivery</option>
188
  <option <?php if($shipping) {echo ($shipping->getCountry() != Mage::getStoreConfig('aramexsettings/shipperdetail/country')) ? 'selected="selected"' : '';} ?> value="PDX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Priority Document Express</option>
191
  <option value="DDX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Deferred Document Express</option>
192
  <option value="DPX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Deferred Parcel Express</option>
193
  <option value="GDX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Ground Document Express</option>
194
+ <option value="GPX" class="non-local" style="<?php if($shipping->getCountry() == Mage::getStoreConfig('aramexsettings/shipperdetail/country')){ echo 'display: none'; } ?>" >Ground Parcel Express</option>*/ ?>
195
  </select>
196
  </div>
197
  </div>
316
  </form>
317
  <script type="text/javascript">
318
  //<![CDATA[
319
+ jQuery("#product_type").chained("#product_group");
320
  var H='<?php echo date("H",Mage::app()->getLocale()->storeTimeStamp());?>';
321
  var M='<?php echo date("i",Mage::app()->getLocale()->storeTimeStamp());?>';
322
  var D='<?php echo date("m/d/Y",Mage::app()->getLocale()->storeTimeStamp());?>';
app/design/adminhtml/default/default/template/aramex/shipment.phtml CHANGED
@@ -80,7 +80,7 @@ $payment = $_order->getPayment();
80
 
81
  <div class="text_short">
82
  <label>Payment</label>
83
- <select class="aramex_all_options" name="aramex_shipment_info_billing_account" onchange="resetShipperDetail(this);">
84
  <?php if(!$isShipped or true):?>
85
  <option value="1" <?php echo ($session and $formData['aramex_shipment_info_billing_account']=='1')?'selected="selected"':''?>>Shipper Account</option>
86
  <?php endif;?>
@@ -178,13 +178,16 @@ $payment = $_order->getPayment();
178
  <div class="text_short">
179
  <?php $company_name=($company_name) ? $company_name:'';?>
180
  <?php $company_name=(empty($company_name) and $shipping) ?$shipping->getName() :$company_name;?>
181
- <?php $company_name=($session)?$formData['aramex_shipment_receiver_company']:$company_name;?>
182
  <?php $company_name = ($shipping) ? $shipping->getData('company') : '';?>
 
 
 
 
183
  <label>Company</label><input type="text" id="aramex_shipment_receiver_company" name="aramex_shipment_receiver_company" value="<?php echo $company_name ?>"/>
184
  </div>
185
  <div class="text_short">
186
  <?php $street=($shipping) ? $shipping->getData('street'):'';?>
187
- <?php $street=($session)?$formData['aramex_shipment_receiver_name']:$street;?>
188
  <label>Address</label><textarea class="required" rows="4" cols="26" type="text" id="aramex_shipment_receiver_street" name="aramex_shipment_receiver_street"><?php echo $street; ?></textarea>
189
  </div>
190
  <div class="text_short">
@@ -270,19 +273,68 @@ $payment = $_order->getPayment();
270
  $checkCountry=($_country == Mage::getStoreConfig('aramexsettings/shipperdetail/country'))?true:false;
271
  }
272
  ?>
 
 
 
 
 
 
 
 
273
  <select class="aramex_all_options" id="aramex_shipment_info_product_type" name="aramex_shipment_info_product_type">
274
-
275
- <option <?php echo ($_type =='ONP' or $checkCountry) ? 'selected="selected"' : ''; ?> value="ONP" id="ONP" style="<?php echo ($_group!='DOM')?'display: none':''; ?>" >Overnight Parcel</option>
276
- <option value="OND" id="OND" style="<?php echo ($_group!='DOM')?'display: none':''; ?>" <?php echo ($_type =='OND') ? 'selected="selected"' : ''; ?>>Overnight Document</option>
277
- <option value="CDA" id="CDA" style="<?php echo ($_group!='DOM')?'display: none':''; ?>" <?php echo ($_type =='CDA') ? 'selected="selected"' : ''; ?>>Cash on Delivery</option>
278
- <option <?php echo ($_type=='PDX' or (!$checkCountry and $_type=='')) ? 'selected="selected"' : ''; ?> value="PDX" id="PDX" style="<?php if($checkCountry or $_group=='DOM'){ echo 'display: none'; } ?>" >Priority Document Express</option>
279
- <option value="PPX" id="PPX" style="<?php if($checkCountry or $_group=='DOM'){ echo 'display: none'; } ?>" <?php echo ($_type =='PPX') ? 'selected="selected"' : ''; ?> >Priority Parcel Express</option>
280
- <option value="PLX" id="PLX" style="<?php if($checkCountry or $_group=='DOM'){ echo 'display: none'; } ?>" <?php echo ($_type =='PLX') ? 'selected="selected"' : ''; ?> >Priority Letter Express</option>
281
- <option value="DDX" id="DDX" style="<?php if($checkCountry or $_group=='DOM'){ echo 'display: none'; } ?>" <?php echo ($_type =='DDX') ? 'selected="selected"' : ''; ?> >Deferred Document Express</option>
282
- <option value="DPX" id="DPX" style="<?php if($checkCountry or $_group=='DOM'){ echo 'display: none'; } ?>" <?php echo ($_type =='DPX') ? 'selected="selected"' : ''; ?> >Deferred Parcel Express</option>
283
- <option value="GDX" id="GDX" style="<?php if($checkCountry or $_group=='DOM'){ echo 'display: none'; } ?>" <?php echo ($_type =='GDX') ? 'selected="selected"' : ''; ?> >Ground Document Express</option>
284
- <option value="GPX" id="GPX" style="<?php if($checkCountry or $_group=='DOM'){ echo 'display: none'; } ?>" <?php echo ($_type =='GPX') ? 'selected="selected"' : ''; ?> >Ground Parcel Express</option>
285
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
  </select>
287
  <div id="aramex_shipment_info_service_type_div" style="display: none;"></div>
288
  </div>
@@ -295,12 +347,46 @@ $payment = $_order->getPayment();
295
  <select class="aramex_all_options" id="aramex_shipment_info_service_type" name="aramex_shipment_info_service_type">
296
 
297
  <option value=""></option>
298
- <option value="CODS" <?php if($_type == 'ccsave' or $_type=='CODS'){ echo 'selected="selected"'; } ?>>Cash on Delivery</option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  <option value="FIRST" <?php if($_type=='FIRST'){ echo 'selected="selected"'; } ?>>First Delivery</option>
300
  <option value="FRDOM" <?php if($_type=='FRDOM'){ echo 'selected="selected"'; } ?>>Free Domicile</option>
301
  <option value="HFPU" <?php if($_type=='HFPU'){ echo 'selected="selected"'; } ?>>Hold for pick up</option>
302
  <option value="NOON" <?php if($_type=='NOON'){ echo 'selected="selected"'; } ?>>Noon Delivery</option>
303
- <option value="SIG" <?php if($_type=='SIG'){ echo 'selected="selected"'; } ?>>Signature Required</option>
304
 
305
  </select>
306
 
@@ -338,6 +424,10 @@ $payment = $_order->getPayment();
338
  <div class="text_short">
339
  <?php $_amount=($_order->getPayment()->getMethodInstance()->getCode() != 'ccsave')?round($_order->getData('grand_total'), 2):'';?>
340
  <?php $_amount=($session)?$formData['aramex_shipment_info_cod_amount']:$_amount;?>
 
 
 
 
341
  <label>COD Amount</label><input class="" type="text" id="aramex_shipment_info_cod_amount" name="aramex_shipment_info_cod_amount" value="<?php echo $_amount; ?>"/>
342
  </div>
343
 
@@ -463,7 +553,11 @@ $payment = $_order->getPayment();
463
  }
464
  ?>
465
  <div class="text_short">
466
- <label>COD Value</label><input type="text" id="aramex_shipment_info_cod_value" name="aramex_shipment_info_cod_value" style="width: 165px; float: left;" value="<?php echo $_order->getData('base_shipping_amount')+$_order->getBaseSubtotal(); ?>" /><div style="float: left; padding-left: 5px;"><?php echo $_order->getData('base_currency_code'); ?></div>
 
 
 
 
467
  </div>
468
  <?php } ?>
469
  </div>
@@ -532,19 +626,74 @@ $payment = $_order->getPayment();
532
  <div style="float: right; width: 100%; width: 30px;"><div style="float: right;font-size: 11px;height: 30px;margin-bottom: 6px;width: 184px;"><input style="float: left; width: 30px;" type="checkbox" name="aramex_email_customer" value="yes" /> <span style="float: left; margin-top: -2px;">Notify customer by email</span></div></div>
533
  <div class="aramex_clearer"></div>
534
  <div style="float: right;margin-bottom: 20px;margin-top: -11px;">
535
- <button id="aramex_shipment_creation_submit_id" type="submit" name="aramex_shipment_creation_submit" >Create Shipment</button>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
536
  <button onclick="aramexclose()" type="button">Close</button>
537
  </div>
538
  </form>
539
  </div>
540
  </div>
541
 
 
 
 
 
 
 
542
  <script src="https://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
543
  <link rel="stylesheet" href="https://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />
544
  <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js"></script>
 
545
  <script>
546
  var jccc = jQuery.noConflict();
547
-
 
 
 
 
 
 
 
548
  var aramex_shipment_shipper_name = document.getElementById('aramex_shipment_shipper_name').value;
549
  var aramex_shipment_shipper_email = document.getElementById('aramex_shipment_shipper_email').value;
550
  var aramex_shipment_shipper_company = document.getElementById('aramex_shipment_shipper_company').value;
@@ -743,6 +892,23 @@ $payment = $_order->getPayment();
743
  }
744
 
745
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
746
 
747
  function aramexclose()
748
  {
@@ -839,41 +1005,18 @@ $payment = $_order->getPayment();
839
  jccc(".aramex_countries").change(function(){
840
  if(jccc("select[name=aramex_shipment_shipper_country]").val() != jccc("select[name=aramex_shipment_receiver_country]").val()){
841
  jccc("select[name=aramex_shipment_info_product_group]").val('EXP');
842
- //jccc("select[name=aramex_shipment_info_service_type]").val('EPX');
843
  jccc("select[name=aramex_shipment_info_additional_services] option:selected").removeAttr("selected");
844
  jccc("select[name=aramex_shipment_info_additional_services] .express_service").attr("selected", "selected");
845
 
846
- document.getElementById('aramex_shipment_info_product_type').value = 'PDX';
847
- document.getElementById('ONP').style.display = 'none';
848
- document.getElementById('OND').style.display = 'none';
849
- document.getElementById('CDA').style.display = 'none';
850
-
851
- document.getElementById('PDX').style.display = 'block';
852
- document.getElementById('PPX').style.display = 'block';
853
- document.getElementById('PLX').style.display = 'block';
854
- document.getElementById('DDX').style.display = 'block';
855
- document.getElementById('DPX').style.display = 'block';
856
- document.getElementById('GDX').style.display = 'block';
857
- document.getElementById('GPX').style.display = 'block';
858
 
859
  } else {
860
  jccc("select[name=aramex_shipment_info_product_group]").val('DOM');
861
- //jccc("select[name=aramex_shipment_info_service_type]").val('ONP');
862
  jccc("select[name=aramex_shipment_info_additional_services] option:selected").removeAttr("selected");
863
  jccc("select[name=aramex_shipment_info_additional_services] .domestic_service").attr("selected", "selected");
864
-
865
- document.getElementById('aramex_shipment_info_product_type').value = 'ONP';
866
- document.getElementById('ONP').style.display = 'block';
867
- document.getElementById('OND').style.display = 'block';
868
- document.getElementById('CDA').style.display = 'block';
869
-
870
- document.getElementById('PDX').style.display = 'none';
871
- document.getElementById('PPX').style.display = 'none';
872
- document.getElementById('PLX').style.display = 'none';
873
- document.getElementById('DDX').style.display = 'none';
874
- document.getElementById('DPX').style.display = 'none';
875
- document.getElementById('GDX').style.display = 'none';
876
- document.getElementById('GPX').style.display = 'none';
877
  }
878
 
879
  jccc("#aramex_shipment_info_product_group_div").html(jccc("select[name=aramex_shipment_info_product_group] option:selected").text());
@@ -885,39 +1028,29 @@ $payment = $_order->getPayment();
885
 
886
  });
887
  jccc("#aramex_shipment_info_product_group").change(function(){
 
888
  if(jccc("select[name=aramex_shipment_info_product_group]").val()=='EXP'){
889
  jccc("select[name=aramex_shipment_info_additional_services] option:selected").removeAttr("selected");
890
  jccc("select[name=aramex_shipment_info_additional_services] .express_service").attr("selected", "selected");
891
-
892
- document.getElementById('aramex_shipment_info_product_type').value = 'PDX';
893
- document.getElementById('ONP').style.display = 'none';
894
- document.getElementById('OND').style.display = 'none';
895
- document.getElementById('CDA').style.display = 'none';
896
-
897
- document.getElementById('PDX').style.display = 'block';
898
- document.getElementById('PPX').style.display = 'block';
899
- document.getElementById('PLX').style.display = 'block';
900
- document.getElementById('DDX').style.display = 'block';
901
- document.getElementById('DPX').style.display = 'block';
902
- document.getElementById('GDX').style.display = 'block';
903
- document.getElementById('GPX').style.display = 'block';
904
 
905
  }else if(jccc("select[name=aramex_shipment_info_product_group]").val()=='DOM'){
906
  jccc("select[name=aramex_shipment_info_additional_services] option:selected").removeAttr("selected");
907
  jccc("select[name=aramex_shipment_info_additional_services] .domestic_service").attr("selected", "selected");
908
-
909
- document.getElementById('aramex_shipment_info_product_type').value = 'ONP';
910
- document.getElementById('ONP').style.display = 'block';
911
- document.getElementById('OND').style.display = 'block';
912
- document.getElementById('CDA').style.display = 'block';
913
-
914
- document.getElementById('PDX').style.display = 'none';
915
- document.getElementById('PPX').style.display = 'none';
916
- document.getElementById('PLX').style.display = 'none';
917
- document.getElementById('DDX').style.display = 'none';
918
- document.getElementById('DPX').style.display = 'none';
919
- document.getElementById('GDX').style.display = 'none';
920
- document.getElementById('GPX').style.display = 'none';
921
 
922
  }
923
  jccc("#aramex_shipment_info_service_type_div").html(jccc("select[name=aramex_shipment_info_service_type] option:selected").text());
@@ -956,6 +1089,9 @@ $payment = $_order->getPayment();
956
  jccc("#aramex_shipment").validate();
957
 
958
  });
 
 
 
959
 
960
  </script>
961
  <?php $formSession->unsetData('form_data')?>
80
 
81
  <div class="text_short">
82
  <label>Payment</label>
83
+ <select class="aramex_all_options" name="aramex_shipment_info_billing_account" id="aramex_shipment_info_billing_account_id" onchange="resetShipperDetail(this);">
84
  <?php if(!$isShipped or true):?>
85
  <option value="1" <?php echo ($session and $formData['aramex_shipment_info_billing_account']=='1')?'selected="selected"':''?>>Shipper Account</option>
86
  <?php endif;?>
178
  <div class="text_short">
179
  <?php $company_name=($company_name) ? $company_name:'';?>
180
  <?php $company_name=(empty($company_name) and $shipping) ?$shipping->getName() :$company_name;?>
 
181
  <?php $company_name = ($shipping) ? $shipping->getData('company') : '';?>
182
+ <?php $company_name=($session)?$formData['aramex_shipment_receiver_company']:$company_name;?>
183
+ <?php if(Mage::getStoreConfig('aramexsettings/config/sandbox_flag')==1){
184
+ $company_name=(empty($company_name) and $shipping) ?$shipping->getName() :$company_name;
185
+ } ?>
186
  <label>Company</label><input type="text" id="aramex_shipment_receiver_company" name="aramex_shipment_receiver_company" value="<?php echo $company_name ?>"/>
187
  </div>
188
  <div class="text_short">
189
  <?php $street=($shipping) ? $shipping->getData('street'):'';?>
190
+ <?php $street=($session)?$formData['aramex_shipment_receiver_street']:$street;?>
191
  <label>Address</label><textarea class="required" rows="4" cols="26" type="text" id="aramex_shipment_receiver_street" name="aramex_shipment_receiver_street"><?php echo $street; ?></textarea>
192
  </div>
193
  <div class="text_short">
273
  $checkCountry=($_country == Mage::getStoreConfig('aramexsettings/shipperdetail/country'))?true:false;
274
  }
275
  ?>
276
+ <?php
277
+ $allowed_domestic_methods = explode(',', Mage::getStoreConfig('aramexsettings/config/allowed_domestic_methods'));
278
+ $allowed_international_methods = explode(',', Mage::getStoreConfig('aramexsettings/config/allowed_international_methods'));
279
+ $domestic_methods = Mage::getModel('aramex/carrier_aramex_source_domesticmethods')->toOptionArray();
280
+ $international_methods = Mage::getModel('aramex/carrier_aramex_source_internationalmethods')->toOptionArray(); $allowed_domestic_methods_apply = array();
281
+ $allowed_international_methods_apply = array();
282
+
283
+ ?>
284
  <select class="aramex_all_options" id="aramex_shipment_info_product_type" name="aramex_shipment_info_product_type">
285
+
286
+ <?php if(count($allowed_domestic_methods)>0){
287
+ $i=1;
288
+ foreach($domestic_methods as $key=>$val){
289
+ if(in_array($val['value'],$allowed_domestic_methods)){
290
+ $selected_str='';
291
+ if($i==1){
292
+ $selected_str =($_type ==$val['value'] or $checkCountry) ? 'selected="selected"' : '';}
293
+ else {
294
+ $selected_str =($_type ==$val['value']) ? 'selected="selected"' : '';
295
+ }
296
+ $allowed_domestic_methods_apply[$val['value']] = $val['label'];
297
+ /* style="<?php echo ($_group!='DOM')?'display: none':''; ?>"*/
298
+
299
+ ?>
300
+
301
+ <option <?php echo $selected_str; ?> value="<?php echo $val['value']; ?>" id="<?php echo $val['value'];?>" class="DOM"><?php echo $val['label']; ?></option>
302
+ <?php $i++;
303
+ }
304
+ }
305
+ }
306
+ ?>
307
+
308
+
309
+
310
+ <?php if(count($allowed_international_methods)>0){
311
+ $i=1;
312
+
313
+ foreach($international_methods as $key=>$val){
314
+ if(in_array($val['value'],$allowed_international_methods)){
315
+ $selected_str='';
316
+ if($i==1){
317
+
318
+ if($_type ==$val['value'] or (!$checkCountry and $_type=='')){
319
+ $selected_str = 'selected="selected"';
320
+ }
321
+ }
322
+ else {
323
+ if($_type ==$val['value']){
324
+ $selected_str = 'selected="selected"';
325
+ }
326
+ }
327
+ $allowed_international_methods_apply[$val['value']] = $val['label'];
328
+ /* style="<?php echo ($checkCountry or $_group=='DOM')?'display: none':''; ?>" */
329
+
330
+ ?>
331
+ <option <?php echo $selected_str; ?> value="<?php echo $val['value']; ?>" id="<?php echo $val['value'];?>" class="EXP"><?php echo $val['label']; ?></option>
332
+ <?php $i++;
333
+ }
334
+ }
335
+ }
336
+ ?>
337
+
338
  </select>
339
  <div id="aramex_shipment_info_service_type_div" style="display: none;"></div>
340
  </div>
347
  <select class="aramex_all_options" id="aramex_shipment_info_service_type" name="aramex_shipment_info_service_type">
348
 
349
  <option value=""></option>
350
+
351
+ <?php
352
+ $allowed_domestic_additional_services = explode(',', Mage::getStoreConfig('aramexsettings/config/allowed_domestic_additional_services'));
353
+ $allowed_international_additional_services = explode(',', Mage::getStoreConfig('aramexsettings/config/allowed_international_additional_services'));
354
+ $domestic_additional_services = Mage::getModel('aramex/carrier_aramex_source_domesticAdditionalServices')->toOptionArray();
355
+ $international_additional_services = Mage::getModel('aramex/carrier_aramex_source_internationalAdditionalServices')->toOptionArray();
356
+ ?>
357
+
358
+ <?php if(count($allowed_domestic_additional_services)>0){
359
+ $i=1;
360
+ foreach($domestic_additional_services as $key=>$val){
361
+ if(in_array($val['value'],$allowed_domestic_additional_services)){
362
+ /* style="<?php echo ($_group!='DOM')?'display: none':''; ?>" */
363
+ ?>
364
+ <option <?php echo ($_type == $val['value'] and $_group=='DOM') ? 'selected="selected"' : ''; ?> value="<?php echo $val['value'];?>" id="dom_as_<?php echo $val['value'];?>" class="DOM local"><?php echo $val['label']; ?></option>
365
+ <?php $i++;
366
+ }
367
+ }
368
+ } ?>
369
+ <?php if(count($allowed_international_additional_services)>0){
370
+ $i=1;
371
+ foreach($international_additional_services as $key=>$val){
372
+ if(in_array($val['value'],$allowed_international_additional_services)){
373
+ /* style="<?php echo ($_group=='DOM')?'display: none':''; ?>" */
374
+ ?>
375
+ <option <?php echo ($_type == $val['value'] and $_group=='DOM') ? 'selected="selected"' : ''; ?> value="<?php echo $val['value'];?>" id="exp_as_<?php echo $val['value'];?>" class="non-local EXP"><?php echo $val['label']; ?></option>
376
+ <?php $i++;
377
+ }
378
+ }
379
+ } ?>
380
+
381
+
382
+
383
+
384
+ <?php /*<option value="CODS" <?php if($_type == 'ccsave' or $_type=='CODS'){ echo 'selected="selected"'; } ?>>Cash on Delivery</option>
385
  <option value="FIRST" <?php if($_type=='FIRST'){ echo 'selected="selected"'; } ?>>First Delivery</option>
386
  <option value="FRDOM" <?php if($_type=='FRDOM'){ echo 'selected="selected"'; } ?>>Free Domicile</option>
387
  <option value="HFPU" <?php if($_type=='HFPU'){ echo 'selected="selected"'; } ?>>Hold for pick up</option>
388
  <option value="NOON" <?php if($_type=='NOON'){ echo 'selected="selected"'; } ?>>Noon Delivery</option>
389
+ <option value="SIG" <?php if($_type=='SIG'){ echo 'selected="selected"'; } ?>>Signature Required</option>*/?>
390
 
391
  </select>
392
 
424
  <div class="text_short">
425
  <?php $_amount=($_order->getPayment()->getMethodInstance()->getCode() != 'ccsave')?round($_order->getData('grand_total'), 2):'';?>
426
  <?php $_amount=($session)?$formData['aramex_shipment_info_cod_amount']:$_amount;?>
427
+ <?php if(Mage::getStoreConfig('aramexsettings/config/sandbox_flag')==1){
428
+ $_amount ='';
429
+ } ?>
430
+
431
  <label>COD Amount</label><input class="" type="text" id="aramex_shipment_info_cod_amount" name="aramex_shipment_info_cod_amount" value="<?php echo $_amount; ?>"/>
432
  </div>
433
 
553
  }
554
  ?>
555
  <div class="text_short">
556
+ <?php $cod_value = $_order->getData('base_shipping_amount')+$_order->getBaseSubtotal();
557
+
558
+ ?>
559
+
560
+ <label>COD Value</label><input type="text" id="aramex_shipment_info_cod_value" name="aramex_shipment_info_cod_value" style="width: 165px; float: left;" value="<?php echo $cod_value;?>" /><div style="float: left; padding-left: 5px;"><?php echo $_order->getData('base_currency_code'); ?></div>
561
  </div>
562
  <?php } ?>
563
  </div>
626
  <div style="float: right; width: 100%; width: 30px;"><div style="float: right;font-size: 11px;height: 30px;margin-bottom: 6px;width: 184px;"><input style="float: left; width: 30px;" type="checkbox" name="aramex_email_customer" value="yes" /> <span style="float: left; margin-top: -2px;">Notify customer by email</span></div></div>
627
  <div class="aramex_clearer"></div>
628
  <div style="float: right;margin-bottom: 20px;margin-top: -11px;">
629
+ <?php if($_order->canShip()):?>
630
+ <input name="aramex_return_shipment_creation_date" type="hidden" value="create" />
631
+ <button id="aramex_shipment_creation_submit_id" type="submit" name="aramex_shipment_creation_submit" >Create Shipment</button>
632
+ <?php endif; ?>
633
+
634
+ <?php
635
+
636
+ $shipments = Mage::getResourceModel('sales/order_shipment_collection')
637
+ ->addAttributeToSelect('*')
638
+ ->addFieldToFilter("order_id",$_order->getId())->join("sales/shipment_comment",'main_table.entity_id=parent_id','comment')->addFieldToFilter('comment', array('like'=>"%{$_order->getIncrementId()}%"))->load();
639
+
640
+ $aramex_return_button = false;
641
+
642
+ if($shipments->count()){
643
+ foreach($shipments as $key=>$comment){
644
+ if (version_compare(PHP_VERSION, '5.3.0') <= 0) {
645
+ $awbno=substr($comment->getComment(),0, strpos($comment->getComment(),"- Order No"));
646
+ }
647
+ else{
648
+ $awbno=strstr($comment->getComment(),"- Order No",true);
649
+ }
650
+ $awbno=trim($awbno,"AWB No.");
651
+ break;
652
+ }
653
+ if((int) $awbno)
654
+ $aramex_return_button = true;
655
+ }
656
+
657
+ if(!$_order->canShip() && $aramex_return_button){
658
+
659
+ ?>
660
+ <input name="aramex_return_shipment_creation_date" type="hidden" value="return" />
661
+ <button id="aramex_return_shipment_creation_submit_id" type="submit" name="aramex_return_shipment_creation_submit_id">Return Order</button>
662
+ <script>
663
+ var jccc = jQuery.noConflict();
664
+ jccc(function(){
665
+ jccc("#aramex_shipment_info_billing_account_id").val(2);
666
+ jccc("#aramex_shipment_info_billing_account_id").trigger('change');
667
+ });
668
+ </script>
669
+ <?php } ?>
670
+
671
  <button onclick="aramexclose()" type="button">Close</button>
672
  </div>
673
  </form>
674
  </div>
675
  </div>
676
 
677
+ <?php
678
+ $allowed_domestic_methods = explode(',', Mage::getStoreConfig('aramexsettings/config/allowed_domestic_methods'));
679
+ $allowed_international_methods = explode(',', Mage::getStoreConfig('aramexsettings/config/allowed_international_methods'));
680
+
681
+ ?>
682
+
683
  <script src="https://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
684
  <link rel="stylesheet" href="https://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />
685
  <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.min.js"></script>
686
+
687
  <script>
688
  var jccc = jQuery.noConflict();
689
+
690
+ var allowed_domestic_methods = <?php echo json_encode($allowed_domestic_methods); ?>;
691
+ var allowed_international_methods = <?php echo json_encode($allowed_international_methods); ?>;
692
+
693
+ var allowed_domestic_methods_apply = <?php echo json_encode($allowed_domestic_methods_apply); ?>;
694
+ var allowed_international_methods_apply = <?php echo json_encode($allowed_international_methods_apply); ?>;
695
+
696
+
697
  var aramex_shipment_shipper_name = document.getElementById('aramex_shipment_shipper_name').value;
698
  var aramex_shipment_shipper_email = document.getElementById('aramex_shipment_shipper_email').value;
699
  var aramex_shipment_shipper_company = document.getElementById('aramex_shipment_shipper_company').value;
892
  }
893
 
894
  }
895
+
896
+ function aramexreturnpop()
897
+ {
898
+
899
+ jccc("#aramex_overlay").css("display", "block");
900
+ jccc("#aramex_return_shipment_creation_submit_id").css("display", "in-block");
901
+ jccc("#aramex_shipment_info_billing_account_id").val(2);
902
+ jccc("#aramex_shipment_info_billing_account_id").trigger('change');
903
+ jccc("#aramex_shipment_info_payment_type").val("C");
904
+ jccc("#aramex_shipment_creation").fadeIn(1000);
905
+
906
+
907
+ }
908
+
909
+
910
+
911
+
912
 
913
  function aramexclose()
914
  {
1005
  jccc(".aramex_countries").change(function(){
1006
  if(jccc("select[name=aramex_shipment_shipper_country]").val() != jccc("select[name=aramex_shipment_receiver_country]").val()){
1007
  jccc("select[name=aramex_shipment_info_product_group]").val('EXP');
1008
+ jccc("#aramex_shipment_info_product_group").trigger('change');
1009
  jccc("select[name=aramex_shipment_info_additional_services] option:selected").removeAttr("selected");
1010
  jccc("select[name=aramex_shipment_info_additional_services] .express_service").attr("selected", "selected");
1011
 
1012
+
 
 
 
 
 
 
 
 
 
 
 
1013
 
1014
  } else {
1015
  jccc("select[name=aramex_shipment_info_product_group]").val('DOM');
1016
+ jccc("#aramex_shipment_info_product_group").trigger('change');
1017
  jccc("select[name=aramex_shipment_info_additional_services] option:selected").removeAttr("selected");
1018
  jccc("select[name=aramex_shipment_info_additional_services] .domestic_service").attr("selected", "selected");
1019
+
 
 
 
 
 
 
 
 
 
 
 
 
1020
  }
1021
 
1022
  jccc("#aramex_shipment_info_product_group_div").html(jccc("select[name=aramex_shipment_info_product_group] option:selected").text());
1028
 
1029
  });
1030
  jccc("#aramex_shipment_info_product_group").change(function(){
1031
+
1032
  if(jccc("select[name=aramex_shipment_info_product_group]").val()=='EXP'){
1033
  jccc("select[name=aramex_shipment_info_additional_services] option:selected").removeAttr("selected");
1034
  jccc("select[name=aramex_shipment_info_additional_services] .express_service").attr("selected", "selected");
1035
+ jccc("#aramex_shipment_info_product_type option").hide();
1036
+ /*jccc(allowed_international_methods).each(function(index,val){
1037
+ if(index==0){
1038
+ document.getElementById('aramex_shipment_info_product_type').value = val;
1039
+ }
1040
+ document.getElementById(val).style.display = 'block';
1041
+ });*/
1042
+
 
 
 
 
 
1043
 
1044
  }else if(jccc("select[name=aramex_shipment_info_product_group]").val()=='DOM'){
1045
  jccc("select[name=aramex_shipment_info_additional_services] option:selected").removeAttr("selected");
1046
  jccc("select[name=aramex_shipment_info_additional_services] .domestic_service").attr("selected", "selected");
1047
+ jccc("#aramex_shipment_info_product_type option").hide();
1048
+ /*jccc(allowed_domestic_methods).each(function(index,val){
1049
+ if(index==0){
1050
+ document.getElementById('aramex_shipment_info_product_type').value = val;
1051
+ }
1052
+ document.getElementById(val).style.display = 'block';
1053
+ });*/
 
 
 
 
 
 
1054
 
1055
  }
1056
  jccc("#aramex_shipment_info_service_type_div").html(jccc("select[name=aramex_shipment_info_service_type] option:selected").text());
1089
  jccc("#aramex_shipment").validate();
1090
 
1091
  });
1092
+
1093
+ jQuery("#aramex_shipment_info_product_type").chained("#aramex_shipment_info_product_group");
1094
+ jQuery("#aramex_shipment_info_service_type").chained("#aramex_shipment_info_product_group");
1095
 
1096
  </script>
1097
  <?php $formSession->unsetData('form_data')?>
app/etc/modules/Aramex_Shipping.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" ?>
2
+ <config>
3
+ <modules>
4
+ <Aramex_Shipping>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Aramex_Shipping>
8
+ </modules>
9
+ </config>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Aramex_Shipping_Tracking_API</name>
4
- <version>2.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL-3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Aramex Shipping Extension for magento</summary>
10
  <description>Aramex Shipping Extension for magento</description>
11
- <notes>version 2.0.1</notes>
12
  <authors><author><name>Aramex</name><user>aramexdev</user><email>portalsthirdparty@aramex.com</email></author></authors>
13
- <date>2014-02-12</date>
14
- <time>09:25:43</time>
15
- <contents><target name="magecommunity"><dir name="Aramex"><dir name="Adminhtml"><dir name="controllers"><dir name="Sales"><file name="OrderController.php" hash="d897c576f9b082f60b85e62770586145"/></dir></dir><dir name="etc"><file name="config.xml" hash="8551ea941ec563a3d87f7db474f2eeb5"/></dir></dir><dir name="Core"><dir name="Helper"><file name="Data.php" hash="2c2bd86a7476d7e9838f4422d799c35b"/></dir><dir name="etc"><file name="config.xml" hash="45ba7c64f7e1ca2fb637c540e5c3b0a4"/><file name="system.xml" hash="fa61f2f2cc8bd1729dd671c2b5839322"/></dir></dir><dir name="Shipment"><dir name="Block"><dir name="Sales"><dir name="Order"><file name="View.php" hash="923a4bc9e8e53c912b894f9f30a9d24b"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="169ce609224658e762e5c07df2de8342"/></dir><dir name="Model"><dir name="Carrier"><dir name="Aramex"><dir name="Source"><file name="Dropoff.php" hash="e707cd809c802f3efb698d0e36721e05"/><file name="Freemethod.php" hash="6579a3c5c0cbf8828c2752b6e0d108ee"/><file name="Method.php" hash="db122d66069148186f5c224dd943d059"/><file name="Packaging.php" hash="50e551b6e52a190f47f969ae70dc7b22"/></dir></dir><file name="Aramex.php" hash="2d4847f66a4fb7a3232d520e9a978d12"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="e3a6cdad35fe8d49fec3ad36d0c5f5cf"/><file name="RateController.php" hash="ed30e5328fb6bc5d34a7ccd44ee295ae"/><file name="SchedulepickupController.php" hash="2788b9013887295bcc9cb84799440057"/><file name="ShipmentController.php" hash="33c6b8cc1781d2a47a33a78eeb100223"/></dir><dir name="etc"><file name="config.xml" hash="227cffe70c4cc075c8e10da17861662b"/><dir name="wsdl"><dir name="Aramex"><file name="Tracking.wsdl" hash="d0a3decaa902f3f2b6d463c790071da8"/><file name="aramex-rates-calculator-wsdl.wsdl" hash="efd091f022ea4b28fc41eae0b156f9fc"/><file name="shipping.wsdl" hash="3d13e21363413243d5c70f171ef9b121"/></dir></dir></dir></dir><dir name="Shipping"><dir name="Model"><dir name="Carrier"><dir name="Aramex"><dir name="Source"><file name="Dropoff.php" hash="e707cd809c802f3efb698d0e36721e05"/><file name="Freemethod.php" hash="6579a3c5c0cbf8828c2752b6e0d108ee"/><file name="Method.php" hash="db122d66069148186f5c224dd943d059"/><file name="Packaging.php" hash="50e551b6e52a190f47f969ae70dc7b22"/></dir></dir><file name="Aramex.php" hash="b02eed98ea8f8660bd79c9a96cbd7885"/></dir></dir><dir name="etc"><file name="config.xml" hash="987cf2182f827cebe8865c14b21b922e"/><file name="system.xml" hash="35b6412240e0cd6e2f5fecf6eaf05cc0"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="aramex"><file name="calculate_rate.phtml" hash="94ae86d7e8580bf848f5cbe3887d400a"/><file name="print_label.phtml" hash="61de8abf8aa383cbdc7f7b64a8be4ae2"/><dir name="sales"><dir name="order"><dir name="comments"><file name="view.phtml" hash="7e2e3243c12ef7fafead569c5918d130"/></dir><dir name="view"><dir name="tab"><file name="history.phtml" hash="35e4f4f8ab3d7c00993f8c3ccd5a81f2"/></dir></dir></dir></dir><file name="schedule_puckup.phtml" hash="9b1fb85b928bcbb97673a1c9257a1fae"/><file name="shipment.phtml" hash="5e5f4b5fb5559cb91d5e9f4f39bdfa17"/></dir></dir><dir name="layout"><file name="aramex.xml" hash="49460aae3f0f7d7d470dfafe0c104f94"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Aramex_Adminhtml.xml" hash="d7d6bae0800edb5ad632ffb9a73ee78d"/><file name="Aramex_Core.xml" hash="f3ef092ca056636b4d6bedad36dabaf7"/><file name="Aramex_Shipment.xml" hash="44273c772ecb4ad2ceade7e5f0e49775"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="aramex"><dir name="css"><file name="aramex.css" hash="e44b92da4fe65b7a8eec5635d792cdfe"/></dir><dir name="js"><file name="common.js" hash="8e744a69845908527041314cc75b8ff1"/><file name="jquery.min.js" hash="b8d64d0bc142b3f670cc0611b0aebcae"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="aramex"><file name="shipment_email.html" hash="3f3e4e5e8220437debb8e65c1f8c1738"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
- <dependencies><required><php><min>5.0.1</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6</min><max>1.8.1</max></package></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Aramex_Shipping_Tracking_API</name>
4
+ <version>2.2.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL-3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Aramex Shipping Extension for magento</summary>
10
  <description>Aramex Shipping Extension for magento</description>
11
+ <notes>version 2.2.0</notes>
12
  <authors><author><name>Aramex</name><user>aramexdev</user><email>portalsthirdparty@aramex.com</email></author></authors>
13
+ <date>2015-01-13</date>
14
+ <time>13:50:00</time>
15
+ <contents><target name="magecommunity"><dir name="Aramex"><dir name="Adminhtml"><dir name="controllers"><dir name="Sales"><file name="OrderController.php" hash="d897c576f9b082f60b85e62770586145"/></dir></dir><dir name="etc"><file name="config.xml" hash="8551ea941ec563a3d87f7db474f2eeb5"/></dir></dir><dir name="Core"><dir name="Helper"><file name="Data.php" hash="2c2bd86a7476d7e9838f4422d799c35b"/></dir><dir name="etc"><file name="config.xml" hash="893dea3637ed0ce22ee38660c00af026"/><file name="system.xml" hash="8d91f41001f602f80fcde6f4e56738a7"/></dir></dir><dir name="Shipment"><dir name="Block"><dir name="Sales"><dir name="Order"><file name="View.php" hash="fda4be47117994afe0f9685078472caf"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="ed47bb30135509cc1a4eeb63a1c8ad7a"/></dir><dir name="Model"><dir name="Carrier"><dir name="Aramex"><dir name="Source"><file name="Dropoff.php" hash="e707cd809c802f3efb698d0e36721e05"/><file name="Freemethod.php" hash="6579a3c5c0cbf8828c2752b6e0d108ee"/><file name="Method.php" hash="db122d66069148186f5c224dd943d059"/><file name="Packaging.php" hash="50e551b6e52a190f47f969ae70dc7b22"/></dir></dir><file name="Aramex.php" hash="2d4847f66a4fb7a3232d520e9a978d12"/></dir></dir><dir name="controllers"><file name="IndexController.php" hash="747eb49703ece87e7cf49c42e6158ee6"/><file name="RateController.php" hash="ed30e5328fb6bc5d34a7ccd44ee295ae"/><file name="SchedulepickupController.php" hash="2788b9013887295bcc9cb84799440057"/><file name="ShipmentController.php" hash="8e42c4bec7c68741ef55b0e266ee3d58"/></dir><dir name="etc"><file name="config.xml" hash="42761915ca55f4cce1382f6b0194fc9c"/><dir name="wsdl"><dir name="Aramex"><dir name="TestMode"><file name="Tracking.wsdl" hash="79884498a3573637cebf8f9a19827674"/><file name="aramex-rates-calculator-wsdl.wsdl" hash="0b4810f2532999e6291d2855ca53ba46"/><file name="shipping.wsdl" hash="e9c65658c7116f232d35cdb809028cbd"/></dir><file name="Tracking.wsdl" hash="d0a3decaa902f3f2b6d463c790071da8"/><file name="aramex-rates-calculator-wsdl.wsdl" hash="efd091f022ea4b28fc41eae0b156f9fc"/><file name="shipping.wsdl" hash="3d13e21363413243d5c70f171ef9b121"/></dir></dir></dir></dir><dir name="Shipping"><dir name="Model"><dir name="Carrier"><dir name="Aramex"><dir name="Source"><file name="DomesticAdditionalServices.php" hash="b12f578fe97373c7a18b7b4153dd8993"/><file name="Domesticmethods.php" hash="74831b0e47dcfbd92a57491e0cb0c085"/><file name="Dropoff.php" hash="e707cd809c802f3efb698d0e36721e05"/><file name="Freemethod.php" hash="6579a3c5c0cbf8828c2752b6e0d108ee"/><file name="InternationalAdditionalServices.php" hash="fcab6a57453422a5d22167896ea1583e"/><file name="Internationalmethods.php" hash="48a1aa4e7c58186d079abc0ca5210214"/><file name="Method.php" hash="db122d66069148186f5c224dd943d059"/><file name="Packaging.php" hash="50e551b6e52a190f47f969ae70dc7b22"/><file name="Productgroup.php" hash="8c44dd4b72cb948a69017d05260888b9"/></dir></dir><file name="Aramex.php" hash="a5d5fc38a64b1d8f8e377d359aa482d1"/></dir></dir><dir name="etc"><file name="config.xml" hash="71983af1f8884ac2e4452c9a58c7f615"/><file name="system.xml" hash="c824159c7a7d781f997fc4aff3c35367"/></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="aramex"><file name="calculate_rate.phtml" hash="72b6c016045313b5bfdbff1a5655d840"/><file name="print_label.phtml" hash="61de8abf8aa383cbdc7f7b64a8be4ae2"/><dir name="sales"><dir name="order"><dir name="comments"><file name="view.phtml" hash="7e2e3243c12ef7fafead569c5918d130"/></dir><dir name="view"><dir name="tab"><file name="history.phtml" hash="35e4f4f8ab3d7c00993f8c3ccd5a81f2"/></dir></dir></dir></dir><file name="schedule_puckup.phtml" hash="0a4b0168b07042025ff5f09f774e5af1"/><file name="shipment.phtml" hash="93d52d7dd2288b5d13418de07e2e8bac"/></dir></dir><dir name="layout"><file name="aramex.xml" hash="baf1b39ba619485ef2bb959c3f60dd9a"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Aramex_Adminhtml.xml" hash="d7d6bae0800edb5ad632ffb9a73ee78d"/><file name="Aramex_Core.xml" hash="f3ef092ca056636b4d6bedad36dabaf7"/><file name="Aramex_Shipment.xml" hash="44273c772ecb4ad2ceade7e5f0e49775"/><file name="Aramex_Shipping.xml" hash="3636df7cc68825f88744d0e6c2d99057"/></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="aramex"><dir name="css"><file name="aramex.css" hash="e44b92da4fe65b7a8eec5635d792cdfe"/></dir><dir name="js"><file name="common.js" hash="8e744a69845908527041314cc75b8ff1"/><file name="jquery.chained.js" hash="6bf10903bbc296b1ce09743ed402ae83"/><file name="jquery.min.js" hash="b8d64d0bc142b3f670cc0611b0aebcae"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><dir name="template"><dir name="email"><dir name="aramex"><file name="shipment_email.html" hash="3f3e4e5e8220437debb8e65c1f8c1738"/></dir></dir></dir></dir></target></contents>
16
  <compatible/>
17
+ <dependencies><required><php><min>5.0.1</min><max>6.0.0</max></php></required></dependencies>
18
  </package>
skin/adminhtml/default/default/aramex/js/jquery.chained.js ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * Chained - jQuery / Zepto chained selects plugin
3
+ *
4
+ * Copyright (c) 2010-2014 Mika Tuupola
5
+ *
6
+ * Licensed under the MIT license:
7
+ * http://www.opensource.org/licenses/mit-license.php
8
+ *
9
+ * Project home:
10
+ * http://www.appelsiini.net/projects/chained
11
+ *
12
+ * Version: 0.9.10
13
+ *
14
+ */
15
+
16
+ ;(function($, window, document, undefined) {
17
+ "use strict";
18
+
19
+ $.fn.chained = function(parent_selector, options) {
20
+
21
+ return this.each(function() {
22
+
23
+ /* Save this to child because this changes when scope changes. */
24
+ var child = this;
25
+ var backup = $(child).clone();
26
+
27
+ /* Handles maximum two parents now. */
28
+ $(parent_selector).each(function() {
29
+ $(this).bind("change", function() {
30
+ updateChildren();
31
+ });
32
+
33
+ /* Force IE to see something selected on first page load, */
34
+ /* unless something is already selected */
35
+ if (!$("option:selected", this).length) {
36
+ $("option", this).first().attr("selected", "selected");
37
+ }
38
+
39
+ /* Force updating the children. */
40
+ updateChildren();
41
+ });
42
+
43
+ function updateChildren() {
44
+ var trigger_change = true;
45
+ var currently_selected_value = $("option:selected", child).val();
46
+
47
+ $(child).html(backup.html());
48
+
49
+ /* If multiple parents build classname like foo\bar. */
50
+ var selected = "";
51
+ $(parent_selector).each(function() {
52
+ var selectedClass = $("option:selected", this).val();
53
+ if (selectedClass) {
54
+ if (selected.length > 0) {
55
+ if (window.Zepto) {
56
+ /* Zepto class regexp dies with classes like foo\bar. */
57
+ selected += "\\\\";
58
+ } else {
59
+ selected += "\\";
60
+ }
61
+ }
62
+ selected += selectedClass;
63
+ }
64
+ });
65
+
66
+ /* Also check for first parent without subclassing. */
67
+ /* TODO: This should be dynamic and check for each parent */
68
+ /* without subclassing. */
69
+ var first;
70
+ if ($.isArray(parent_selector)) {
71
+ first = $(parent_selector[0]).first();
72
+ } else {
73
+ first = $(parent_selector).first();
74
+ }
75
+ var selected_first = $("option:selected", first).val();
76
+
77
+ $("option", child).each(function() {
78
+ /* Remove unneeded items but save the default value. */
79
+ if ($(this).hasClass(selected) && $(this).val() === currently_selected_value) {
80
+ $(this).prop("selected", true);
81
+ trigger_change = false;
82
+ } else if (!$(this).hasClass(selected) && !$(this).hasClass(selected_first) && $(this).val() !== "") {
83
+ $(this).remove();
84
+ }
85
+ });
86
+
87
+ /* If we have only the default value disable select. */
88
+ if (1 === $("option", child).size() && $(child).val() === "") {
89
+ $(child).prop("disabled", true);
90
+ } else {
91
+ $(child).prop("disabled", false);
92
+ }
93
+ if (trigger_change) {
94
+ $(child).trigger("change");
95
+ }
96
+ }
97
+ });
98
+ };
99
+
100
+ /* Alias for those who like to use more English like syntax. */
101
+ $.fn.chainedTo = $.fn.chained;
102
+
103
+ /* Default settings for plugin. */
104
+ $.fn.chained.defaults = {};
105
+
106
+ })(window.jQuery || window.Zepto, window, document);