Rvtech_Starshipit - Version 1.6.5.0

Version Notes

- Updated rates at checkout API for all carriers
- Added support for recent PHP releases

Download this release

Release Info

Developer George Plummer
Extension Rvtech_Starshipit
Version 1.6.5.0
Comparing to
See all releases


Code changes from version 1.6.4.0 to 1.6.5.0

app/code/community/Rvtech/Starshipit/Model/Carrier/Auspost.php CHANGED
@@ -1,113 +1,181 @@
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Auspost extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
- protected $_code = 'auspost';
5
 
6
- public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
- {
8
- if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
- return false;
10
- }
11
- $price = 0;
12
- $doCalulate = $this->getConfigData('calculate');
13
- if ($doCalulate==0)
14
- {
15
- $price = $this->getConfigData('price');
16
- }
17
- else{
18
- $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
19
- $destCountryId = $request->getDestCountryId();
20
- $destCountry = $request->getDestCountry();
21
- $destRegion = $request->getDestRegionId();
22
- $destRegionCode = $request->getDestRegionCode();
23
- $destStreet = $request->getDestStreet();
24
- $destCity = $request->getDestCity();
25
- $destPostcode = $request->getDestPostcode();
26
- $packageWeight = $request->getPackageWeight();
27
- $packageheight = $request->getPackageHeight();
28
- $packagewidth = $request->getPackageWidth();
29
- $packagedepth = $request->getPackageDepth();
30
-
31
- $params = array(
32
- "apiKey" => $shipItApiKey,
33
- "carrierid"=>10,
34
- "street"=>$destStreet,
35
- "suburb"=>"",
36
- "city"=> $destCity,
37
- "postcode"=>$destPostcode,
38
- "state"=>$destRegion,
39
- "country"=>$destCountry,
40
- "countryId"=>$destCountryId,
41
- "weight"=>$packageWeight,
42
- "height"=>$packageheight,
43
- "width"=>$packagewidth,
44
- "depth"=>$packagedepth
45
- );
46
- try
47
- {
48
- // Call web service.
49
- $wsdl = 'https://app.shipit.click/shipment.svc?WSDL';
50
- $client = new SoapClient($wsdl, array(
51
- 'cache_wsdl' => WSDL_CACHE_NONE,
52
- 'cache_ttl' => 86400,
53
- 'trace' => true,
54
- 'exceptions' => true,
55
- ));
56
-
57
- $result = $client->__soapCall("GetQuote", array($params));
58
- $quoteResponse = $result->GetQuoteResult;
59
-
60
- $price = $quoteResponse->Price;
61
- }
62
- catch (Exception $e)
63
- {
64
- Mage::log($e->getMessage(), null, ShipIt.log);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  }
 
66
  }
67
-
68
- $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
69
- $result = Mage::getModel('shipping/rate_result');
70
- $show = true;
71
- if($show){
72
-
73
- $method = Mage::getModel('shipping/rate_result_method');
74
- $method->setCarrier($this->_code);
75
- $method->setMethod($this->_code);
76
- $method->setCarrierTitle($this->getConfigData('title'));
77
- $method->setMethodTitle($this->getConfigData('name'));
78
- $method->setPrice($price);
79
- $method->setCost($price);
80
- $result->append($method);
81
-
82
- }else{
83
- $error = Mage::getModel('shipping/rate_result_error');
84
- $error->setCarrier($this->_code);
85
- $error->setCarrierTitle($this->getConfigData('name'));
86
- $error->setErrorMessage($this->getConfigData('specificerrmsg'));
87
- $result->append($error);
88
- }
89
- return $result;
90
- }
91
- public function getAllowedMethods()
92
- {
93
- return array('auspost'=>$this->getConfigData('name'));
94
- }
95
 
96
- public function isTrackingAvailable()
97
- {
98
- return true;
99
- }
 
 
100
 
101
- public function getTrackingInfo($tracking)
102
- {
103
- //Mage::log("Get Tracking", null, ShipIt.log);
104
- $status = Mage::getModel('shipping/tracking_result_status');
105
- $status->setCarrier($this->_code);
106
- $status->setCarrierTitle($this->getConfigData('title'));
107
- $status->setTracking($tracking);
108
- $status->setPopup(1);
109
- $status->setUrl("http://auspost.com.au/track/track.html?id=".$tracking);
110
- //Mage::log("Get Tracking asd", null, ShipIt.log);
111
- return $status;
112
- }
 
113
  }
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Auspost extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
+ protected $_code = 'auspost';
5
 
6
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
+ {
8
+ if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
+ return false;
10
+ }
11
+
12
+ $show = false;
13
+ $price = 0;
14
+ $doCalulate = $this->getConfigData('calculate');
15
+ if ($doCalulate==0) {
16
+ $show = true;
17
+ $price = $this->getConfigData('price');
18
+
19
+ $result = Mage::getModel('shipping/rate_result');
20
+ $method = Mage::getModel('shipping/rate_result_method');
21
+ $method->setCarrier($this->_code);
22
+ $method->setMethod($this->_code);
23
+ $method->setCarrierTitle($this->getConfigData('title'));
24
+ $method->setMethodTitle($this->getConfigData('name'));
25
+ $method->setPrice($price);
26
+ $method->setCost($price);
27
+ $result->append($method);
28
+ }
29
+ else {
30
+ try {
31
+ $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
32
+ if ($shipItApiKey == "") {
33
+ return false;
34
+ }
35
+
36
+ $origCountryId = $request->getCountryId(); //Package Source Country ID
37
+ $origRegionId = $request->getRegionId(); //Package Source Region ID
38
+ $origRegionCode = $request->getRegion(); //Package Source Region Code
39
+ $origCity = $request->getCity(); //Package Source City
40
+ $origPostcode = $request->getPostcode(); //Package Source Post Code
41
+
42
+ $destCountryId = $request->getDestCountryId();
43
+ $destCountry = $request->getDestCountry();
44
+ $destRegion = $request->getDestRegionId();
45
+ $destRegionCode = $request->getDestRegionCode();
46
+ $destFullStreet = $request->getDestStreet();
47
+ $destStreet = "";
48
+ $destSuburb = "";
49
+ $destCity = $request->getDestCity();
50
+ $destPostcode = $request->getDestPostcode();
51
+
52
+ $destFullStreetArray = explode("\n", $destFullStreet);
53
+ if ($destFullStreetArray[0] !== false)
54
+ $destStreet = $destFullStreetArray[0];
55
+ if ($destFullStreetArray[1] !== false)
56
+ $destSuburb = $destFullStreetArray[1];
57
+
58
+ $packageValue = $request->getPackageValue(); //Dest Package Value
59
+ $packageValueDiscout = $request->getPackageValueWithDiscount(); //Dest Package Value After Discount
60
+ $packageWeight = $request->getPackageWeight() * 1000; //Package Weight (grams)
61
+ $packageCurrency = $request->getPackageCurrency();
62
+
63
+ $url = 'https://api.shipit.click/rate?apiKey=' . $shipItApiKey . '&integration=magento&format=json';
64
+ $post_data = '{
65
+ "rate": {
66
+ "origin": {
67
+ "country": "' . $origCountryId . '",
68
+ "postal_code": "' . $origPostcode . '",
69
+ "province": "' . $origRegionCode . '",
70
+ "city": "' . $origCity . '",
71
+ "name": null,
72
+ "address1": null,
73
+ "address2": null,
74
+ "address3": null,
75
+ "phone": null,
76
+ "fax": null,
77
+ "address_type": null,
78
+ "company_name": null
79
+ },
80
+ "destination":{
81
+ "country": "' . $destCountryId . '",
82
+ "postal_code": "' . $destPostcode . '",
83
+ "province": "' . $destRegionCode . '",
84
+ "city": "' . $destCity . '",
85
+ "name": null,
86
+ "address1": "' . $destStreet . '",
87
+ "address2": "' . $destSuburb . '",
88
+ "address3": null,
89
+ "phone": null,
90
+ "fax": null,
91
+ "address_type": null,
92
+ "company_name": null
93
+ },
94
+ "items":[
95
+ {
96
+ "name": "Total Items",
97
+ "sku": null,
98
+ "quantity": 1,
99
+ "grams": ' . $packageWeight . ' ,
100
+ "price": ' . $packageValue . ',
101
+ "vendor": null,
102
+ "requires_shipping": true,
103
+ "taxable": true,
104
+ "fulfillment_service": "manual"
105
+ }
106
+ ],
107
+ "currency": "' . $packageCurrency->getCurrencyCode() . '",
108
+ "carrierid": "10"
109
+ }
110
+ }';
111
+ $contentLength = strlen($post_data);
112
+
113
+ $ch = curl_init();
114
+ curl_setopt($ch, CURLOPT_URL, $url);
115
+ curl_setopt($ch, CURLOPT_HEADER, false);
116
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
117
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
118
+ curl_setopt($ch, CURLOPT_POST, true);
119
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
120
+ $response = curl_exec($ch);
121
+ curl_close($ch);
122
+
123
+ $json_obj = json_decode($response);
124
+ $rates_obj = $json_obj->{'rates'};
125
+
126
+ $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
127
+ $result = Mage::getModel('shipping/rate_result');
128
+
129
+ if (sizeof($rates_obj) > 0) {
130
+ $show = true;
131
+ }
132
+
133
+ if ($show) {
134
+ foreach ($rates_obj as $rate) {
135
+ if (is_object($rate)) {
136
+ // Add shipping option with shipping price
137
+ $method = Mage::getModel('shipping/rate_result_method');
138
+ $method->setCarrier($this->_code);
139
+ $method->setMethod($this->_code . $rate->{'service_code'});
140
+ $method->setCarrierTitle($this->getConfigData('title'));
141
+ $method->setMethodTitle($rate->{'service_name'});
142
+ $method->setPrice($rate->{'total_price'});
143
+ $method->setCost(0);
144
+ $result->append($method);
145
  }
146
+ }
147
  }
148
+ else {
149
+ $error = Mage::getModel('shipping/rate_result_error');
150
+ $error->setCarrier($this->_code);
151
+ $error->setCarrierTitle($this->getConfigData('name'));
152
+ $error->setErrorMessage($this->getConfigData('specificerrmsg'));
153
+ $result->append($error);
154
+ }
155
+ }
156
+ catch (Exception $e) {
157
+ Mage::log($e->getMessage());
158
+ }
159
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
 
161
+ return $result;
162
+ }
163
+
164
+ public function getAllowedMethods() {
165
+ return array('auspost'=>$this->getConfigData('name'));
166
+ }
167
 
168
+ public function isTrackingAvailable() {
169
+ return true;
170
+ }
171
+
172
+ public function getTrackingInfo($tracking) {
173
+ $status = Mage::getModel('shipping/tracking_result_status');
174
+ $status->setCarrier($this->_code);
175
+ $status->setCarrierTitle($this->getConfigData('title'));
176
+ $status->setTracking($tracking);
177
+ $status->setPopup(1);
178
+ $status->setUrl("http://auspost.com.au/track/track.html?id=".$tracking);
179
+ return $status;
180
+ }
181
  }
app/code/community/Rvtech/Starshipit/Model/Carrier/Courierpost.php CHANGED
@@ -1,111 +1,181 @@
1
  <?php
2
- class Rvtech_Starshipit_Model_Carrier_CourierPost extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
- protected $_code = 'courierpost';
5
 
6
- public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
- {
8
- if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
- return false;
10
- }
11
-
12
- $price = 0;
13
- $doCalulate = $this->getConfigData('calculate');
14
- if ($doCalulate==0)
15
- {
16
- $price = $this->getConfigData('price');
17
- }
18
- else{
19
- $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
20
- $destCountryId = $request->getDestCountryId();
21
- $destCountry = $request->getDestCountry();
22
- $destRegion = $request->getDestRegionId();
23
- $destRegionCode = $request->getDestRegionCode();
24
- $destStreet = $request->getDestStreet();
25
- $destCity = $request->getDestCity();
26
- $destPostcode = $request->getDestPostcode();
27
- $packageWeight = $request->getPackageWeight();
28
- $packageheight = $request->getPackageHeight();
29
- $packagewidth = $request->getPackageWidth();
30
- $packagedepth = $request->getPackageDepth();
31
-
32
- $params = array(
33
- "apiKey" => $shipItApiKey,
34
- "carrierid"=>0,
35
- "street"=>$destStreet,
36
- "suburb"=>"",
37
- "city"=> $destCity,
38
- "postcode"=>$destPostcode,
39
- "state"=>$destRegion,
40
- "country"=>$destCountry,
41
- "countryId"=>$destCountryId,
42
- "weight"=>$packageWeight,
43
- "height"=>$packageheight,
44
- "width"=>$packagewidth,
45
- "depth"=>$packagedepth
46
- );
47
- try{
48
- // Call web service.
49
- $wsdl = 'https://app.shipit.click/shipment.svc?WSDL';
50
- $client = new SoapClient($wsdl, array(
51
- 'cache_wsdl' => WSDL_CACHE_NONE,
52
- 'cache_ttl' => 86400,
53
- 'trace' => true,
54
- 'exceptions' => true,
55
- ));
56
-
57
- $result = $client->__soapCall("GetQuote", array($params));
58
- $quoteResponse = $result->GetQuoteResult;
59
- //Mage::log("Price web:".$quoteResponse->Price, null, ShipIt.log);
60
- $price = $quoteResponse->Price;
61
- }
62
- catch (Exception $e)
63
- {
64
- Mage::log($e->getMessage(), null, ShipIt.log);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  }
 
66
  }
67
-
68
- $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
69
- $result = Mage::getModel('shipping/rate_result');
70
- $show = true;
71
- if($show){
72
-
73
- $method = Mage::getModel('shipping/rate_result_method');
74
- $method->setCarrier($this->_code);
75
- $method->setMethod($this->_code);
76
- $method->setCarrierTitle($this->getConfigData('title'));
77
- $method->setMethodTitle($this->getConfigData('name'));
78
- $method->setPrice($price);
79
- $method->setCost($price);
80
- $result->append($method);
81
-
82
- }else{
83
- $error = Mage::getModel('shipping/rate_result_error');
84
- $error->setCarrier($this->_code);
85
- $error->setCarrierTitle($this->getConfigData('name'));
86
- $error->setErrorMessage($this->getConfigData('specificerrmsg'));
87
- $result->append($error);
88
- }
89
- return $result;
90
- }
91
- public function getAllowedMethods()
92
- {
93
- return array('courierpost'=>$this->getConfigData('name'));
94
- }
95
 
96
- public function isTrackingAvailable()
97
- {
98
- return true;
99
- }
 
 
100
 
101
- public function getTrackingInfo($tracking)
102
- {
103
- $status = Mage::getModel('shipping/tracking_result_status');
104
- $status->setCarrier($this->_code);
105
- $status->setCarrierTitle($this->getConfigData('title'));
106
- $status->setTracking($tracking);
107
- $status->setPopup(1);
108
- $status->setUrl("https://www.nzpost.co.nz/tools/tracking/item/".$tracking);
109
- return $status;
110
- }
 
 
 
111
  }
1
  <?php
2
+ class Rvtech_Starshipit_Model_Carrier_Courierpost extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
+ protected $_code = 'courierpost';
5
 
6
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
+ {
8
+ if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
+ return false;
10
+ }
11
+
12
+ $show = false;
13
+ $price = 0;
14
+ $doCalulate = $this->getConfigData('calculate');
15
+ if ($doCalulate==0) {
16
+ $show = true;
17
+ $price = $this->getConfigData('price');
18
+
19
+ $result = Mage::getModel('shipping/rate_result');
20
+ $method = Mage::getModel('shipping/rate_result_method');
21
+ $method->setCarrier($this->_code);
22
+ $method->setMethod($this->_code);
23
+ $method->setCarrierTitle($this->getConfigData('title'));
24
+ $method->setMethodTitle($this->getConfigData('name'));
25
+ $method->setPrice($price);
26
+ $method->setCost($price);
27
+ $result->append($method);
28
+ }
29
+ else {
30
+ try {
31
+ $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
32
+ if ($shipItApiKey == "") {
33
+ return false;
34
+ }
35
+
36
+ $origCountryId = $request->getCountryId(); //Package Source Country ID
37
+ $origRegionId = $request->getRegionId(); //Package Source Region ID
38
+ $origRegionCode = $request->getRegion(); //Package Source Region Code
39
+ $origCity = $request->getCity(); //Package Source City
40
+ $origPostcode = $request->getPostcode(); //Package Source Post Code
41
+
42
+ $destCountryId = $request->getDestCountryId();
43
+ $destCountry = $request->getDestCountry();
44
+ $destRegion = $request->getDestRegionId();
45
+ $destRegionCode = $request->getDestRegionCode();
46
+ $destFullStreet = $request->getDestStreet();
47
+ $destStreet = "";
48
+ $destSuburb = "";
49
+ $destCity = $request->getDestCity();
50
+ $destPostcode = $request->getDestPostcode();
51
+
52
+ $destFullStreetArray = explode("\n", $destFullStreet);
53
+ if ($destFullStreetArray[0] !== false)
54
+ $destStreet = $destFullStreetArray[0];
55
+ if ($destFullStreetArray[1] !== false)
56
+ $destSuburb = $destFullStreetArray[1];
57
+
58
+ $packageValue = $request->getPackageValue(); //Dest Package Value
59
+ $packageValueDiscout = $request->getPackageValueWithDiscount(); //Dest Package Value After Discount
60
+ $packageWeight = $request->getPackageWeight() * 1000; //Package Weight (grams)
61
+ $packageCurrency = $request->getPackageCurrency();
62
+
63
+ $url = 'https://api.shipit.click/rate?apiKey=' . $shipItApiKey . '&integration=magento&format=json';
64
+ $post_data = '{
65
+ "rate": {
66
+ "origin": {
67
+ "country": "' . $origCountryId . '",
68
+ "postal_code": "' . $origPostcode . '",
69
+ "province": "' . $origRegionCode . '",
70
+ "city": "' . $origCity . '",
71
+ "name": null,
72
+ "address1": null,
73
+ "address2": null,
74
+ "address3": null,
75
+ "phone": null,
76
+ "fax": null,
77
+ "address_type": null,
78
+ "company_name": null
79
+ },
80
+ "destination":{
81
+ "country": "' . $destCountryId . '",
82
+ "postal_code": "' . $destPostcode . '",
83
+ "province": "' . $destRegionCode . '",
84
+ "city": "' . $destCity . '",
85
+ "name": null,
86
+ "address1": "' . $destStreet . '",
87
+ "address2": "' . $destSuburb . '",
88
+ "address3": null,
89
+ "phone": null,
90
+ "fax": null,
91
+ "address_type": null,
92
+ "company_name": null
93
+ },
94
+ "items":[
95
+ {
96
+ "name": "Total Items",
97
+ "sku": null,
98
+ "quantity": 1,
99
+ "grams": ' . $packageWeight . ' ,
100
+ "price": ' . $packageValue . ',
101
+ "vendor": null,
102
+ "requires_shipping": true,
103
+ "taxable": true,
104
+ "fulfillment_service": "manual"
105
+ }
106
+ ],
107
+ "currency": "' . $packageCurrency->getCurrencyCode() . '",
108
+ "carrierid": "0"
109
+ }
110
+ }';
111
+ $contentLength = strlen($post_data);
112
+
113
+ $ch = curl_init();
114
+ curl_setopt($ch, CURLOPT_URL, $url);
115
+ curl_setopt($ch, CURLOPT_HEADER, false);
116
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
117
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
118
+ curl_setopt($ch, CURLOPT_POST, true);
119
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
120
+ $response = curl_exec($ch);
121
+ curl_close($ch);
122
+
123
+ $json_obj = json_decode($response);
124
+ $rates_obj = $json_obj->{'rates'};
125
+
126
+ $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
127
+ $result = Mage::getModel('shipping/rate_result');
128
+
129
+ if (sizeof($rates_obj) > 0) {
130
+ $show = true;
131
+ }
132
+
133
+ if ($show) {
134
+ foreach ($rates_obj as $rate) {
135
+ if (is_object($rate)) {
136
+ // Add shipping option with shipping price
137
+ $method = Mage::getModel('shipping/rate_result_method');
138
+ $method->setCarrier($this->_code);
139
+ $method->setMethod($this->_code . $rate->{'service_code'});
140
+ $method->setCarrierTitle($this->getConfigData('title'));
141
+ $method->setMethodTitle($rate->{'service_name'});
142
+ $method->setPrice($rate->{'total_price'});
143
+ $method->setCost(0);
144
+ $result->append($method);
145
  }
146
+ }
147
  }
148
+ else {
149
+ $error = Mage::getModel('shipping/rate_result_error');
150
+ $error->setCarrier($this->_code);
151
+ $error->setCarrierTitle($this->getConfigData('name'));
152
+ $error->setErrorMessage($this->getConfigData('specificerrmsg'));
153
+ $result->append($error);
154
+ }
155
+ }
156
+ catch (Exception $e) {
157
+ Mage::log($e->getMessage());
158
+ }
159
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
 
161
+ return $result;
162
+ }
163
+
164
+ public function getAllowedMethods() {
165
+ return array('courierpost'=>$this->getConfigData('name'));
166
+ }
167
 
168
+ public function isTrackingAvailable() {
169
+ return true;
170
+ }
171
+
172
+ public function getTrackingInfo($tracking) {
173
+ $status = Mage::getModel('shipping/tracking_result_status');
174
+ $status->setCarrier($this->_code);
175
+ $status->setCarrierTitle($this->getConfigData('title'));
176
+ $status->setTracking($tracking);
177
+ $status->setPopup(1);
178
+ $status->setUrl("https://www.nzpost.co.nz/tools/tracking/item/".$tracking);
179
+ return $status;
180
+ }
181
  }
app/code/community/Rvtech/Starshipit/Model/Carrier/Couriersplease.php CHANGED
@@ -1,167 +1,181 @@
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Couriersplease extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
- protected $_code = 'couriersplease';
5
 
6
- public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
- {
8
- if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
- return false;
10
- }
 
 
11
  $price = 0;
12
  $doCalulate = $this->getConfigData('calculate');
13
- if ($doCalulate==0)
14
- {
15
  $price = $this->getConfigData('price');
 
 
 
 
 
 
 
 
 
 
16
  }
17
- else{
18
- try {
19
- $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
20
- if ($shipItApiKey == "") {
21
- return false;
22
- }
23
- $origCountryId = $request->getCountryId(); //Package Source Country ID
24
- $origRegionId = $request->getRegionId(); //Package Source Region ID
25
- $origRegionCode = $request->getRegion(); //Package Source Region Code
26
- $origCity = $request->getCity(); //Package Source City
27
- $origPostcode = $request->getPostcode(); //Package Source Post Code
28
-
29
- $destCountryId = $request->getDestCountryId();
30
- $destCountry = $request->getDestCountry();
31
- $destRegion = $request->getDestRegionId();
32
- $destRegionCode = $request->getDestRegionCode();
33
- $destFullStreet = $request->getDestStreet();
34
- $destStreet = "";
35
- $destSuburb = "";
36
- $destCity = $request->getDestCity();
37
- $destPostcode = $request->getDestPostcode();
38
-
39
- $destFullStreetArray = explode("\n", $destFullStreet);
40
- if ($destFullStreetArray[0] !== false)
41
- $destStreet = $destFullStreetArray[0];
42
- if ($destFullStreetArray[1] !== false)
43
- $destSuburb = $destFullStreetArray[1];
44
-
45
- $packageValue = $request->getPackageValue(); //Dest Package Value
46
- $packageValueDiscout = $request->getPackageValueWithDiscount(); //Dest Package Value After Discount
47
- $packageWeight = $request->getPackageWeight() * 1000; //Package Weight (grams)
48
- $packageCurrency = $request->getPackageCurrency();
49
-
50
- $url = 'https://api.shipit.click/rate?apiKey=' . $shipItApiKey . '&integration=magento&format=json';
51
- $post_data = '{
52
- "rate": {
53
- "origin": {
54
- "country": "' . $origCountryId . '",
55
- "postal_code": "' . $origPostcode . '",
56
- "province": "' . $origRegionCode . '",
57
- "city": "' . $origCity . '",
58
- "name": null,
59
- "address1": null,
60
- "address2": null,
61
- "address3": null,
62
- "phone": null,
63
- "fax": null,
64
- "address_type": null,
65
- "company_name": null
66
- },
67
- "destination":{
68
- "country": "' . $destCountryId . '",
69
- "postal_code": "' . $destPostcode . '",
70
- "province": "' . $destRegionCode . '",
71
- "city": "' . $destCity . '",
72
- "name": null,
73
- "address1": "' . $destStreet . '",
74
- "address2": "' . $destSuburb . '",
75
- "address3": null,
76
- "phone": null,
77
- "fax": null,
78
- "address_type": null,
79
- "company_name": null
80
- },
81
- "items":[
82
- {
83
- "name": "Total Items",
84
- "sku": null,
85
- "quantity": 1,
86
- "grams": ' . $packageWeight . ' ,
87
- "price": ' . $packageValue . ',
88
- "vendor": null,
89
- "requires_shipping": true,
90
- "taxable": true,
91
- "fulfillment_service": "manual"
92
- }
93
- ],
94
- "currency": "' . $packageCurrency->getCurrencyCode() . '",
95
- "carrierid": "17"
96
  }
97
- }';
98
- $contentLength = strlen($post_data);
99
-
100
- $ch = curl_init();
101
- curl_setopt($ch, CURLOPT_URL, $url);
102
- curl_setopt($ch, CURLOPT_HEADER, false);
103
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
104
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
105
- curl_setopt($ch, CURLOPT_POST, true);
106
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
107
- $response = curl_exec($ch);
108
- curl_close($ch);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
 
110
- $json_obj = json_decode($response);
111
- $rates_obj = $json_obj->{'rates'};
112
-
113
- $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
114
- $result = Mage::getModel('shipping/rate_result');
115
- $show = true;
116
- if($show){
117
- if(sizeof($rates_obj) > 0) {
118
- foreach($rates_obj as $rate) {
119
- if(is_object($rate)) {
120
- // Add shipping option with shipping price
121
- $method = Mage::getModel('shipping/rate_result_method');
122
- $method->setCarrier($this->_code);
123
- $method->setMethod($this->_code . $rate->{'service_code'});
124
- $method->setCarrierTitle($this->getConfigData('title'));
125
- $method->setMethodTitle($rate->{'service_name'});
126
- $method->setPrice($rate->{'total_price'});
127
- $method->setCost(0);
128
- $result->append($method);
129
- }
130
- }
131
- }
132
- }else{
133
- $error = Mage::getModel('shipping/rate_result_error');
134
- $error->setCarrier($this->_code);
135
- $error->setCarrierTitle($this->getConfigData('name'));
136
- $error->setErrorMessage($this->getConfigData('specificerrmsg'));
137
- $result->append($error);
138
- }
139
  }
140
- catch (Exception $e) {
141
- Mage::log($e->getMessage());
 
 
 
 
142
  }
 
 
 
 
143
  }
144
 
145
- return $result;
146
- }
147
- public function getAllowedMethods()
148
- {
149
- return array('couriersplease'=>$this->getConfigData('name'));
150
- }
151
-
152
- public function isTrackingAvailable()
153
- {
154
- return true;
155
- }
156
 
157
- public function getTrackingInfo($tracking)
158
- {
159
- $status = Mage::getModel('shipping/tracking_result_status');
160
- $status->setCarrier($this->_code);
161
- $status->setCarrierTitle($this->getConfigData('title'));
162
- $status->setTracking($tracking);
163
- $status->setPopup(1);
164
- $status->setUrl("http://www2.couriersplease.com.au/37:ezytrak-results?couponid=".$tracking);
165
- return $status;
166
- }
 
 
 
167
  }
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Couriersplease extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
+ protected $_code = 'couriersplease';
5
 
6
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
+ {
8
+ if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
+ return false;
10
+ }
11
+
12
+ $show = false;
13
  $price = 0;
14
  $doCalulate = $this->getConfigData('calculate');
15
+ if ($doCalulate==0) {
16
+ $show = true;
17
  $price = $this->getConfigData('price');
18
+
19
+ $result = Mage::getModel('shipping/rate_result');
20
+ $method = Mage::getModel('shipping/rate_result_method');
21
+ $method->setCarrier($this->_code);
22
+ $method->setMethod($this->_code);
23
+ $method->setCarrierTitle($this->getConfigData('title'));
24
+ $method->setMethodTitle($this->getConfigData('name'));
25
+ $method->setPrice($price);
26
+ $method->setCost($price);
27
+ $result->append($method);
28
  }
29
+ else {
30
+ try {
31
+ $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
32
+ if ($shipItApiKey == "") {
33
+ return false;
34
+ }
35
+
36
+ $origCountryId = $request->getCountryId(); //Package Source Country ID
37
+ $origRegionId = $request->getRegionId(); //Package Source Region ID
38
+ $origRegionCode = $request->getRegion(); //Package Source Region Code
39
+ $origCity = $request->getCity(); //Package Source City
40
+ $origPostcode = $request->getPostcode(); //Package Source Post Code
41
+
42
+ $destCountryId = $request->getDestCountryId();
43
+ $destCountry = $request->getDestCountry();
44
+ $destRegion = $request->getDestRegionId();
45
+ $destRegionCode = $request->getDestRegionCode();
46
+ $destFullStreet = $request->getDestStreet();
47
+ $destStreet = "";
48
+ $destSuburb = "";
49
+ $destCity = $request->getDestCity();
50
+ $destPostcode = $request->getDestPostcode();
51
+
52
+ $destFullStreetArray = explode("\n", $destFullStreet);
53
+ if ($destFullStreetArray[0] !== false)
54
+ $destStreet = $destFullStreetArray[0];
55
+ if ($destFullStreetArray[1] !== false)
56
+ $destSuburb = $destFullStreetArray[1];
57
+
58
+ $packageValue = $request->getPackageValue(); //Dest Package Value
59
+ $packageValueDiscout = $request->getPackageValueWithDiscount(); //Dest Package Value After Discount
60
+ $packageWeight = $request->getPackageWeight() * 1000; //Package Weight (grams)
61
+ $packageCurrency = $request->getPackageCurrency();
62
+
63
+ $url = 'https://api.shipit.click/rate?apiKey=' . $shipItApiKey . '&integration=magento&format=json';
64
+ $post_data = '{
65
+ "rate": {
66
+ "origin": {
67
+ "country": "' . $origCountryId . '",
68
+ "postal_code": "' . $origPostcode . '",
69
+ "province": "' . $origRegionCode . '",
70
+ "city": "' . $origCity . '",
71
+ "name": null,
72
+ "address1": null,
73
+ "address2": null,
74
+ "address3": null,
75
+ "phone": null,
76
+ "fax": null,
77
+ "address_type": null,
78
+ "company_name": null
79
+ },
80
+ "destination":{
81
+ "country": "' . $destCountryId . '",
82
+ "postal_code": "' . $destPostcode . '",
83
+ "province": "' . $destRegionCode . '",
84
+ "city": "' . $destCity . '",
85
+ "name": null,
86
+ "address1": "' . $destStreet . '",
87
+ "address2": "' . $destSuburb . '",
88
+ "address3": null,
89
+ "phone": null,
90
+ "fax": null,
91
+ "address_type": null,
92
+ "company_name": null
93
+ },
94
+ "items":[
95
+ {
96
+ "name": "Total Items",
97
+ "sku": null,
98
+ "quantity": 1,
99
+ "grams": ' . $packageWeight . ' ,
100
+ "price": ' . $packageValue . ',
101
+ "vendor": null,
102
+ "requires_shipping": true,
103
+ "taxable": true,
104
+ "fulfillment_service": "manual"
 
 
 
105
  }
106
+ ],
107
+ "currency": "' . $packageCurrency->getCurrencyCode() . '",
108
+ "carrierid": "17"
109
+ }
110
+ }';
111
+ $contentLength = strlen($post_data);
112
+
113
+ $ch = curl_init();
114
+ curl_setopt($ch, CURLOPT_URL, $url);
115
+ curl_setopt($ch, CURLOPT_HEADER, false);
116
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
117
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
118
+ curl_setopt($ch, CURLOPT_POST, true);
119
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
120
+ $response = curl_exec($ch);
121
+ curl_close($ch);
122
+
123
+ $json_obj = json_decode($response);
124
+ $rates_obj = $json_obj->{'rates'};
125
+
126
+ $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
127
+ $result = Mage::getModel('shipping/rate_result');
128
+
129
+ if (sizeof($rates_obj) > 0) {
130
+ $show = true;
131
+ }
132
 
133
+ if ($show) {
134
+ foreach ($rates_obj as $rate) {
135
+ if (is_object($rate)) {
136
+ // Add shipping option with shipping price
137
+ $method = Mage::getModel('shipping/rate_result_method');
138
+ $method->setCarrier($this->_code);
139
+ $method->setMethod($this->_code . $rate->{'service_code'});
140
+ $method->setCarrierTitle($this->getConfigData('title'));
141
+ $method->setMethodTitle($rate->{'service_name'});
142
+ $method->setPrice($rate->{'total_price'});
143
+ $method->setCost(0);
144
+ $result->append($method);
145
+ }
146
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  }
148
+ else {
149
+ $error = Mage::getModel('shipping/rate_result_error');
150
+ $error->setCarrier($this->_code);
151
+ $error->setCarrierTitle($this->getConfigData('name'));
152
+ $error->setErrorMessage($this->getConfigData('specificerrmsg'));
153
+ $result->append($error);
154
  }
155
+ }
156
+ catch (Exception $e) {
157
+ Mage::log($e->getMessage());
158
+ }
159
  }
160
 
161
+ return $result;
162
+ }
163
+
164
+ public function getAllowedMethods() {
165
+ return array('couriersplease'=>$this->getConfigData('name'));
166
+ }
 
 
 
 
 
167
 
168
+ public function isTrackingAvailable() {
169
+ return true;
170
+ }
171
+
172
+ public function getTrackingInfo($tracking) {
173
+ $status = Mage::getModel('shipping/tracking_result_status');
174
+ $status->setCarrier($this->_code);
175
+ $status->setCarrierTitle($this->getConfigData('title'));
176
+ $status->setTracking($tracking);
177
+ $status->setPopup(1);
178
+ $status->setUrl("http://www2.couriersplease.com.au/37:ezytrak-results?couponid=".$tracking);
179
+ return $status;
180
+ }
181
  }
app/code/community/Rvtech/Starshipit/Model/Carrier/Dhlexpress.php CHANGED
@@ -1,127 +1,181 @@
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Dhlexpress extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
- protected $_code = 'dhlexpress';
5
 
6
- public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
- {
8
- if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
- return false;
10
- }
11
- $show = false;
12
- $price = 0;
13
- $doCalulate = $this->getConfigData('calculate');
14
- if ($doCalulate==0)
15
- {
16
- $show = true;
17
- $price = $this->getConfigData('price');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  }
19
- else{
20
- $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
21
- $destCountryId = $request->getDestCountryId();
22
- $destCountry = $request->getDestCountry();
23
- $destRegion = $request->getDestRegionId();
24
- $destRegionCode = $request->getDestRegionCode();
25
- $destStreet = $request->getDestStreet();
26
- $destCity = $request->getDestCity();
27
- $destPostcode = $request->getDestPostcode();
28
- $packageWeight = $request->getPackageWeight();
29
- if ($request->getPackageHeight()) {
30
- $packageHeight = $request->getPackageHeight();
31
- }
32
- else {
33
- $packageHeight = 0.1;
34
- }
35
- if ($request->getPackageWidth()) {
36
- $packageWidth = $request->getPackageWidth();
37
- }
38
- else {
39
- $packageWidth = 0.1;
40
- }
41
- if ($request->getPackageDepth()) {
42
- $packageDepth = $request->getPackageDepth();
43
- }
44
- else {
45
- $packageDepth = 0.1;
46
- }
47
-
48
- $params = array(
49
- "apiKey" => $shipItApiKey,
50
- "carrierid"=>2,
51
- "street"=>$destStreet,
52
- "suburb"=>"",
53
- "city"=> $destCity,
54
- "postcode"=>$destPostcode,
55
- "state"=>$destRegion,
56
- "country"=>$destCountry,
57
- "countryId"=>$destCountryId,
58
- "weight"=>$packageWeight,
59
- "height"=>$packageHeight,
60
- "width"=>$packageWidth,
61
- "depth"=>$packageDepth
62
- );
63
-
64
- // Call web service.
65
- try {
66
- $wsdl = 'https://app.shipit.click/shipment.svc?WSDL';
67
- $client = new SoapClient($wsdl, array(
68
- 'cache_wsdl' => WSDL_CACHE_NONE,
69
- 'cache_ttl' => 86400,
70
- 'trace' => true,
71
- 'exceptions' => true,
72
- ));
73
- $result = $client->__soapCall("GetQuote", array($params));
74
- $quoteResponse = $result->GetQuoteResult;
75
- //Mage::log("Price web:".$quoteResponse->Price, null, ShipIt.log);
76
- if($quoteResponse->ErrorMessage == "") {
77
- $show = true;
78
- $price = $quoteResponse->Price;
79
- }
80
- } catch (Exception $rateError) {
81
-
82
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  }
84
-
85
- $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
86
- $result = Mage::getModel('shipping/rate_result');
87
- if($show){
88
-
89
- $method = Mage::getModel('shipping/rate_result_method');
90
- $method->setCarrier($this->_code);
91
- $method->setMethod($this->_code);
92
- $method->setCarrierTitle($this->getConfigData('title'));
93
- $method->setMethodTitle($this->getConfigData('name'));
94
- $method->setPrice($price);
95
- $method->setCost($price);
96
- $result->append($method);
97
-
98
- }else{
99
- $error = Mage::getModel('shipping/rate_result_error');
100
- $error->setCarrier($this->_code);
101
- $error->setCarrierTitle($this->getConfigData('name'));
102
- $error->setErrorMessage($this->getConfigData('specificerrmsg'));
103
- $result->append($error);
104
- }
105
- return $result;
106
- }
107
- public function getAllowedMethods()
108
- {
109
- return array('dhlexpress'=>$this->getConfigData('name'));
110
- }
 
111
 
112
- public function isTrackingAvailable()
113
- {
114
- return true;
115
- }
 
 
116
 
117
- public function getTrackingInfo($tracking)
118
- {
119
- $status = Mage::getModel('shipping/tracking_result_status');
120
- $status->setCarrier($this->_code);
121
- $status->setCarrierTitle($this->getConfigData('title'));
122
- $status->setTracking($tracking);
123
- $status->setPopup(1);
124
- $status->setUrl("http://www.dhl.com/cgi-bin/tracking.pl?AWB=".$tracking);
125
- return $status;
126
- }
127
- }
 
 
 
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Dhlexpress extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
+ protected $_code = 'dhlexpress';
5
 
6
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
+ {
8
+ if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
+ return false;
10
+ }
11
+
12
+ $show = false;
13
+ $price = 0;
14
+ $doCalulate = $this->getConfigData('calculate');
15
+ if ($doCalulate==0) {
16
+ $show = true;
17
+ $price = $this->getConfigData('price');
18
+
19
+ $result = Mage::getModel('shipping/rate_result');
20
+ $method = Mage::getModel('shipping/rate_result_method');
21
+ $method->setCarrier($this->_code);
22
+ $method->setMethod($this->_code);
23
+ $method->setCarrierTitle($this->getConfigData('title'));
24
+ $method->setMethodTitle($this->getConfigData('name'));
25
+ $method->setPrice($price);
26
+ $method->setCost($price);
27
+ $result->append($method);
28
+ }
29
+ else {
30
+ try {
31
+ $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
32
+ if ($shipItApiKey == "") {
33
+ return false;
34
  }
35
+
36
+ $origCountryId = $request->getCountryId(); //Package Source Country ID
37
+ $origRegionId = $request->getRegionId(); //Package Source Region ID
38
+ $origRegionCode = $request->getRegion(); //Package Source Region Code
39
+ $origCity = $request->getCity(); //Package Source City
40
+ $origPostcode = $request->getPostcode(); //Package Source Post Code
41
+
42
+ $destCountryId = $request->getDestCountryId();
43
+ $destCountry = $request->getDestCountry();
44
+ $destRegion = $request->getDestRegionId();
45
+ $destRegionCode = $request->getDestRegionCode();
46
+ $destFullStreet = $request->getDestStreet();
47
+ $destStreet = "";
48
+ $destSuburb = "";
49
+ $destCity = $request->getDestCity();
50
+ $destPostcode = $request->getDestPostcode();
51
+
52
+ $destFullStreetArray = explode("\n", $destFullStreet);
53
+ if ($destFullStreetArray[0] !== false)
54
+ $destStreet = $destFullStreetArray[0];
55
+ if ($destFullStreetArray[1] !== false)
56
+ $destSuburb = $destFullStreetArray[1];
57
+
58
+ $packageValue = $request->getPackageValue(); //Dest Package Value
59
+ $packageValueDiscout = $request->getPackageValueWithDiscount(); //Dest Package Value After Discount
60
+ $packageWeight = $request->getPackageWeight() * 1000; //Package Weight (grams)
61
+ $packageCurrency = $request->getPackageCurrency();
62
+
63
+ $url = 'https://api.shipit.click/rate?apiKey=' . $shipItApiKey . '&integration=magento&format=json';
64
+ $post_data = '{
65
+ "rate": {
66
+ "origin": {
67
+ "country": "' . $origCountryId . '",
68
+ "postal_code": "' . $origPostcode . '",
69
+ "province": "' . $origRegionCode . '",
70
+ "city": "' . $origCity . '",
71
+ "name": null,
72
+ "address1": null,
73
+ "address2": null,
74
+ "address3": null,
75
+ "phone": null,
76
+ "fax": null,
77
+ "address_type": null,
78
+ "company_name": null
79
+ },
80
+ "destination":{
81
+ "country": "' . $destCountryId . '",
82
+ "postal_code": "' . $destPostcode . '",
83
+ "province": "' . $destRegionCode . '",
84
+ "city": "' . $destCity . '",
85
+ "name": null,
86
+ "address1": "' . $destStreet . '",
87
+ "address2": "' . $destSuburb . '",
88
+ "address3": null,
89
+ "phone": null,
90
+ "fax": null,
91
+ "address_type": null,
92
+ "company_name": null
93
+ },
94
+ "items":[
95
+ {
96
+ "name": "Total Items",
97
+ "sku": null,
98
+ "quantity": 1,
99
+ "grams": ' . $packageWeight . ' ,
100
+ "price": ' . $packageValue . ',
101
+ "vendor": null,
102
+ "requires_shipping": true,
103
+ "taxable": true,
104
+ "fulfillment_service": "manual"
105
+ }
106
+ ],
107
+ "currency": "' . $packageCurrency->getCurrencyCode() . '",
108
+ "carrierid": "2"
109
+ }
110
+ }';
111
+ $contentLength = strlen($post_data);
112
+
113
+ $ch = curl_init();
114
+ curl_setopt($ch, CURLOPT_URL, $url);
115
+ curl_setopt($ch, CURLOPT_HEADER, false);
116
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
117
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
118
+ curl_setopt($ch, CURLOPT_POST, true);
119
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
120
+ $response = curl_exec($ch);
121
+ curl_close($ch);
122
+
123
+ $json_obj = json_decode($response);
124
+ $rates_obj = $json_obj->{'rates'};
125
+
126
+ $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
127
+ $result = Mage::getModel('shipping/rate_result');
128
+
129
+ if (sizeof($rates_obj) > 0) {
130
+ $show = true;
131
  }
132
+
133
+ if ($show) {
134
+ foreach ($rates_obj as $rate) {
135
+ if (is_object($rate)) {
136
+ // Add shipping option with shipping price
137
+ $method = Mage::getModel('shipping/rate_result_method');
138
+ $method->setCarrier($this->_code);
139
+ $method->setMethod($this->_code . $rate->{'service_code'});
140
+ $method->setCarrierTitle($this->getConfigData('title'));
141
+ $method->setMethodTitle($rate->{'service_name'});
142
+ $method->setPrice($rate->{'total_price'});
143
+ $method->setCost(0);
144
+ $result->append($method);
145
+ }
146
+ }
147
+ }
148
+ else {
149
+ $error = Mage::getModel('shipping/rate_result_error');
150
+ $error->setCarrier($this->_code);
151
+ $error->setCarrierTitle($this->getConfigData('name'));
152
+ $error->setErrorMessage($this->getConfigData('specificerrmsg'));
153
+ $result->append($error);
154
+ }
155
+ }
156
+ catch (Exception $e) {
157
+ Mage::log($e->getMessage());
158
+ }
159
+ }
160
 
161
+ return $result;
162
+ }
163
+
164
+ public function getAllowedMethods() {
165
+ return array('dhlexpress'=>$this->getConfigData('name'));
166
+ }
167
 
168
+ public function isTrackingAvailable() {
169
+ return true;
170
+ }
171
+
172
+ public function getTrackingInfo($tracking) {
173
+ $status = Mage::getModel('shipping/tracking_result_status');
174
+ $status->setCarrier($this->_code);
175
+ $status->setCarrierTitle($this->getConfigData('title'));
176
+ $status->setTracking($tracking);
177
+ $status->setPopup(1);
178
+ $status->setUrl("http://www.dhl.com/cgi-bin/tracking.pl?AWB=".$tracking);
179
+ return $status;
180
+ }
181
+ }
app/code/community/Rvtech/Starshipit/Model/Carrier/Fastway.php CHANGED
@@ -1,106 +1,181 @@
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Fastway extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
- protected $_code = 'fastway';
5
 
6
- public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
- {
8
- if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
- return false;
10
- }
11
-
12
- $price = 0;
13
- $doCalulate = $this->getConfigData('calculate');
14
- if ($doCalulate==0)
15
- {
16
- $price = $this->getConfigData('price');
17
- }
18
- else{
19
- $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
20
- $destCountryId = $request->getDestCountryId();
21
- $destCountry = $request->getDestCountry();
22
- $destRegion = $request->getDestRegionId();
23
- $destRegionCode = $request->getDestRegionCode();
24
- $destStreet = $request->getDestStreet();
25
- $destCity = $request->getDestCity();
26
- $destPostcode = $request->getDestPostcode();
27
- $packageWeight = $request->getPackageWeight();
28
- $packageheight = $request->getPackageHeight();
29
- $packagewidth = $request->getPackageWidth();
30
- $packagedepth = $request->getPackageDepth();
31
-
32
- $params = array(
33
- "apiKey" => $shipItApiKey,
34
- "carrierid"=>3,
35
- "street"=>$destStreet,
36
- "suburb"=>"",
37
- "city"=> $destCity,
38
- "postcode"=>$destPostcode,
39
- "state"=>$destRegion,
40
- "country"=>$destCountry,
41
- "countryId"=>$destCountryId,
42
- "weight"=>$packageWeight,
43
- "height"=>$packageheight,
44
- "width"=>$packagewidth,
45
- "depth"=>$packagedepth
46
- );
47
-
48
- // Call web service.
49
- $wsdl = 'https://app.shipit.click/shipment.svc?WSDL';
50
- $client = new SoapClient($wsdl, array(
51
- 'cache_wsdl' => WSDL_CACHE_NONE,
52
- 'cache_ttl' => 86400,
53
- 'trace' => true,
54
- 'exceptions' => true,
55
- ));
56
-
57
- $result = $client->__soapCall("GetQuote", array($params));
58
- $quoteResponse = $result->GetQuoteResult;
59
- //Mage::log("Price web:".$quoteResponse->Price, null, ShipIt.log);
60
- $price = $quoteResponse->Price;
61
  }
62
-
63
- $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
64
- $result = Mage::getModel('shipping/rate_result');
65
- $show = true;
66
- if($show){
67
-
68
- $method = Mage::getModel('shipping/rate_result_method');
69
- $method->setCarrier($this->_code);
70
- $method->setMethod($this->_code);
71
- $method->setCarrierTitle($this->getConfigData('title'));
72
- $method->setMethodTitle($this->getConfigData('name'));
73
- $method->setPrice($price);
74
- $method->setCost($price);
75
- $result->append($method);
76
-
77
- }else{
78
- $error = Mage::getModel('shipping/rate_result_error');
79
- $error->setCarrier($this->_code);
80
- $error->setCarrierTitle($this->getConfigData('name'));
81
- $error->setErrorMessage($this->getConfigData('specificerrmsg'));
82
- $result->append($error);
83
- }
84
- return $result;
85
- }
86
- public function getAllowedMethods()
87
- {
88
- return array('fastway'=>$this->getConfigData('name'));
89
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
 
91
- public function isTrackingAvailable()
92
- {
93
- return true;
94
- }
 
 
95
 
96
- public function getTrackingInfo($tracking)
97
- {
98
- $status = Mage::getModel('shipping/tracking_result_status');
99
- $status->setCarrier($this->_code);
100
- $status->setCarrierTitle($this->getConfigData('title'));
101
- $status->setTracking($tracking);
102
- $status->setPopup(1);
103
- $status->setUrl("http://www.fastway.com.au/courier-services/track-your-parcel?l=".$tracking);
104
- return $status;
105
- }
106
- }
 
 
 
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Fastway extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
+ protected $_code = 'fastway';
5
 
6
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
+ {
8
+ if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
+ return false;
10
+ }
11
+
12
+ $show = false;
13
+ $price = 0;
14
+ $doCalulate = $this->getConfigData('calculate');
15
+ if ($doCalulate==0) {
16
+ $show = true;
17
+ $price = $this->getConfigData('price');
18
+
19
+ $result = Mage::getModel('shipping/rate_result');
20
+ $method = Mage::getModel('shipping/rate_result_method');
21
+ $method->setCarrier($this->_code);
22
+ $method->setMethod($this->_code);
23
+ $method->setCarrierTitle($this->getConfigData('title'));
24
+ $method->setMethodTitle($this->getConfigData('name'));
25
+ $method->setPrice($price);
26
+ $method->setCost($price);
27
+ $result->append($method);
28
+ }
29
+ else {
30
+ try {
31
+ $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
32
+ if ($shipItApiKey == "") {
33
+ return false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  }
35
+
36
+ $origCountryId = $request->getCountryId(); //Package Source Country ID
37
+ $origRegionId = $request->getRegionId(); //Package Source Region ID
38
+ $origRegionCode = $request->getRegion(); //Package Source Region Code
39
+ $origCity = $request->getCity(); //Package Source City
40
+ $origPostcode = $request->getPostcode(); //Package Source Post Code
41
+
42
+ $destCountryId = $request->getDestCountryId();
43
+ $destCountry = $request->getDestCountry();
44
+ $destRegion = $request->getDestRegionId();
45
+ $destRegionCode = $request->getDestRegionCode();
46
+ $destFullStreet = $request->getDestStreet();
47
+ $destStreet = "";
48
+ $destSuburb = "";
49
+ $destCity = $request->getDestCity();
50
+ $destPostcode = $request->getDestPostcode();
51
+
52
+ $destFullStreetArray = explode("\n", $destFullStreet);
53
+ if ($destFullStreetArray[0] !== false)
54
+ $destStreet = $destFullStreetArray[0];
55
+ if ($destFullStreetArray[1] !== false)
56
+ $destSuburb = $destFullStreetArray[1];
57
+
58
+ $packageValue = $request->getPackageValue(); //Dest Package Value
59
+ $packageValueDiscout = $request->getPackageValueWithDiscount(); //Dest Package Value After Discount
60
+ $packageWeight = $request->getPackageWeight() * 1000; //Package Weight (grams)
61
+ $packageCurrency = $request->getPackageCurrency();
62
+
63
+ $url = 'https://api.shipit.click/rate?apiKey=' . $shipItApiKey . '&integration=magento&format=json';
64
+ $post_data = '{
65
+ "rate": {
66
+ "origin": {
67
+ "country": "' . $origCountryId . '",
68
+ "postal_code": "' . $origPostcode . '",
69
+ "province": "' . $origRegionCode . '",
70
+ "city": "' . $origCity . '",
71
+ "name": null,
72
+ "address1": null,
73
+ "address2": null,
74
+ "address3": null,
75
+ "phone": null,
76
+ "fax": null,
77
+ "address_type": null,
78
+ "company_name": null
79
+ },
80
+ "destination":{
81
+ "country": "' . $destCountryId . '",
82
+ "postal_code": "' . $destPostcode . '",
83
+ "province": "' . $destRegionCode . '",
84
+ "city": "' . $destCity . '",
85
+ "name": null,
86
+ "address1": "' . $destStreet . '",
87
+ "address2": "' . $destSuburb . '",
88
+ "address3": null,
89
+ "phone": null,
90
+ "fax": null,
91
+ "address_type": null,
92
+ "company_name": null
93
+ },
94
+ "items":[
95
+ {
96
+ "name": "Total Items",
97
+ "sku": null,
98
+ "quantity": 1,
99
+ "grams": ' . $packageWeight . ' ,
100
+ "price": ' . $packageValue . ',
101
+ "vendor": null,
102
+ "requires_shipping": true,
103
+ "taxable": true,
104
+ "fulfillment_service": "manual"
105
+ }
106
+ ],
107
+ "currency": "' . $packageCurrency->getCurrencyCode() . '",
108
+ "carrierid": "3"
109
+ }
110
+ }';
111
+ $contentLength = strlen($post_data);
112
+
113
+ $ch = curl_init();
114
+ curl_setopt($ch, CURLOPT_URL, $url);
115
+ curl_setopt($ch, CURLOPT_HEADER, false);
116
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
117
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
118
+ curl_setopt($ch, CURLOPT_POST, true);
119
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
120
+ $response = curl_exec($ch);
121
+ curl_close($ch);
122
+
123
+ $json_obj = json_decode($response);
124
+ $rates_obj = $json_obj->{'rates'};
125
+
126
+ $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
127
+ $result = Mage::getModel('shipping/rate_result');
128
+
129
+ if (sizeof($rates_obj) > 0) {
130
+ $show = true;
131
+ }
132
+
133
+ if ($show) {
134
+ foreach ($rates_obj as $rate) {
135
+ if (is_object($rate)) {
136
+ // Add shipping option with shipping price
137
+ $method = Mage::getModel('shipping/rate_result_method');
138
+ $method->setCarrier($this->_code);
139
+ $method->setMethod($this->_code . $rate->{'service_code'});
140
+ $method->setCarrierTitle($this->getConfigData('title'));
141
+ $method->setMethodTitle($rate->{'service_name'});
142
+ $method->setPrice($rate->{'total_price'});
143
+ $method->setCost(0);
144
+ $result->append($method);
145
+ }
146
+ }
147
+ }
148
+ else {
149
+ $error = Mage::getModel('shipping/rate_result_error');
150
+ $error->setCarrier($this->_code);
151
+ $error->setCarrierTitle($this->getConfigData('name'));
152
+ $error->setErrorMessage($this->getConfigData('specificerrmsg'));
153
+ $result->append($error);
154
+ }
155
+ }
156
+ catch (Exception $e) {
157
+ Mage::log($e->getMessage());
158
+ }
159
+ }
160
 
161
+ return $result;
162
+ }
163
+
164
+ public function getAllowedMethods() {
165
+ return array('fastway'=>$this->getConfigData('name'));
166
+ }
167
 
168
+ public function isTrackingAvailable() {
169
+ return true;
170
+ }
171
+
172
+ public function getTrackingInfo($tracking) {
173
+ $status = Mage::getModel('shipping/tracking_result_status');
174
+ $status->setCarrier($this->_code);
175
+ $status->setCarrierTitle($this->getConfigData('title'));
176
+ $status->setTracking($tracking);
177
+ $status->setPopup(1);
178
+ $status->setUrl("http://www.fastway.com.au/courier-services/track-your-parcel?l=".$tracking);
179
+ return $status;
180
+ }
181
+ }
app/code/community/Rvtech/Starshipit/Model/Carrier/Nzpost.php CHANGED
@@ -1,112 +1,181 @@
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Nzpost extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
- protected $_code = 'nzpost';
5
 
6
- public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
- {
8
- if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
- return false;
10
- }
11
-
12
- $price = 0;
13
- $doCalulate = $this->getConfigData('calculate');
14
- if ($doCalulate==0)
15
- {
16
- $price = $this->getConfigData('price');
17
- }
18
- else{
19
- $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
20
- $destCountryId = $request->getDestCountryId();
21
- $destCountry = $request->getDestCountry();
22
- $destRegion = $request->getDestRegionId();
23
- $destRegionCode = $request->getDestRegionCode();
24
- $destStreet = $request->getDestStreet();
25
- $destCity = $request->getDestCity();
26
- $destPostcode = $request->getDestPostcode();
27
- $packageWeight = $request->getPackageWeight();
28
- $packageheight = $request->getPackageHeight();
29
- $packagewidth = $request->getPackageWidth();
30
- $packagedepth = $request->getPackageDepth();
31
-
32
- $params = array(
33
- "apiKey" => $shipItApiKey,
34
- "carrierid"=>1,
35
- "street"=>$destStreet,
36
- "suburb"=>"",
37
- "city"=> $destCity,
38
- "postcode"=>$destPostcode,
39
- "state"=>$destRegion,
40
- "country"=>$destCountry,
41
- "countryId"=>$destCountryId,
42
- "weight"=>$packageWeight,
43
- "height"=>$packageheight,
44
- "width"=>$packagewidth,
45
- "depth"=>$packagedepth
46
- );
47
-
48
- try{
49
- // Call web service.
50
- $wsdl = 'https://app.shipit.click/shipment.svc?WSDL';
51
- $client = new SoapClient($wsdl, array(
52
- 'cache_wsdl' => WSDL_CACHE_NONE,
53
- 'cache_ttl' => 86400,
54
- 'trace' => true,
55
- 'exceptions' => true,
56
- ));
57
-
58
- $result = $client->__soapCall("GetQuote", array($params));
59
- $quoteResponse = $result->GetQuoteResult;
60
- //Mage::log("Price web:".$quoteResponse->Price, null, ShipIt.log);
61
- $price = $quoteResponse->Price;
62
- }
63
- catch (Exception $e)
64
- {
65
- Mage::log($e->getMessage(), null, ShipIt.log);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  }
 
67
  }
68
-
69
- $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
70
- $result = Mage::getModel('shipping/rate_result');
71
- $show = true;
72
- if($show){
73
-
74
- $method = Mage::getModel('shipping/rate_result_method');
75
- $method->setCarrier($this->_code);
76
- $method->setMethod($this->_code);
77
- $method->setCarrierTitle($this->getConfigData('title'));
78
- $method->setMethodTitle($this->getConfigData('name'));
79
- $method->setPrice($price);
80
- $method->setCost($price);
81
- $result->append($method);
82
-
83
- }else{
84
- $error = Mage::getModel('shipping/rate_result_error');
85
- $error->setCarrier($this->_code);
86
- $error->setCarrierTitle($this->getConfigData('name'));
87
- $error->setErrorMessage($this->getConfigData('specificerrmsg'));
88
- $result->append($error);
89
- }
90
- return $result;
91
- }
92
- public function getAllowedMethods()
93
- {
94
- return array('nzpost'=>$this->getConfigData('name'));
95
- }
96
 
97
- public function isTrackingAvailable()
98
- {
99
- return true;
100
- }
 
 
101
 
102
- public function getTrackingInfo($tracking)
103
- {
104
- $status = Mage::getModel('shipping/tracking_result_status');
105
- $status->setCarrier($this->_code);
106
- $status->setCarrierTitle($this->getConfigData('title'));
107
- $status->setTracking($tracking);
108
- $status->setPopup(1);
109
- $status->setUrl("https://www.nzpost.co.nz/tools/tracking/item/".$tracking);
110
- return $status;
111
- }
 
 
 
112
  }
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Nzpost extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
+ protected $_code = 'nzpost';
5
 
6
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
+ {
8
+ if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
+ return false;
10
+ }
11
+
12
+ $show = false;
13
+ $price = 0;
14
+ $doCalulate = $this->getConfigData('calculate');
15
+ if ($doCalulate==0) {
16
+ $show = true;
17
+ $price = $this->getConfigData('price');
18
+
19
+ $result = Mage::getModel('shipping/rate_result');
20
+ $method = Mage::getModel('shipping/rate_result_method');
21
+ $method->setCarrier($this->_code);
22
+ $method->setMethod($this->_code);
23
+ $method->setCarrierTitle($this->getConfigData('title'));
24
+ $method->setMethodTitle($this->getConfigData('name'));
25
+ $method->setPrice($price);
26
+ $method->setCost($price);
27
+ $result->append($method);
28
+ }
29
+ else {
30
+ try {
31
+ $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
32
+ if ($shipItApiKey == "") {
33
+ return false;
34
+ }
35
+
36
+ $origCountryId = $request->getCountryId(); //Package Source Country ID
37
+ $origRegionId = $request->getRegionId(); //Package Source Region ID
38
+ $origRegionCode = $request->getRegion(); //Package Source Region Code
39
+ $origCity = $request->getCity(); //Package Source City
40
+ $origPostcode = $request->getPostcode(); //Package Source Post Code
41
+
42
+ $destCountryId = $request->getDestCountryId();
43
+ $destCountry = $request->getDestCountry();
44
+ $destRegion = $request->getDestRegionId();
45
+ $destRegionCode = $request->getDestRegionCode();
46
+ $destFullStreet = $request->getDestStreet();
47
+ $destStreet = "";
48
+ $destSuburb = "";
49
+ $destCity = $request->getDestCity();
50
+ $destPostcode = $request->getDestPostcode();
51
+
52
+ $destFullStreetArray = explode("\n", $destFullStreet);
53
+ if ($destFullStreetArray[0] !== false)
54
+ $destStreet = $destFullStreetArray[0];
55
+ if ($destFullStreetArray[1] !== false)
56
+ $destSuburb = $destFullStreetArray[1];
57
+
58
+ $packageValue = $request->getPackageValue(); //Dest Package Value
59
+ $packageValueDiscout = $request->getPackageValueWithDiscount(); //Dest Package Value After Discount
60
+ $packageWeight = $request->getPackageWeight() * 1000; //Package Weight (grams)
61
+ $packageCurrency = $request->getPackageCurrency();
62
+
63
+ $url = 'https://api.shipit.click/rate?apiKey=' . $shipItApiKey . '&integration=magento&format=json';
64
+ $post_data = '{
65
+ "rate": {
66
+ "origin": {
67
+ "country": "' . $origCountryId . '",
68
+ "postal_code": "' . $origPostcode . '",
69
+ "province": "' . $origRegionCode . '",
70
+ "city": "' . $origCity . '",
71
+ "name": null,
72
+ "address1": null,
73
+ "address2": null,
74
+ "address3": null,
75
+ "phone": null,
76
+ "fax": null,
77
+ "address_type": null,
78
+ "company_name": null
79
+ },
80
+ "destination":{
81
+ "country": "' . $destCountryId . '",
82
+ "postal_code": "' . $destPostcode . '",
83
+ "province": "' . $destRegionCode . '",
84
+ "city": "' . $destCity . '",
85
+ "name": null,
86
+ "address1": "' . $destStreet . '",
87
+ "address2": "' . $destSuburb . '",
88
+ "address3": null,
89
+ "phone": null,
90
+ "fax": null,
91
+ "address_type": null,
92
+ "company_name": null
93
+ },
94
+ "items":[
95
+ {
96
+ "name": "Total Items",
97
+ "sku": null,
98
+ "quantity": 1,
99
+ "grams": ' . $packageWeight . ' ,
100
+ "price": ' . $packageValue . ',
101
+ "vendor": null,
102
+ "requires_shipping": true,
103
+ "taxable": true,
104
+ "fulfillment_service": "manual"
105
+ }
106
+ ],
107
+ "currency": "' . $packageCurrency->getCurrencyCode() . '",
108
+ "carrierid": "1"
109
+ }
110
+ }';
111
+ $contentLength = strlen($post_data);
112
+
113
+ $ch = curl_init();
114
+ curl_setopt($ch, CURLOPT_URL, $url);
115
+ curl_setopt($ch, CURLOPT_HEADER, false);
116
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
117
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
118
+ curl_setopt($ch, CURLOPT_POST, true);
119
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
120
+ $response = curl_exec($ch);
121
+ curl_close($ch);
122
+
123
+ $json_obj = json_decode($response);
124
+ $rates_obj = $json_obj->{'rates'};
125
+
126
+ $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
127
+ $result = Mage::getModel('shipping/rate_result');
128
+
129
+ if (sizeof($rates_obj) > 0) {
130
+ $show = true;
131
+ }
132
+
133
+ if ($show) {
134
+ foreach ($rates_obj as $rate) {
135
+ if (is_object($rate)) {
136
+ // Add shipping option with shipping price
137
+ $method = Mage::getModel('shipping/rate_result_method');
138
+ $method->setCarrier($this->_code);
139
+ $method->setMethod($this->_code . $rate->{'service_code'});
140
+ $method->setCarrierTitle($this->getConfigData('title'));
141
+ $method->setMethodTitle($rate->{'service_name'});
142
+ $method->setPrice($rate->{'total_price'});
143
+ $method->setCost(0);
144
+ $result->append($method);
145
  }
146
+ }
147
  }
148
+ else {
149
+ $error = Mage::getModel('shipping/rate_result_error');
150
+ $error->setCarrier($this->_code);
151
+ $error->setCarrierTitle($this->getConfigData('name'));
152
+ $error->setErrorMessage($this->getConfigData('specificerrmsg'));
153
+ $result->append($error);
154
+ }
155
+ }
156
+ catch (Exception $e) {
157
+ Mage::log($e->getMessage());
158
+ }
159
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
 
161
+ return $result;
162
+ }
163
+
164
+ public function getAllowedMethods() {
165
+ return array('nzpost'=>$this->getConfigData('name'));
166
+ }
167
 
168
+ public function isTrackingAvailable() {
169
+ return true;
170
+ }
171
+
172
+ public function getTrackingInfo($tracking) {
173
+ $status = Mage::getModel('shipping/tracking_result_status');
174
+ $status->setCarrier($this->_code);
175
+ $status->setCarrierTitle($this->getConfigData('title'));
176
+ $status->setTracking($tracking);
177
+ $status->setPopup(1);
178
+ $status->setUrl("https://www.nzpost.co.nz/tools/tracking/item/".$tracking);
179
+ return $status;
180
+ }
181
  }
app/code/community/Rvtech/Starshipit/Model/Carrier/Pace.php CHANGED
@@ -1,167 +1,181 @@
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Pace extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
- protected $_code = 'pace';
5
 
6
- public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
- {
8
- if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
- return false;
10
- }
 
 
11
  $price = 0;
12
  $doCalulate = $this->getConfigData('calculate');
13
- if ($doCalulate==0)
14
- {
15
  $price = $this->getConfigData('price');
 
 
 
 
 
 
 
 
 
 
16
  }
17
- else{
18
- try {
19
- $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
20
- if ($shipItApiKey == "") {
21
- return false;
22
- }
23
- $origCountryId = $request->getCountryId(); //Package Source Country ID
24
- $origRegionId = $request->getRegionId(); //Package Source Region ID
25
- $origRegionCode = $request->getRegion(); //Package Source Region Code
26
- $origCity = $request->getCity(); //Package Source City
27
- $origPostcode = $request->getPostcode(); //Package Source Post Code
28
-
29
- $destCountryId = $request->getDestCountryId();
30
- $destCountry = $request->getDestCountry();
31
- $destRegion = $request->getDestRegionId();
32
- $destRegionCode = $request->getDestRegionCode();
33
- $destFullStreet = $request->getDestStreet();
34
- $destStreet = "";
35
- $destSuburb = "";
36
- $destCity = $request->getDestCity();
37
- $destPostcode = $request->getDestPostcode();
38
-
39
- $destFullStreetArray = explode("\n", $destFullStreet);
40
- if ($destFullStreetArray[0] !== false)
41
- $destStreet = $destFullStreetArray[0];
42
- if ($destFullStreetArray[1] !== false)
43
- $destSuburb = $destFullStreetArray[1];
44
-
45
- $packageValue = $request->getPackageValue(); //Dest Package Value
46
- $packageValueDiscout = $request->getPackageValueWithDiscount(); //Dest Package Value After Discount
47
- $packageWeight = $request->getPackageWeight() * 1000; //Package Weight (grams)
48
- $packageCurrency = $request->getPackageCurrency();
49
-
50
- $url = 'https://api.shipit.click/rate?apiKey=' . $shipItApiKey . '&integration=magento&format=json';
51
- $post_data = '{
52
- "rate": {
53
- "origin": {
54
- "country": "' . $origCountryId . '",
55
- "postal_code": "' . $origPostcode . '",
56
- "province": "' . $origRegionCode . '",
57
- "city": "' . $origCity . '",
58
- "name": null,
59
- "address1": null,
60
- "address2": null,
61
- "address3": null,
62
- "phone": null,
63
- "fax": null,
64
- "address_type": null,
65
- "company_name": null
66
- },
67
- "destination":{
68
- "country": "' . $destCountryId . '",
69
- "postal_code": "' . $destPostcode . '",
70
- "province": "' . $destRegionCode . '",
71
- "city": "' . $destCity . '",
72
- "name": null,
73
- "address1": "' . $destStreet . '",
74
- "address2": "' . $destSuburb . '",
75
- "address3": null,
76
- "phone": null,
77
- "fax": null,
78
- "address_type": null,
79
- "company_name": null
80
- },
81
- "items":[
82
- {
83
- "name": "Total Items",
84
- "sku": null,
85
- "quantity": 1,
86
- "grams": ' . $packageWeight . ' ,
87
- "price": ' . $packageValue . ',
88
- "vendor": null,
89
- "requires_shipping": true,
90
- "taxable": true,
91
- "fulfillment_service": "manual"
92
- }
93
- ],
94
- "currency": "' . $packageCurrency->getCurrencyCode() . '",
95
- "carrierid": "19"
96
  }
97
- }';
98
- $contentLength = strlen($post_data);
99
-
100
- $ch = curl_init();
101
- curl_setopt($ch, CURLOPT_URL, $url);
102
- curl_setopt($ch, CURLOPT_HEADER, false);
103
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
104
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
105
- curl_setopt($ch, CURLOPT_POST, true);
106
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
107
- $response = curl_exec($ch);
108
- curl_close($ch);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
 
110
- $json_obj = json_decode($response);
111
- $rates_obj = $json_obj->{'rates'};
112
-
113
- $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
114
- $result = Mage::getModel('shipping/rate_result');
115
- $show = true;
116
- if($show){
117
- if(sizeof($rates_obj) > 0) {
118
- foreach($rates_obj as $rate) {
119
- if(is_object($rate)) {
120
- // Add shipping option with shipping price
121
- $method = Mage::getModel('shipping/rate_result_method');
122
- $method->setCarrier($this->_code);
123
- $method->setMethod($this->_code . $rate->{'service_code'});
124
- $method->setCarrierTitle($this->getConfigData('title'));
125
- $method->setMethodTitle($rate->{'service_name'});
126
- $method->setPrice($rate->{'total_price'});
127
- $method->setCost(0);
128
- $result->append($method);
129
- }
130
- }
131
- }
132
- }else{
133
- $error = Mage::getModel('shipping/rate_result_error');
134
- $error->setCarrier($this->_code);
135
- $error->setCarrierTitle($this->getConfigData('name'));
136
- $error->setErrorMessage($this->getConfigData('specificerrmsg'));
137
- $result->append($error);
138
- }
139
  }
140
- catch (Exception $e) {
141
- Mage::log($e->getMessage());
 
 
 
 
142
  }
 
 
 
 
143
  }
144
 
145
- return $result;
146
- }
147
- public function getAllowedMethods()
148
- {
149
- return array('pace'=>$this->getConfigData('name'));
150
- }
151
-
152
- public function isTrackingAvailable()
153
- {
154
- return true;
155
- }
156
 
157
- public function getTrackingInfo($tracking)
158
- {
159
- $status = Mage::getModel('shipping/tracking_result_status');
160
- $status->setCarrier($this->_code);
161
- $status->setCarrierTitle($this->getConfigData('title'));
162
- $status->setTracking($tracking);
163
- $status->setPopup(1);
164
- $status->setUrl("https://www.nzpost.co.nz/tools/tracking/item/".$tracking);
165
- return $status;
166
- }
 
 
 
167
  }
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Pace extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
+ protected $_code = 'pace';
5
 
6
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
+ {
8
+ if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
+ return false;
10
+ }
11
+
12
+ $show = false;
13
  $price = 0;
14
  $doCalulate = $this->getConfigData('calculate');
15
+ if ($doCalulate==0) {
16
+ $show = true;
17
  $price = $this->getConfigData('price');
18
+
19
+ $result = Mage::getModel('shipping/rate_result');
20
+ $method = Mage::getModel('shipping/rate_result_method');
21
+ $method->setCarrier($this->_code);
22
+ $method->setMethod($this->_code);
23
+ $method->setCarrierTitle($this->getConfigData('title'));
24
+ $method->setMethodTitle($this->getConfigData('name'));
25
+ $method->setPrice($price);
26
+ $method->setCost($price);
27
+ $result->append($method);
28
  }
29
+ else {
30
+ try {
31
+ $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
32
+ if ($shipItApiKey == "") {
33
+ return false;
34
+ }
35
+
36
+ $origCountryId = $request->getCountryId(); //Package Source Country ID
37
+ $origRegionId = $request->getRegionId(); //Package Source Region ID
38
+ $origRegionCode = $request->getRegion(); //Package Source Region Code
39
+ $origCity = $request->getCity(); //Package Source City
40
+ $origPostcode = $request->getPostcode(); //Package Source Post Code
41
+
42
+ $destCountryId = $request->getDestCountryId();
43
+ $destCountry = $request->getDestCountry();
44
+ $destRegion = $request->getDestRegionId();
45
+ $destRegionCode = $request->getDestRegionCode();
46
+ $destFullStreet = $request->getDestStreet();
47
+ $destStreet = "";
48
+ $destSuburb = "";
49
+ $destCity = $request->getDestCity();
50
+ $destPostcode = $request->getDestPostcode();
51
+
52
+ $destFullStreetArray = explode("\n", $destFullStreet);
53
+ if ($destFullStreetArray[0] !== false)
54
+ $destStreet = $destFullStreetArray[0];
55
+ if ($destFullStreetArray[1] !== false)
56
+ $destSuburb = $destFullStreetArray[1];
57
+
58
+ $packageValue = $request->getPackageValue(); //Dest Package Value
59
+ $packageValueDiscout = $request->getPackageValueWithDiscount(); //Dest Package Value After Discount
60
+ $packageWeight = $request->getPackageWeight() * 1000; //Package Weight (grams)
61
+ $packageCurrency = $request->getPackageCurrency();
62
+
63
+ $url = 'https://api.shipit.click/rate?apiKey=' . $shipItApiKey . '&integration=magento&format=json';
64
+ $post_data = '{
65
+ "rate": {
66
+ "origin": {
67
+ "country": "' . $origCountryId . '",
68
+ "postal_code": "' . $origPostcode . '",
69
+ "province": "' . $origRegionCode . '",
70
+ "city": "' . $origCity . '",
71
+ "name": null,
72
+ "address1": null,
73
+ "address2": null,
74
+ "address3": null,
75
+ "phone": null,
76
+ "fax": null,
77
+ "address_type": null,
78
+ "company_name": null
79
+ },
80
+ "destination":{
81
+ "country": "' . $destCountryId . '",
82
+ "postal_code": "' . $destPostcode . '",
83
+ "province": "' . $destRegionCode . '",
84
+ "city": "' . $destCity . '",
85
+ "name": null,
86
+ "address1": "' . $destStreet . '",
87
+ "address2": "' . $destSuburb . '",
88
+ "address3": null,
89
+ "phone": null,
90
+ "fax": null,
91
+ "address_type": null,
92
+ "company_name": null
93
+ },
94
+ "items":[
95
+ {
96
+ "name": "Total Items",
97
+ "sku": null,
98
+ "quantity": 1,
99
+ "grams": ' . $packageWeight . ' ,
100
+ "price": ' . $packageValue . ',
101
+ "vendor": null,
102
+ "requires_shipping": true,
103
+ "taxable": true,
104
+ "fulfillment_service": "manual"
 
 
 
105
  }
106
+ ],
107
+ "currency": "' . $packageCurrency->getCurrencyCode() . '",
108
+ "carrierid": "19"
109
+ }
110
+ }';
111
+ $contentLength = strlen($post_data);
112
+
113
+ $ch = curl_init();
114
+ curl_setopt($ch, CURLOPT_URL, $url);
115
+ curl_setopt($ch, CURLOPT_HEADER, false);
116
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
117
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
118
+ curl_setopt($ch, CURLOPT_POST, true);
119
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
120
+ $response = curl_exec($ch);
121
+ curl_close($ch);
122
+
123
+ $json_obj = json_decode($response);
124
+ $rates_obj = $json_obj->{'rates'};
125
+
126
+ $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
127
+ $result = Mage::getModel('shipping/rate_result');
128
+
129
+ if (sizeof($rates_obj) > 0) {
130
+ $show = true;
131
+ }
132
 
133
+ if ($show) {
134
+ foreach ($rates_obj as $rate) {
135
+ if (is_object($rate)) {
136
+ // Add shipping option with shipping price
137
+ $method = Mage::getModel('shipping/rate_result_method');
138
+ $method->setCarrier($this->_code);
139
+ $method->setMethod($this->_code . $rate->{'service_code'});
140
+ $method->setCarrierTitle($this->getConfigData('title'));
141
+ $method->setMethodTitle($rate->{'service_name'});
142
+ $method->setPrice($rate->{'total_price'});
143
+ $method->setCost(0);
144
+ $result->append($method);
145
+ }
146
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  }
148
+ else {
149
+ $error = Mage::getModel('shipping/rate_result_error');
150
+ $error->setCarrier($this->_code);
151
+ $error->setCarrierTitle($this->getConfigData('name'));
152
+ $error->setErrorMessage($this->getConfigData('specificerrmsg'));
153
+ $result->append($error);
154
  }
155
+ }
156
+ catch (Exception $e) {
157
+ Mage::log($e->getMessage());
158
+ }
159
  }
160
 
161
+ return $result;
162
+ }
163
+
164
+ public function getAllowedMethods() {
165
+ return array('pace'=>$this->getConfigData('name'));
166
+ }
 
 
 
 
 
167
 
168
+ public function isTrackingAvailable() {
169
+ return true;
170
+ }
171
+
172
+ public function getTrackingInfo($tracking) {
173
+ $status = Mage::getModel('shipping/tracking_result_status');
174
+ $status->setCarrier($this->_code);
175
+ $status->setCarrierTitle($this->getConfigData('title'));
176
+ $status->setTracking($tracking);
177
+ $status->setPopup(1);
178
+ $status->setUrl("https://www.nzpost.co.nz/tools/tracking/item/".$tracking);
179
+ return $status;
180
+ }
181
  }
app/code/community/Rvtech/Starshipit/Model/Carrier/Shipit.php CHANGED
@@ -1,166 +1,180 @@
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Shipit extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
- protected $_code = 'shipit';
5
 
6
- public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
- {
8
- if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
- return false;
10
- }
 
 
11
  $price = 0;
12
  $doCalulate = $this->getConfigData('calculate');
13
- if ($doCalulate==0)
14
- {
15
  $price = $this->getConfigData('price');
 
 
 
 
 
 
 
 
 
 
16
  }
17
- else{
18
- try {
19
- $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
20
- if ($shipItApiKey == "") {
21
- return false;
22
- }
23
- $origCountryId = $request->getCountryId(); //Package Source Country ID
24
- $origRegionId = $request->getRegionId(); //Package Source Region ID
25
- $origRegionCode = $request->getRegion(); //Package Source Region Code
26
- $origCity = $request->getCity(); //Package Source City
27
- $origPostcode = $request->getPostcode(); //Package Source Post Code
28
-
29
- $destCountryId = $request->getDestCountryId();
30
- $destCountry = $request->getDestCountry();
31
- $destRegion = $request->getDestRegionId();
32
- $destRegionCode = $request->getDestRegionCode();
33
- $destFullStreet = $request->getDestStreet();
34
- $destStreet = "";
35
- $destSuburb = "";
36
- $destCity = $request->getDestCity();
37
- $destPostcode = $request->getDestPostcode();
38
-
39
- $destFullStreetArray = explode("\n", $destFullStreet);
40
- if ($destFullStreetArray[0] !== false)
41
- $destStreet = $destFullStreetArray[0];
42
- if ($destFullStreetArray[1] !== false)
43
- $destSuburb = $destFullStreetArray[1];
44
-
45
- $packageValue = $request->getPackageValue(); //Dest Package Value
46
- $packageValueDiscout = $request->getPackageValueWithDiscount(); //Dest Package Value After Discount
47
- $packageWeight = $request->getPackageWeight() * 1000; //Package Weight (grams)
48
- $packageCurrency = $request->getPackageCurrency();
49
-
50
- $url = 'https://api.shipit.click/rate?apiKey=' . $shipItApiKey . '&integration=magento&format=json';
51
- $post_data = '{
52
- "rate": {
53
- "origin": {
54
- "country": "' . $origCountryId . '",
55
- "postal_code": "' . $origPostcode . '",
56
- "province": "' . $origRegionCode . '",
57
- "city": "' . $origCity . '",
58
- "name": null,
59
- "address1": null,
60
- "address2": null,
61
- "address3": null,
62
- "phone": null,
63
- "fax": null,
64
- "address_type": null,
65
- "company_name": null
66
- },
67
- "destination":{
68
- "country": "' . $destCountryId . '",
69
- "postal_code": "' . $destPostcode . '",
70
- "province": "' . $destRegionCode . '",
71
- "city": "' . $destCity . '",
72
- "name": null,
73
- "address1": "' . $destStreet . '",
74
- "address2": "' . $destSuburb . '",
75
- "address3": null,
76
- "phone": null,
77
- "fax": null,
78
- "address_type": null,
79
- "company_name": null
80
- },
81
- "items":[
82
- {
83
- "name": "Total Items",
84
- "sku": null,
85
- "quantity": 1,
86
- "grams": ' . $packageWeight . ' ,
87
- "price": ' . $packageValue . ',
88
- "vendor": null,
89
- "requires_shipping": true,
90
- "taxable": true,
91
- "fulfillment_service": "manual"
92
- }
93
- ],
94
- "currency": "' . $packageCurrency->getCurrencyCode() . '"
95
  }
96
- }';
97
- $contentLength = strlen($post_data);
98
-
99
- $ch = curl_init();
100
- curl_setopt($ch, CURLOPT_URL, $url);
101
- curl_setopt($ch, CURLOPT_HEADER, false);
102
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
103
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
104
- curl_setopt($ch, CURLOPT_POST, true);
105
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
106
- $response = curl_exec($ch);
107
- curl_close($ch);
 
 
 
 
 
 
 
 
 
 
 
 
 
108
 
109
- $json_obj = json_decode($response);
110
- $rates_obj = $json_obj->{'rates'};
111
-
112
- $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
113
- $result = Mage::getModel('shipping/rate_result');
114
- $show = true;
115
- if($show){
116
- if(sizeof($rates_obj) > 0) {
117
- foreach($rates_obj as $rate) {
118
- if(is_object($rate)) {
119
- // Add shipping option with shipping price
120
- $method = Mage::getModel('shipping/rate_result_method');
121
- $method->setCarrier($this->_code);
122
- $method->setMethod($this->_code . $rate->{'service_code'});
123
- $method->setCarrierTitle($this->getConfigData('title'));
124
- $method->setMethodTitle($rate->{'service_name'});
125
- $method->setPrice($rate->{'total_price'});
126
- $method->setCost(0);
127
- $result->append($method);
128
- }
129
- }
130
- }
131
- }else{
132
- $error = Mage::getModel('shipping/rate_result_error');
133
- $error->setCarrier($this->_code);
134
- $error->setCarrierTitle($this->getConfigData('name'));
135
- $error->setErrorMessage($this->getConfigData('specificerrmsg'));
136
- $result->append($error);
137
- }
138
  }
139
- catch (Exception $e) {
140
- Mage::log($e->getMessage());
 
 
 
 
141
  }
 
 
 
 
142
  }
143
 
144
- return $result;
145
- }
146
- public function getAllowedMethods()
147
- {
148
- return array('shipit'=>$this->getConfigData('name'));
149
- }
150
-
151
- public function isTrackingAvailable()
152
- {
153
- return true;
154
- }
155
 
156
- public function getTrackingInfo($tracking)
157
- {
158
- $status = Mage::getModel('shipping/tracking_result_status');
159
- $status->setCarrier('shipit');
160
- $status->setCarrierTitle($this->getConfigData('title'));
161
- $status->setTracking($tracking);
162
- $status->setPopup(1);
163
- $status->setUrl("https://app.shipit.click/track-your-parcel?l=".$tracking);
164
- return $status;
165
- }
 
 
 
166
  }
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Shipit extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
+ protected $_code = 'shipit';
5
 
6
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
+ {
8
+ if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
+ return false;
10
+ }
11
+
12
+ $show = false;
13
  $price = 0;
14
  $doCalulate = $this->getConfigData('calculate');
15
+ if ($doCalulate==0) {
16
+ $show = true;
17
  $price = $this->getConfigData('price');
18
+
19
+ $result = Mage::getModel('shipping/rate_result');
20
+ $method = Mage::getModel('shipping/rate_result_method');
21
+ $method->setCarrier($this->_code);
22
+ $method->setMethod($this->_code);
23
+ $method->setCarrierTitle($this->getConfigData('title'));
24
+ $method->setMethodTitle($this->getConfigData('name'));
25
+ $method->setPrice($price);
26
+ $method->setCost($price);
27
+ $result->append($method);
28
  }
29
+ else {
30
+ try {
31
+ $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
32
+ if ($shipItApiKey == "") {
33
+ return false;
34
+ }
35
+
36
+ $origCountryId = $request->getCountryId(); //Package Source Country ID
37
+ $origRegionId = $request->getRegionId(); //Package Source Region ID
38
+ $origRegionCode = $request->getRegion(); //Package Source Region Code
39
+ $origCity = $request->getCity(); //Package Source City
40
+ $origPostcode = $request->getPostcode(); //Package Source Post Code
41
+
42
+ $destCountryId = $request->getDestCountryId();
43
+ $destCountry = $request->getDestCountry();
44
+ $destRegion = $request->getDestRegionId();
45
+ $destRegionCode = $request->getDestRegionCode();
46
+ $destFullStreet = $request->getDestStreet();
47
+ $destStreet = "";
48
+ $destSuburb = "";
49
+ $destCity = $request->getDestCity();
50
+ $destPostcode = $request->getDestPostcode();
51
+
52
+ $destFullStreetArray = explode("\n", $destFullStreet);
53
+ if ($destFullStreetArray[0] !== false)
54
+ $destStreet = $destFullStreetArray[0];
55
+ if ($destFullStreetArray[1] !== false)
56
+ $destSuburb = $destFullStreetArray[1];
57
+
58
+ $packageValue = $request->getPackageValue(); //Dest Package Value
59
+ $packageValueDiscout = $request->getPackageValueWithDiscount(); //Dest Package Value After Discount
60
+ $packageWeight = $request->getPackageWeight() * 1000; //Package Weight (grams)
61
+ $packageCurrency = $request->getPackageCurrency();
62
+
63
+ $url = 'https://api.shipit.click/rate?apiKey=' . $shipItApiKey . '&integration=magento&format=json';
64
+ $post_data = '{
65
+ "rate": {
66
+ "origin": {
67
+ "country": "' . $origCountryId . '",
68
+ "postal_code": "' . $origPostcode . '",
69
+ "province": "' . $origRegionCode . '",
70
+ "city": "' . $origCity . '",
71
+ "name": null,
72
+ "address1": null,
73
+ "address2": null,
74
+ "address3": null,
75
+ "phone": null,
76
+ "fax": null,
77
+ "address_type": null,
78
+ "company_name": null
79
+ },
80
+ "destination":{
81
+ "country": "' . $destCountryId . '",
82
+ "postal_code": "' . $destPostcode . '",
83
+ "province": "' . $destRegionCode . '",
84
+ "city": "' . $destCity . '",
85
+ "name": null,
86
+ "address1": "' . $destStreet . '",
87
+ "address2": "' . $destSuburb . '",
88
+ "address3": null,
89
+ "phone": null,
90
+ "fax": null,
91
+ "address_type": null,
92
+ "company_name": null
93
+ },
94
+ "items":[
95
+ {
96
+ "name": "Total Items",
97
+ "sku": null,
98
+ "quantity": 1,
99
+ "grams": ' . $packageWeight . ' ,
100
+ "price": ' . $packageValue . ',
101
+ "vendor": null,
102
+ "requires_shipping": true,
103
+ "taxable": true,
104
+ "fulfillment_service": "manual"
 
 
105
  }
106
+ ],
107
+ "currency": "' . $packageCurrency->getCurrencyCode() . '"
108
+ }
109
+ }';
110
+ $contentLength = strlen($post_data);
111
+
112
+ $ch = curl_init();
113
+ curl_setopt($ch, CURLOPT_URL, $url);
114
+ curl_setopt($ch, CURLOPT_HEADER, false);
115
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
116
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
117
+ curl_setopt($ch, CURLOPT_POST, true);
118
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
119
+ $response = curl_exec($ch);
120
+ curl_close($ch);
121
+
122
+ $json_obj = json_decode($response);
123
+ $rates_obj = $json_obj->{'rates'};
124
+
125
+ $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
126
+ $result = Mage::getModel('shipping/rate_result');
127
+
128
+ if (sizeof($rates_obj) > 0) {
129
+ $show = true;
130
+ }
131
 
132
+ if ($show) {
133
+ foreach ($rates_obj as $rate) {
134
+ if (is_object($rate)) {
135
+ // Add shipping option with shipping price
136
+ $method = Mage::getModel('shipping/rate_result_method');
137
+ $method->setCarrier($this->_code);
138
+ $method->setMethod($this->_code . $rate->{'service_code'});
139
+ $method->setCarrierTitle($this->getConfigData('title'));
140
+ $method->setMethodTitle($rate->{'service_name'});
141
+ $method->setPrice($rate->{'total_price'});
142
+ $method->setCost(0);
143
+ $result->append($method);
144
+ }
145
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  }
147
+ else {
148
+ $error = Mage::getModel('shipping/rate_result_error');
149
+ $error->setCarrier($this->_code);
150
+ $error->setCarrierTitle($this->getConfigData('name'));
151
+ $error->setErrorMessage($this->getConfigData('specificerrmsg'));
152
+ $result->append($error);
153
  }
154
+ }
155
+ catch (Exception $e) {
156
+ Mage::log($e->getMessage());
157
+ }
158
  }
159
 
160
+ return $result;
161
+ }
162
+
163
+ public function getAllowedMethods() {
164
+ return array('shipit'=>$this->getConfigData('name'));
165
+ }
 
 
 
 
 
166
 
167
+ public function isTrackingAvailable() {
168
+ return true;
169
+ }
170
+
171
+ public function getTrackingInfo($tracking) {
172
+ $status = Mage::getModel('shipping/tracking_result_status');
173
+ $status->setCarrier($this->_code);
174
+ $status->setCarrierTitle($this->getConfigData('title'));
175
+ $status->setTracking($tracking);
176
+ $status->setPopup(1);
177
+ $status->setUrl("https://app.shipit.click/track-your-parcel?l=".$tracking);
178
+ return $status;
179
+ }
180
  }
app/code/community/Rvtech/Starshipit/Model/Carrier/Startrack.php CHANGED
@@ -1,167 +1,181 @@
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Startrack extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
- protected $_code = 'startrack';
5
 
6
- public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
- {
8
- if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
- return false;
10
- }
 
 
11
  $price = 0;
12
  $doCalulate = $this->getConfigData('calculate');
13
- if ($doCalulate==0)
14
- {
15
  $price = $this->getConfigData('price');
 
 
 
 
 
 
 
 
 
 
16
  }
17
- else{
18
- try {
19
- $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
20
- if ($shipItApiKey == "") {
21
- return false;
22
- }
23
- $origCountryId = $request->getCountryId(); //Package Source Country ID
24
- $origRegionId = $request->getRegionId(); //Package Source Region ID
25
- $origRegionCode = $request->getRegion(); //Package Source Region Code
26
- $origCity = $request->getCity(); //Package Source City
27
- $origPostcode = $request->getPostcode(); //Package Source Post Code
28
-
29
- $destCountryId = $request->getDestCountryId();
30
- $destCountry = $request->getDestCountry();
31
- $destRegion = $request->getDestRegionId();
32
- $destRegionCode = $request->getDestRegionCode();
33
- $destFullStreet = $request->getDestStreet();
34
- $destStreet = "";
35
- $destSuburb = "";
36
- $destCity = $request->getDestCity();
37
- $destPostcode = $request->getDestPostcode();
38
-
39
- $destFullStreetArray = explode("\n", $destFullStreet);
40
- if ($destFullStreetArray[0] !== false)
41
- $destStreet = $destFullStreetArray[0];
42
- if ($destFullStreetArray[1] !== false)
43
- $destSuburb = $destFullStreetArray[1];
44
-
45
- $packageValue = $request->getPackageValue(); //Dest Package Value
46
- $packageValueDiscout = $request->getPackageValueWithDiscount(); //Dest Package Value After Discount
47
- $packageWeight = $request->getPackageWeight() * 1000; //Package Weight (grams)
48
- $packageCurrency = $request->getPackageCurrency();
49
-
50
- $url = 'https://api.shipit.click/rate?apiKey=' . $shipItApiKey . '&integration=magento&format=json';
51
- $post_data = '{
52
- "rate": {
53
- "origin": {
54
- "country": "' . $origCountryId . '",
55
- "postal_code": "' . $origPostcode . '",
56
- "province": "' . $origRegionCode . '",
57
- "city": "' . $origCity . '",
58
- "name": null,
59
- "address1": null,
60
- "address2": null,
61
- "address3": null,
62
- "phone": null,
63
- "fax": null,
64
- "address_type": null,
65
- "company_name": null
66
- },
67
- "destination":{
68
- "country": "' . $destCountryId . '",
69
- "postal_code": "' . $destPostcode . '",
70
- "province": "' . $destRegionCode . '",
71
- "city": "' . $destCity . '",
72
- "name": null,
73
- "address1": "' . $destStreet . '",
74
- "address2": "' . $destSuburb . '",
75
- "address3": null,
76
- "phone": null,
77
- "fax": null,
78
- "address_type": null,
79
- "company_name": null
80
- },
81
- "items":[
82
- {
83
- "name": "Total Items",
84
- "sku": null,
85
- "quantity": 1,
86
- "grams": ' . $packageWeight . ' ,
87
- "price": ' . $packageValue . ',
88
- "vendor": null,
89
- "requires_shipping": true,
90
- "taxable": true,
91
- "fulfillment_service": "manual"
92
- }
93
- ],
94
- "currency": "' . $packageCurrency->getCurrencyCode() . '",
95
- "carrierid": "18"
96
  }
97
- }';
98
- $contentLength = strlen($post_data);
99
-
100
- $ch = curl_init();
101
- curl_setopt($ch, CURLOPT_URL, $url);
102
- curl_setopt($ch, CURLOPT_HEADER, false);
103
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
104
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
105
- curl_setopt($ch, CURLOPT_POST, true);
106
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
107
- $response = curl_exec($ch);
108
- curl_close($ch);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
 
110
- $json_obj = json_decode($response);
111
- $rates_obj = $json_obj->{'rates'};
112
-
113
- $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
114
- $result = Mage::getModel('shipping/rate_result');
115
- $show = true;
116
- if($show){
117
- if(sizeof($rates_obj) > 0) {
118
- foreach($rates_obj as $rate) {
119
- if(is_object($rate)) {
120
- // Add shipping option with shipping price
121
- $method = Mage::getModel('shipping/rate_result_method');
122
- $method->setCarrier($this->_code);
123
- $method->setMethod($this->_code . $rate->{'service_code'});
124
- $method->setCarrierTitle($this->getConfigData('title'));
125
- $method->setMethodTitle($rate->{'service_name'});
126
- $method->setPrice($rate->{'total_price'});
127
- $method->setCost(0);
128
- $result->append($method);
129
- }
130
- }
131
- }
132
- }else{
133
- $error = Mage::getModel('shipping/rate_result_error');
134
- $error->setCarrier($this->_code);
135
- $error->setCarrierTitle($this->getConfigData('name'));
136
- $error->setErrorMessage($this->getConfigData('specificerrmsg'));
137
- $result->append($error);
138
- }
139
  }
140
- catch (Exception $e) {
141
- Mage::log($e->getMessage());
 
 
 
 
142
  }
 
 
 
 
143
  }
144
 
145
- return $result;
146
- }
147
- public function getAllowedMethods()
148
- {
149
- return array('startrack'=>$this->getConfigData('name'));
150
- }
151
-
152
- public function isTrackingAvailable()
153
- {
154
- return true;
155
- }
156
 
157
- public function getTrackingInfo($tracking)
158
- {
159
- $status = Mage::getModel('shipping/tracking_result_status');
160
- $status->setCarrier($this->_code);
161
- $status->setCarrierTitle($this->getConfigData('title'));
162
- $status->setTracking($tracking);
163
- $status->setPopup(1);
164
- $status->setUrl("http://www.startrack.com.au/track-trace/?id=".$tracking);
165
- return $status;
166
- }
 
 
 
167
  }
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Startrack extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
+ protected $_code = 'startrack';
5
 
6
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
+ {
8
+ if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
+ return false;
10
+ }
11
+
12
+ $show = false;
13
  $price = 0;
14
  $doCalulate = $this->getConfigData('calculate');
15
+ if ($doCalulate==0) {
16
+ $show = true;
17
  $price = $this->getConfigData('price');
18
+
19
+ $result = Mage::getModel('shipping/rate_result');
20
+ $method = Mage::getModel('shipping/rate_result_method');
21
+ $method->setCarrier($this->_code);
22
+ $method->setMethod($this->_code);
23
+ $method->setCarrierTitle($this->getConfigData('title'));
24
+ $method->setMethodTitle($this->getConfigData('name'));
25
+ $method->setPrice($price);
26
+ $method->setCost($price);
27
+ $result->append($method);
28
  }
29
+ else {
30
+ try {
31
+ $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
32
+ if ($shipItApiKey == "") {
33
+ return false;
34
+ }
35
+
36
+ $origCountryId = $request->getCountryId(); //Package Source Country ID
37
+ $origRegionId = $request->getRegionId(); //Package Source Region ID
38
+ $origRegionCode = $request->getRegion(); //Package Source Region Code
39
+ $origCity = $request->getCity(); //Package Source City
40
+ $origPostcode = $request->getPostcode(); //Package Source Post Code
41
+
42
+ $destCountryId = $request->getDestCountryId();
43
+ $destCountry = $request->getDestCountry();
44
+ $destRegion = $request->getDestRegionId();
45
+ $destRegionCode = $request->getDestRegionCode();
46
+ $destFullStreet = $request->getDestStreet();
47
+ $destStreet = "";
48
+ $destSuburb = "";
49
+ $destCity = $request->getDestCity();
50
+ $destPostcode = $request->getDestPostcode();
51
+
52
+ $destFullStreetArray = explode("\n", $destFullStreet);
53
+ if ($destFullStreetArray[0] !== false)
54
+ $destStreet = $destFullStreetArray[0];
55
+ if ($destFullStreetArray[1] !== false)
56
+ $destSuburb = $destFullStreetArray[1];
57
+
58
+ $packageValue = $request->getPackageValue(); //Dest Package Value
59
+ $packageValueDiscout = $request->getPackageValueWithDiscount(); //Dest Package Value After Discount
60
+ $packageWeight = $request->getPackageWeight() * 1000; //Package Weight (grams)
61
+ $packageCurrency = $request->getPackageCurrency();
62
+
63
+ $url = 'https://api.shipit.click/rate?apiKey=' . $shipItApiKey . '&integration=magento&format=json';
64
+ $post_data = '{
65
+ "rate": {
66
+ "origin": {
67
+ "country": "' . $origCountryId . '",
68
+ "postal_code": "' . $origPostcode . '",
69
+ "province": "' . $origRegionCode . '",
70
+ "city": "' . $origCity . '",
71
+ "name": null,
72
+ "address1": null,
73
+ "address2": null,
74
+ "address3": null,
75
+ "phone": null,
76
+ "fax": null,
77
+ "address_type": null,
78
+ "company_name": null
79
+ },
80
+ "destination":{
81
+ "country": "' . $destCountryId . '",
82
+ "postal_code": "' . $destPostcode . '",
83
+ "province": "' . $destRegionCode . '",
84
+ "city": "' . $destCity . '",
85
+ "name": null,
86
+ "address1": "' . $destStreet . '",
87
+ "address2": "' . $destSuburb . '",
88
+ "address3": null,
89
+ "phone": null,
90
+ "fax": null,
91
+ "address_type": null,
92
+ "company_name": null
93
+ },
94
+ "items":[
95
+ {
96
+ "name": "Total Items",
97
+ "sku": null,
98
+ "quantity": 1,
99
+ "grams": ' . $packageWeight . ' ,
100
+ "price": ' . $packageValue . ',
101
+ "vendor": null,
102
+ "requires_shipping": true,
103
+ "taxable": true,
104
+ "fulfillment_service": "manual"
 
 
 
105
  }
106
+ ],
107
+ "currency": "' . $packageCurrency->getCurrencyCode() . '",
108
+ "carrierid": "18"
109
+ }
110
+ }';
111
+ $contentLength = strlen($post_data);
112
+
113
+ $ch = curl_init();
114
+ curl_setopt($ch, CURLOPT_URL, $url);
115
+ curl_setopt($ch, CURLOPT_HEADER, false);
116
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
117
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
118
+ curl_setopt($ch, CURLOPT_POST, true);
119
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
120
+ $response = curl_exec($ch);
121
+ curl_close($ch);
122
+
123
+ $json_obj = json_decode($response);
124
+ $rates_obj = $json_obj->{'rates'};
125
+
126
+ $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
127
+ $result = Mage::getModel('shipping/rate_result');
128
+
129
+ if (sizeof($rates_obj) > 0) {
130
+ $show = true;
131
+ }
132
 
133
+ if ($show) {
134
+ foreach ($rates_obj as $rate) {
135
+ if (is_object($rate)) {
136
+ // Add shipping option with shipping price
137
+ $method = Mage::getModel('shipping/rate_result_method');
138
+ $method->setCarrier($this->_code);
139
+ $method->setMethod($this->_code . $rate->{'service_code'});
140
+ $method->setCarrierTitle($this->getConfigData('title'));
141
+ $method->setMethodTitle($rate->{'service_name'});
142
+ $method->setPrice($rate->{'total_price'});
143
+ $method->setCost(0);
144
+ $result->append($method);
145
+ }
146
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  }
148
+ else {
149
+ $error = Mage::getModel('shipping/rate_result_error');
150
+ $error->setCarrier($this->_code);
151
+ $error->setCarrierTitle($this->getConfigData('name'));
152
+ $error->setErrorMessage($this->getConfigData('specificerrmsg'));
153
+ $result->append($error);
154
  }
155
+ }
156
+ catch (Exception $e) {
157
+ Mage::log($e->getMessage());
158
+ }
159
  }
160
 
161
+ return $result;
162
+ }
163
+
164
+ public function getAllowedMethods() {
165
+ return array('startrack'=>$this->getConfigData('name'));
166
+ }
 
 
 
 
 
167
 
168
+ public function isTrackingAvailable() {
169
+ return true;
170
+ }
171
+
172
+ public function getTrackingInfo($tracking) {
173
+ $status = Mage::getModel('shipping/tracking_result_status');
174
+ $status->setCarrier($this->_code);
175
+ $status->setCarrierTitle($this->getConfigData('title'));
176
+ $status->setTracking($tracking);
177
+ $status->setPopup(1);
178
+ $status->setUrl("http://www.startrack.com.au/track-trace/?id=".$tracking);
179
+ return $status;
180
+ }
181
  }
app/code/community/Rvtech/Starshipit/Model/Carrier/Startrackexpress.php CHANGED
@@ -1,167 +1,181 @@
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Startrackexpress extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
- protected $_code = 'startrackexpress';
5
 
6
- public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
- {
8
- if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
- return false;
10
- }
 
 
11
  $price = 0;
12
  $doCalulate = $this->getConfigData('calculate');
13
- if ($doCalulate==0)
14
- {
15
  $price = $this->getConfigData('price');
 
 
 
 
 
 
 
 
 
 
16
  }
17
- else{
18
- try {
19
- $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
20
- if ($shipItApiKey == "") {
21
- return false;
22
- }
23
- $origCountryId = $request->getCountryId(); //Package Source Country ID
24
- $origRegionId = $request->getRegionId(); //Package Source Region ID
25
- $origRegionCode = $request->getRegion(); //Package Source Region Code
26
- $origCity = $request->getCity(); //Package Source City
27
- $origPostcode = $request->getPostcode(); //Package Source Post Code
28
-
29
- $destCountryId = $request->getDestCountryId();
30
- $destCountry = $request->getDestCountry();
31
- $destRegion = $request->getDestRegionId();
32
- $destRegionCode = $request->getDestRegionCode();
33
- $destFullStreet = $request->getDestStreet();
34
- $destStreet = "";
35
- $destSuburb = "";
36
- $destCity = $request->getDestCity();
37
- $destPostcode = $request->getDestPostcode();
38
-
39
- $destFullStreetArray = explode("\n", $destFullStreet);
40
- if ($destFullStreetArray[0] !== false)
41
- $destStreet = $destFullStreetArray[0];
42
- if ($destFullStreetArray[1] !== false)
43
- $destSuburb = $destFullStreetArray[1];
44
-
45
- $packageValue = $request->getPackageValue(); //Dest Package Value
46
- $packageValueDiscout = $request->getPackageValueWithDiscount(); //Dest Package Value After Discount
47
- $packageWeight = $request->getPackageWeight() * 1000; //Package Weight (grams)
48
- $packageCurrency = $request->getPackageCurrency();
49
-
50
- $url = 'https://api.shipit.click/rate?apiKey=' . $shipItApiKey . '&integration=magento&format=json';
51
- $post_data = '{
52
- "rate": {
53
- "origin": {
54
- "country": "' . $origCountryId . '",
55
- "postal_code": "' . $origPostcode . '",
56
- "province": "' . $origRegionCode . '",
57
- "city": "' . $origCity . '",
58
- "name": null,
59
- "address1": null,
60
- "address2": null,
61
- "address3": null,
62
- "phone": null,
63
- "fax": null,
64
- "address_type": null,
65
- "company_name": null
66
- },
67
- "destination":{
68
- "country": "' . $destCountryId . '",
69
- "postal_code": "' . $destPostcode . '",
70
- "province": "' . $destRegionCode . '",
71
- "city": "' . $destCity . '",
72
- "name": null,
73
- "address1": "' . $destStreet . '",
74
- "address2": "' . $destSuburb . '",
75
- "address3": null,
76
- "phone": null,
77
- "fax": null,
78
- "address_type": null,
79
- "company_name": null
80
- },
81
- "items":[
82
- {
83
- "name": "Total Items",
84
- "sku": null,
85
- "quantity": 1,
86
- "grams": ' . $packageWeight . ' ,
87
- "price": ' . $packageValue . ',
88
- "vendor": null,
89
- "requires_shipping": true,
90
- "taxable": true,
91
- "fulfillment_service": "manual"
92
- }
93
- ],
94
- "currency": "' . $packageCurrency->getCurrencyCode() . '",
95
- "carrierid": "20"
96
  }
97
- }';
98
- $contentLength = strlen($post_data);
99
-
100
- $ch = curl_init();
101
- curl_setopt($ch, CURLOPT_URL, $url);
102
- curl_setopt($ch, CURLOPT_HEADER, false);
103
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
104
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
105
- curl_setopt($ch, CURLOPT_POST, true);
106
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
107
- $response = curl_exec($ch);
108
- curl_close($ch);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
 
110
- $json_obj = json_decode($response);
111
- $rates_obj = $json_obj->{'rates'};
112
-
113
- $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
114
- $result = Mage::getModel('shipping/rate_result');
115
- $show = true;
116
- if($show){
117
- if(sizeof($rates_obj) > 0) {
118
- foreach($rates_obj as $rate) {
119
- if(is_object($rate)) {
120
- // Add shipping option with shipping price
121
- $method = Mage::getModel('shipping/rate_result_method');
122
- $method->setCarrier($this->_code);
123
- $method->setMethod($this->_code . $rate->{'service_code'});
124
- $method->setCarrierTitle($this->getConfigData('title'));
125
- $method->setMethodTitle($rate->{'service_name'});
126
- $method->setPrice($rate->{'total_price'});
127
- $method->setCost(0);
128
- $result->append($method);
129
- }
130
- }
131
- }
132
- }else{
133
- $error = Mage::getModel('shipping/rate_result_error');
134
- $error->setCarrier($this->_code);
135
- $error->setCarrierTitle($this->getConfigData('name'));
136
- $error->setErrorMessage($this->getConfigData('specificerrmsg'));
137
- $result->append($error);
138
- }
139
  }
140
- catch (Exception $e) {
141
- Mage::log($e->getMessage());
 
 
 
 
142
  }
 
 
 
 
143
  }
144
 
145
- return $result;
146
- }
147
- public function getAllowedMethods()
148
- {
149
- return array('startrackexpress'=>$this->getConfigData('name'));
150
- }
151
-
152
- public function isTrackingAvailable()
153
- {
154
- return true;
155
- }
156
 
157
- public function getTrackingInfo($tracking)
158
- {
159
- $status = Mage::getModel('shipping/tracking_result_status');
160
- $status->setCarrier($this->_code);
161
- $status->setCarrierTitle($this->getConfigData('title'));
162
- $status->setTracking($tracking);
163
- $status->setPopup(1);
164
- $status->setUrl("http://www.startrack.com.au/track-trace/?id=".$tracking);
165
- return $status;
166
- }
 
 
 
167
  }
1
  <?php
2
  class Rvtech_Starshipit_Model_Carrier_Startrackexpress extends Mage_Shipping_Model_Carrier_Abstract
3
  implements Mage_Shipping_Model_Carrier_Interface {
4
+ protected $_code = 'startrackexpress';
5
 
6
+ public function collectRates(Mage_Shipping_Model_Rate_Request $request)
7
+ {
8
+ if (!Mage::getStoreConfig('carriers/'.$this->_code.'/active')) {
9
+ return false;
10
+ }
11
+
12
+ $show = false;
13
  $price = 0;
14
  $doCalulate = $this->getConfigData('calculate');
15
+ if ($doCalulate==0) {
16
+ $show = true;
17
  $price = $this->getConfigData('price');
18
+
19
+ $result = Mage::getModel('shipping/rate_result');
20
+ $method = Mage::getModel('shipping/rate_result_method');
21
+ $method->setCarrier($this->_code);
22
+ $method->setMethod($this->_code);
23
+ $method->setCarrierTitle($this->getConfigData('title'));
24
+ $method->setMethodTitle($this->getConfigData('name'));
25
+ $method->setPrice($price);
26
+ $method->setCost($price);
27
+ $result->append($method);
28
  }
29
+ else {
30
+ try {
31
+ $shipItApiKey = Mage::helper('shipnote')->getShipItApiKey();
32
+ if ($shipItApiKey == "") {
33
+ return false;
34
+ }
35
+
36
+ $origCountryId = $request->getCountryId(); //Package Source Country ID
37
+ $origRegionId = $request->getRegionId(); //Package Source Region ID
38
+ $origRegionCode = $request->getRegion(); //Package Source Region Code
39
+ $origCity = $request->getCity(); //Package Source City
40
+ $origPostcode = $request->getPostcode(); //Package Source Post Code
41
+
42
+ $destCountryId = $request->getDestCountryId();
43
+ $destCountry = $request->getDestCountry();
44
+ $destRegion = $request->getDestRegionId();
45
+ $destRegionCode = $request->getDestRegionCode();
46
+ $destFullStreet = $request->getDestStreet();
47
+ $destStreet = "";
48
+ $destSuburb = "";
49
+ $destCity = $request->getDestCity();
50
+ $destPostcode = $request->getDestPostcode();
51
+
52
+ $destFullStreetArray = explode("\n", $destFullStreet);
53
+ if ($destFullStreetArray[0] !== false)
54
+ $destStreet = $destFullStreetArray[0];
55
+ if ($destFullStreetArray[1] !== false)
56
+ $destSuburb = $destFullStreetArray[1];
57
+
58
+ $packageValue = $request->getPackageValue(); //Dest Package Value
59
+ $packageValueDiscout = $request->getPackageValueWithDiscount(); //Dest Package Value After Discount
60
+ $packageWeight = $request->getPackageWeight() * 1000; //Package Weight (grams)
61
+ $packageCurrency = $request->getPackageCurrency();
62
+
63
+ $url = 'https://api.shipit.click/rate?apiKey=' . $shipItApiKey . '&integration=magento&format=json';
64
+ $post_data = '{
65
+ "rate": {
66
+ "origin": {
67
+ "country": "' . $origCountryId . '",
68
+ "postal_code": "' . $origPostcode . '",
69
+ "province": "' . $origRegionCode . '",
70
+ "city": "' . $origCity . '",
71
+ "name": null,
72
+ "address1": null,
73
+ "address2": null,
74
+ "address3": null,
75
+ "phone": null,
76
+ "fax": null,
77
+ "address_type": null,
78
+ "company_name": null
79
+ },
80
+ "destination":{
81
+ "country": "' . $destCountryId . '",
82
+ "postal_code": "' . $destPostcode . '",
83
+ "province": "' . $destRegionCode . '",
84
+ "city": "' . $destCity . '",
85
+ "name": null,
86
+ "address1": "' . $destStreet . '",
87
+ "address2": "' . $destSuburb . '",
88
+ "address3": null,
89
+ "phone": null,
90
+ "fax": null,
91
+ "address_type": null,
92
+ "company_name": null
93
+ },
94
+ "items":[
95
+ {
96
+ "name": "Total Items",
97
+ "sku": null,
98
+ "quantity": 1,
99
+ "grams": ' . $packageWeight . ' ,
100
+ "price": ' . $packageValue . ',
101
+ "vendor": null,
102
+ "requires_shipping": true,
103
+ "taxable": true,
104
+ "fulfillment_service": "manual"
 
 
 
105
  }
106
+ ],
107
+ "currency": "' . $packageCurrency->getCurrencyCode() . '",
108
+ "carrierid": "20"
109
+ }
110
+ }';
111
+ $contentLength = strlen($post_data);
112
+
113
+ $ch = curl_init();
114
+ curl_setopt($ch, CURLOPT_URL, $url);
115
+ curl_setopt($ch, CURLOPT_HEADER, false);
116
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
117
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
118
+ curl_setopt($ch, CURLOPT_POST, true);
119
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
120
+ $response = curl_exec($ch);
121
+ curl_close($ch);
122
+
123
+ $json_obj = json_decode($response);
124
+ $rates_obj = $json_obj->{'rates'};
125
+
126
+ $handling = Mage::getStoreConfig('carriers/'.$this->_code.'/handling');
127
+ $result = Mage::getModel('shipping/rate_result');
128
+
129
+ if (sizeof($rates_obj) > 0) {
130
+ $show = true;
131
+ }
132
 
133
+ if ($show) {
134
+ foreach ($rates_obj as $rate) {
135
+ if (is_object($rate)) {
136
+ // Add shipping option with shipping price
137
+ $method = Mage::getModel('shipping/rate_result_method');
138
+ $method->setCarrier($this->_code);
139
+ $method->setMethod($this->_code . $rate->{'service_code'});
140
+ $method->setCarrierTitle($this->getConfigData('title'));
141
+ $method->setMethodTitle($rate->{'service_name'});
142
+ $method->setPrice($rate->{'total_price'});
143
+ $method->setCost(0);
144
+ $result->append($method);
145
+ }
146
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
147
  }
148
+ else {
149
+ $error = Mage::getModel('shipping/rate_result_error');
150
+ $error->setCarrier($this->_code);
151
+ $error->setCarrierTitle($this->getConfigData('name'));
152
+ $error->setErrorMessage($this->getConfigData('specificerrmsg'));
153
+ $result->append($error);
154
  }
155
+ }
156
+ catch (Exception $e) {
157
+ Mage::log($e->getMessage());
158
+ }
159
  }
160
 
161
+ return $result;
162
+ }
163
+
164
+ public function getAllowedMethods() {
165
+ return array('startrackexpress'=>$this->getConfigData('name'));
166
+ }
 
 
 
 
 
167
 
168
+ public function isTrackingAvailable() {
169
+ return true;
170
+ }
171
+
172
+ public function getTrackingInfo($tracking) {
173
+ $status = Mage::getModel('shipping/tracking_result_status');
174
+ $status->setCarrier($this->_code);
175
+ $status->setCarrierTitle($this->getConfigData('title'));
176
+ $status->setTracking($tracking);
177
+ $status->setPopup(1);
178
+ $status->setUrl("http://www.startrack.com.au/track-trace/?id=".$tracking);
179
+ return $status;
180
+ }
181
  }
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Rvtech_Starshipit</name>
4
- <version>1.6.4.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
@@ -18,12 +18,12 @@ From ShipIT shipping labels can be produced, tracking of orders is supported, qu
18
  DHL Express Worldwide is supported as well &#xD;
19
  &#xD;
20
  Australia Post eParcel, CourierPost, Fastways, and more.</description>
21
- <notes>- Added StarTrack Shipping Method&#xD;
22
- - Added Rates at Checkout for StarTrack carrier</notes>
23
  <authors><author><name>George Plummer</name><user>GeorgeSPlummer</user><email>george@shipit.click</email></author></authors>
24
- <date>2016-04-08</date>
25
- <time>01:09:43</time>
26
- <contents><target name="mageetc"><dir name="modules"><file name="Rvtech_Starshipit.xml" hash="5f957b335ffd3ef220188acc0a4261c2"/></dir></target><target name="magecommunity"><dir name="Rvtech"><dir name="Starshipit"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="Create"><file name="Shipnote.php" hash="e3978a998056ca01f2c1eecadad492f9"/></dir><file name="Note.php" hash="b176725ad1d11312fc9b2e6da10300a3"/></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="bef51209ace24c39e1d0933c4695665c"/><file name="Syncbutton.php" hash="1b90bc1d0ce6f8fd85783771ffc3720b"/></dir></dir></dir></dir><file name="Note.php" hash="d89159b063408b3496b5a7c1238b9f90"/><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="bcec9d256397a5c39879eba37520370e"/><file name="View.php" hash="bee1026715c9a99d4d0ab31c2cb58325"/></dir></dir><file name="Ship.php" hash="19080a45c06dc07b7991dd694d83708a"/><file name="Shiptracking.php" hash="a64dbb626cb60a3f62994564e0d3e288"/></dir><dir name="Helper"><file name="Data.php" hash="09a753bbbc36ce95a6222587d53cd1c1"/><file name="Starship.php" hash="ebc879a96df5c80ffae9744d11a6cac5"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Observer.php" hash="2956099cbc3109242139fb0b8e07ba47"/></dir><file name="Api.php" hash="9c0c7ad4df68db05f5caf2970b91a542"/><dir name="Carrier"><file name="Auspost.php" hash="73507c7a8e26ec0cd7f6a2583b0e4a4e"/><file name="Courierpost.php" hash="f1c57b20698f9601cecbb25ed9c4eaaa"/><file name="Couriersplease.php" hash="54f0f919582c8d83f6c60c1b895c685d"/><file name="Dhlexpress.php" hash="17b5b984bd27e024c09c6a3e781e411c"/><file name="Fastway.php" hash="db29d58c52e6d12727f43594387286b5"/><file name="Nzpost.php" hash="4588176d3ace5354fdbcc492fcbb0b42"/><file name="Pace.php" hash="20f4c1fb597804ebcc5b8a2635b122d6"/><file name="Shipit.php" hash="4885844bdc91ed748a1a458f7372f7eb"/><file name="Startrack.php" hash="8a45ad454c597df82b52c1e3d0336874"/><file name="Startrackexpress.php" hash="e0eb4ff34a0d56f8b099f48c833420b9"/></dir><file name="Note.php" hash="91fdbf3caa65797d8050e999a487c4ae"/><file name="Observer.php" hash="c21ae81b45649c886a30a2a9b6c99425"/><file name="Orders.php" hash="5e6d34681f4ffde9b8b0fcad9f898481"/><dir name="Resource"><dir name="Note"><file name="Collection.php" hash="2526c09006bf6a74b1ddcf2d94b85bd1"/></dir><file name="Note.php" hash="188639765c95bb03abf24785bbcfabbe"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ShipItController.php" hash="7a82038aa1b2e9fd8bc543b402dcbf9a"/></dir><file name="IndexController.php" hash="20b9637c3eb1a5e7c6a97faa72a0a3fb"/></dir><dir name="etc"><file name="adminhtml.xml" hash="02121bfdaabeb4aa30733462d532b211"/><file name="api.xml" hash="03ba9d58ced7f06da747006e8ddf6861"/><file name="config.xml" hash="4b619f8ed4dbfd9ccfb7c7f2651b48a7"/><file name="system.xml" hash="837db42e1eb469603a3c002537f3d6d8"/></dir><dir name="sql"><dir name="shipnote_setup"><file name="install-1.6.2.0.php" hash="3440e960c4ae3a4036c797c02703f025"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="shipit.xml" hash="61408954f82f5ac2edcf77d859fd4591"/><file name="shipnote.xml" hash="b30f8ced0fa77550a09c3ab5ee03f28d"/></dir><dir name="template"><dir name="shipit"><dir name="system"><dir name="config"><file name="button.phtml" hash="064f053f67fc7b749d1aec40cd352ce1"/><file name="syncbutton.phtml" hash="3e67731254d4d0298891cd2598471dc9"/></dir></dir></dir><dir name="shipnote"><file name="note-create.phtml" hash="218318453338adb8a43d01dcf3aa74f3"/><file name="note.phtml" hash="dc72f98a11c955181a3d4706e9cfd297"/><dir name="sales"><dir name="order"><dir name="create"><file name="data.phtml" hash="63aa7c2343f1d801b92e61b8497b99cb"/><file name="shipnote.phtml" hash="101f8cbd09937b1c9b232a94592e72dd"/></dir><dir name="creditmemo"><dir name="create"><file name="form.phtml" hash="95b2ca2ff1b2d48519cc9f0302179804"/></dir><dir name="view"><file name="form.phtml" hash="0b851bb2da3a68d6b21195cc88d9c3a3"/></dir></dir><dir name="invoice"><dir name="create"><file name="form.phtml" hash="00a1d471675697ff345fb8744b337a54"/></dir><dir name="view"><file name="form.phtml" hash="eb85ea9873900429a859f31585ecb93b"/></dir></dir><dir name="shipment"><dir name="create"><file name="form.phtml" hash="6655a2814e346290ebefce2d45225127"/></dir><dir name="view"><file name="form.phtml" hash="1f5790819a38b162f76a32ec725a0b77"/></dir></dir><dir name="view"><dir name="tab"><file name="info.phtml" hash="66fd085aa3d4e985f914e61ef4ca6748"/></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="shipnote.xml" hash="4662d0b069083e71689f79ad5ce0102e"/><file name="addressautocomplete.xml" hash="88a6cbeb5077d85cac0e98632b467b2a"/><file name="shiptracking.xml" hash="cd598d60854e00759d7e201a9b819a65"/></dir><dir name="template"><dir name="shipnote"><file name="note.phtml" hash="f6199bbe2739b4689cadd2a854a3d753"/></dir><dir name="shiptracking"><file name="shiptracking.phtml" hash="dc155a0bf7d2d83579492d432de1a6f9"/><file name="trackdetail.phtml" hash="1e6967f50a922088ec1aaf9d23910163"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="en_GB"><file name="Rvtech_StarshipitNote.csv" hash="45582b181cd95563d26e516d9dc5efe4"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="shipnote.css" hash="1cd880ba6ee2ae963fd8b6208d9e6fd8"/></dir><dir name="js"><dir name="shipit"><file name="jquery-1.10.2.min.js" hash="628072e7212db1e8cdacb22b21752cda"/><file name="noconflict.js" hash="3179f2255b046d5f2e9a71e365287bef"/><file name="onstepcheckout.js" hash="c58f76856d83f7a72dbc30b3295f015b"/><file name="onstepcheckout_shipping.js" hash="01ad944a649fff8f20537af9ca4d3faa"/></dir></dir><dir name="shiptracking"><dir name="css"><file name="shiptracking.css" hash="71583b99e56b8cc1ebd9b575e17e9414"/></dir><dir name="images"><file name="ajax-loader-tr.gif" hash="01a95f2b5387dfec28b58bab64aa32ae"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="shipit"><dir name="adminhtml"><file name="grid.js" hash="dbf45931948c6c611e1af954ae2430e5"/></dir></dir></dir></target></contents>
27
  <compatible/>
28
- <dependencies><required><php><min>5.1.0</min><max>7.0.5</max></php></required></dependencies>
29
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Rvtech_Starshipit</name>
4
+ <version>1.6.5.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
18
  DHL Express Worldwide is supported as well &#xD;
19
  &#xD;
20
  Australia Post eParcel, CourierPost, Fastways, and more.</description>
21
+ <notes>- Updated rates at checkout API for all carriers&#xD;
22
+ - Added support for recent PHP releases</notes>
23
  <authors><author><name>George Plummer</name><user>GeorgeSPlummer</user><email>george@shipit.click</email></author></authors>
24
+ <date>2016-09-27</date>
25
+ <time>22:29:59</time>
26
+ <contents><target name="mageetc"><dir name="modules"><file name="Rvtech_Starshipit.xml" hash="5f957b335ffd3ef220188acc0a4261c2"/></dir></target><target name="magecommunity"><dir name="Rvtech"><dir name="Starshipit"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="Create"><file name="Shipnote.php" hash="e3978a998056ca01f2c1eecadad492f9"/></dir><file name="Note.php" hash="b176725ad1d11312fc9b2e6da10300a3"/></dir></dir><dir name="System"><dir name="Config"><dir name="Form"><file name="Button.php" hash="bef51209ace24c39e1d0933c4695665c"/><file name="Syncbutton.php" hash="1b90bc1d0ce6f8fd85783771ffc3720b"/></dir></dir></dir></dir><file name="Note.php" hash="d89159b063408b3496b5a7c1238b9f90"/><dir name="Sales"><dir name="Order"><file name="Grid.php" hash="bcec9d256397a5c39879eba37520370e"/><file name="View.php" hash="bee1026715c9a99d4d0ab31c2cb58325"/></dir></dir><file name="Ship.php" hash="19080a45c06dc07b7991dd694d83708a"/><file name="Shiptracking.php" hash="a64dbb626cb60a3f62994564e0d3e288"/></dir><dir name="Helper"><file name="Data.php" hash="09a753bbbc36ce95a6222587d53cd1c1"/><file name="Starship.php" hash="ebc879a96df5c80ffae9744d11a6cac5"/></dir><dir name="Model"><dir name="Adminhtml"><file name="Observer.php" hash="2956099cbc3109242139fb0b8e07ba47"/></dir><file name="Api.php" hash="9c0c7ad4df68db05f5caf2970b91a542"/><dir name="Carrier"><file name="Auspost.php" hash="46f89ad1bb974e9bb467393f7afc88af"/><file name="Courierpost.php" hash="6991245610e5dab49c80eaa78d750c91"/><file name="Couriersplease.php" hash="a6ad5ce45687756cc8433d3e917d625b"/><file name="Dhlexpress.php" hash="a477bb792b202b346bab76ddc5bf7ddd"/><file name="Fastway.php" hash="c1e8750933e7e63ec9b5e2b1dc44f488"/><file name="Nzpost.php" hash="7e0dcf7cb19d258f709b9a589e14950b"/><file name="Pace.php" hash="81f0b6a8245e62b8b06999268b398b98"/><file name="Shipit.php" hash="1af1829820ffd182d58bfe8ec885fdc4"/><file name="Startrack.php" hash="f79d611788e3b3646ce76318179e501f"/><file name="Startrackexpress.php" hash="e268a24e96d84bd475d9be4ea3a8e24f"/></dir><file name="Note.php" hash="91fdbf3caa65797d8050e999a487c4ae"/><file name="Observer.php" hash="c21ae81b45649c886a30a2a9b6c99425"/><file name="Orders.php" hash="5e6d34681f4ffde9b8b0fcad9f898481"/><dir name="Resource"><dir name="Note"><file name="Collection.php" hash="2526c09006bf6a74b1ddcf2d94b85bd1"/></dir><file name="Note.php" hash="188639765c95bb03abf24785bbcfabbe"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="ShipItController.php" hash="7a82038aa1b2e9fd8bc543b402dcbf9a"/></dir><file name="IndexController.php" hash="20b9637c3eb1a5e7c6a97faa72a0a3fb"/></dir><dir name="etc"><file name="adminhtml.xml" hash="02121bfdaabeb4aa30733462d532b211"/><file name="api.xml" hash="03ba9d58ced7f06da747006e8ddf6861"/><file name="config.xml" hash="4b619f8ed4dbfd9ccfb7c7f2651b48a7"/><file name="system.xml" hash="837db42e1eb469603a3c002537f3d6d8"/></dir><dir name="sql"><dir name="shipnote_setup"><file name="install-1.6.2.0.php" hash="3440e960c4ae3a4036c797c02703f025"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="shipit.xml" hash="61408954f82f5ac2edcf77d859fd4591"/><file name="shipnote.xml" hash="b30f8ced0fa77550a09c3ab5ee03f28d"/></dir><dir name="template"><dir name="shipit"><dir name="system"><dir name="config"><file name="button.phtml" hash="064f053f67fc7b749d1aec40cd352ce1"/><file name="syncbutton.phtml" hash="3e67731254d4d0298891cd2598471dc9"/></dir></dir></dir><dir name="shipnote"><file name="note-create.phtml" hash="218318453338adb8a43d01dcf3aa74f3"/><file name="note.phtml" hash="dc72f98a11c955181a3d4706e9cfd297"/><dir name="sales"><dir name="order"><dir name="create"><file name="data.phtml" hash="63aa7c2343f1d801b92e61b8497b99cb"/><file name="shipnote.phtml" hash="101f8cbd09937b1c9b232a94592e72dd"/></dir><dir name="creditmemo"><dir name="create"><file name="form.phtml" hash="95b2ca2ff1b2d48519cc9f0302179804"/></dir><dir name="view"><file name="form.phtml" hash="0b851bb2da3a68d6b21195cc88d9c3a3"/></dir></dir><dir name="invoice"><dir name="create"><file name="form.phtml" hash="00a1d471675697ff345fb8744b337a54"/></dir><dir name="view"><file name="form.phtml" hash="eb85ea9873900429a859f31585ecb93b"/></dir></dir><dir name="shipment"><dir name="create"><file name="form.phtml" hash="6655a2814e346290ebefce2d45225127"/></dir><dir name="view"><file name="form.phtml" hash="1f5790819a38b162f76a32ec725a0b77"/></dir></dir><dir name="view"><dir name="tab"><file name="info.phtml" hash="66fd085aa3d4e985f914e61ef4ca6748"/></dir></dir></dir></dir></dir></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="shipnote.xml" hash="4662d0b069083e71689f79ad5ce0102e"/><file name="addressautocomplete.xml" hash="88a6cbeb5077d85cac0e98632b467b2a"/><file name="shiptracking.xml" hash="cd598d60854e00759d7e201a9b819a65"/></dir><dir name="template"><dir name="shipnote"><file name="note.phtml" hash="f6199bbe2739b4689cadd2a854a3d753"/></dir><dir name="shiptracking"><file name="shiptracking.phtml" hash="dc155a0bf7d2d83579492d432de1a6f9"/><file name="trackdetail.phtml" hash="1e6967f50a922088ec1aaf9d23910163"/></dir></dir></dir></dir></dir></target><target name="magelocale"><dir><dir name="en_GB"><file name="Rvtech_StarshipitNote.csv" hash="45582b181cd95563d26e516d9dc5efe4"/></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="shipnote.css" hash="1cd880ba6ee2ae963fd8b6208d9e6fd8"/></dir><dir name="js"><dir name="shipit"><file name="jquery-1.10.2.min.js" hash="628072e7212db1e8cdacb22b21752cda"/><file name="noconflict.js" hash="3179f2255b046d5f2e9a71e365287bef"/><file name="onstepcheckout.js" hash="c58f76856d83f7a72dbc30b3295f015b"/><file name="onstepcheckout_shipping.js" hash="01ad944a649fff8f20537af9ca4d3faa"/></dir></dir><dir name="shiptracking"><dir name="css"><file name="shiptracking.css" hash="71583b99e56b8cc1ebd9b575e17e9414"/></dir><dir name="images"><file name="ajax-loader-tr.gif" hash="01a95f2b5387dfec28b58bab64aa32ae"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="shipit"><dir name="adminhtml"><file name="grid.js" hash="dbf45931948c6c611e1af954ae2430e5"/></dir></dir></dir></target></contents>
27
  <compatible/>
28
+ <dependencies><required><php><min>5.1.0</min><max>7.0.10</max></php></required></dependencies>
29
  </package>