Raveinfosys_Freightshipping - Version 0.1.1

Version Notes

This is stable version of this extension and has been tested on various version of community editions.
In this particular version we are supporting it to run on PHP V 5.5.X

Download this release

Release Info

Developer Rave Infosys
Extension Raveinfosys_Freightshipping
Version 0.1.1
Comparing to
See all releases


Code changes from version 0.1.0 to 0.1.1

app/code/local/Raveinfosys/Freightshipping/Model/Carrier/Abstract.php CHANGED
@@ -43,13 +43,14 @@ abstract class Raveinfosys_Freightshipping_Model_Carrier_Abstract
43
  if($this->_result){
44
  $result = Mage::getModel('shipping/rate_result');
45
  foreach($this->_result as $_method) {
 
46
  $method = Mage::getModel('shipping/rate_result_method');
47
  $method->setCarrier($_method['carrier']);
48
  $method->setCarrierTitle($_method['carrier']);
49
  $method->setMethod($_method['code']);
50
  $method->setMethodTitle($_method['method']);
51
- $method->setPrice($_method['rates']);
52
- $method->setCost($_method['rates']);
53
  $result->append($method);
54
  }
55
  } elseif($this->_result === false) {
@@ -130,6 +131,7 @@ abstract class Raveinfosys_Freightshipping_Model_Carrier_Abstract
130
  if($this->getConfigValue('handlingfee_type', $this->_code) == 'F') {
131
  $_rates = $_rates + $this->getConfigValue('handlingfee', $this->_code);
132
  } elseif($this->getConfigValue('handlingfee_type', $this->_code) == 'P') {
 
133
  $_rates = $_rates + ($_rates*$_handlingFee/100);
134
  }
135
  return $_rates;
43
  if($this->_result){
44
  $result = Mage::getModel('shipping/rate_result');
45
  foreach($this->_result as $_method) {
46
+ $finalRates = $this->calculateHandlingFee($_method['rates']);
47
  $method = Mage::getModel('shipping/rate_result_method');
48
  $method->setCarrier($_method['carrier']);
49
  $method->setCarrierTitle($_method['carrier']);
50
  $method->setMethod($_method['code']);
51
  $method->setMethodTitle($_method['method']);
52
+ $method->setPrice($finalRates);
53
+ $method->setCost($finalRates);
54
  $result->append($method);
55
  }
56
  } elseif($this->_result === false) {
131
  if($this->getConfigValue('handlingfee_type', $this->_code) == 'F') {
132
  $_rates = $_rates + $this->getConfigValue('handlingfee', $this->_code);
133
  } elseif($this->getConfigValue('handlingfee_type', $this->_code) == 'P') {
134
+ $_handlingFee = $this->getConfigValue('handlingfee', $this->_code);
135
  $_rates = $_rates + ($_rates*$_handlingFee/100);
136
  }
137
  return $_rates;
app/code/local/Raveinfosys/Freightshipping/Model/Carrier/Bestquote.php CHANGED
@@ -15,6 +15,7 @@ class Raveinfosys_Freightshipping_Model_Carrier_Bestquote extends Raveinfosys_Fr
15
  $_rates = $model->getRates($request);
16
  if($_rates){
17
  foreach($_rates as $_rate){
 
18
  if($_cheapestRate == 0 || $_cheapestRate[0]['rates'] > $_rate['rates'] ){
19
  $_cheapestRate = array($_rate);
20
  }
@@ -24,6 +25,16 @@ class Raveinfosys_Freightshipping_Model_Carrier_Bestquote extends Raveinfosys_Fr
24
  return $_cheapestRate;
25
  }
26
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  protected function getAvailableCarriers()
29
  {
15
  $_rates = $model->getRates($request);
16
  if($_rates){
17
  foreach($_rates as $_rate){
18
+ $_rate['rates'] = $this->calculateHandlingFee($_rate['rates'],$_rate['carrier']);
19
  if($_cheapestRate == 0 || $_cheapestRate[0]['rates'] > $_rate['rates'] ){
20
  $_cheapestRate = array($_rate);
21
  }
25
  return $_cheapestRate;
26
  }
27
 
28
+ public function calculateHandlingFee($_rates,$_code)
29
+ {
30
+ if($this->getConfigValue('handlingfee_type', $_code) == 'F') {
31
+ $_rates = $_rates + $this->getConfigValue('handlingfee', $_code);
32
+ } elseif($this->getConfigValue('handlingfee_type', $_code) == 'P') {
33
+ $_handlingFee = $this->getConfigValue('handlingfee', $_code);
34
+ $_rates = $_rates + ($_rates*$_handlingFee/100);
35
+ }
36
+ return $_rates;
37
+ }
38
 
39
  protected function getAvailableCarriers()
40
  {
app/code/local/Raveinfosys/Freightshipping/Model/Carrier/Rlcarriers.php CHANGED
@@ -51,7 +51,7 @@ class Raveinfosys_Freightshipping_Model_Carrier_Rlcarriers extends Raveinfosys_F
51
  $_rlcRequest["Destination"] = array(
52
  "City" => "",
53
  "StateOrProvince" => "",
54
- "ZipOrPostalCode" => $request->getDestPostcode(),
55
  "CountryCode" => $this->getCountryIso3Code($request->getDestCountryId()),
56
  );
57
  $_rlcRequest["DeclaredValue"] = 0;
51
  $_rlcRequest["Destination"] = array(
52
  "City" => "",
53
  "StateOrProvince" => "",
54
+ "ZipOrPostalCode" => trim($request->getDestPostcode()),
55
  "CountryCode" => $this->getCountryIso3Code($request->getDestCountryId()),
56
  );
57
  $_rlcRequest["DeclaredValue"] = 0;
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Raveinfosys_Freightshipping</name>
4
- <version>0.1.0</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
@@ -11,9 +11,9 @@
11
  <notes>This is stable version of this extension and has been tested on various version of community editions. &#xD;
12
  In this particular version we are supporting it to run on PHP V 5.5.X</notes>
13
  <authors><author><name>Rave Infosys</name><user>raveinfo</user><email>magento@raveinfosys.com</email></author></authors>
14
- <date>2015-01-30</date>
15
- <time>06:30:34</time>
16
- <contents><target name="magelocal"><dir name="Raveinfosys"><dir name="Freightshipping"><dir name="Block"><dir name="Checkout"><dir name="Cart"><file name="Shipping.php" hash="9f31997c24962235488aa96675176adf"/></dir></dir><dir name="Onepage"><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="3e89a511024eec51b8f2433a8e38f13e"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="88f73f083da2afb81ffccc43891496fa"/></dir><dir name="Model"><dir name="Carrier"><file name="Abstract.php" hash="8488f9db8f387c3f547f6acf9c0e0079"/><file name="Bestquote.php" hash="4a6c6aafe70ef8155222c5f3f4025629"/><file name="Conway.php" hash="43f4a0c77abc90f998ce16ec29fd0e7b"/><file name="Rlcarriers.php" hash="60ae94ee4ed49432393b3dd78d0cc2f2"/></dir><file name="Observer.php" hash="13001164c18445092725d3f0cafd195f"/><dir name="Source"><dir name="Conway"><file name="Country.php" hash="333e20bda51cd8ec8b7e93e17cadfa6e"/><file name="Shipcode.php" hash="f44f28fcf4f543e74d10d7d7a7490986"/></dir><file name="Destinationtype.php" hash="ce0f59e8004b52c43df7b17523c68be2"/><dir name="Rlcarriers"><file name="Country.php" hash="23f4a272483bc99945bd49ade34fc907"/><file name="Method.php" hash="ee456489afc27d267b561953f065e0cc"/></dir><file name="Shipclass.php" hash="baf6f08fe1fc4e327f1076cba647761b"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="e361ca69bef1ee1b8b579e99bcebd809"/><file name="config.xml" hash="1619f6ddfef58f24e28b9a4d2ad4e9bb"/><file name="system.xml" hash="8bb0a409765ef74b540c96b083921711"/></dir><dir name="sql"><dir name="freightshipping_setup"><file name="mysql4-install-0.0.1.php" hash="b173341fc438b2489429ba412eccc1b7"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Raveinfosys_Freightshipping.xml" hash="a8a5aae17ad0f8fbf003486b68f020fc"/></dir></target></contents>
17
  <compatible/>
18
- <dependencies><required><php><min>5.2.0</min><max>5.6.3</max></php><extension><name>curl</name><min>7.16.0</min><max>7.40.0</max></extension><extension><name>soap</name><min></min><max></max></extension></required></dependencies>
19
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Raveinfosys_Freightshipping</name>
4
+ <version>0.1.1</version>
5
  <stability>stable</stability>
6
  <license>OSL v3.0</license>
7
  <channel>community</channel>
11
  <notes>This is stable version of this extension and has been tested on various version of community editions. &#xD;
12
  In this particular version we are supporting it to run on PHP V 5.5.X</notes>
13
  <authors><author><name>Rave Infosys</name><user>raveinfo</user><email>magento@raveinfosys.com</email></author></authors>
14
+ <date>2015-07-14</date>
15
+ <time>15:01:24</time>
16
+ <contents><target name="magelocal"><dir name="Raveinfosys"><dir name="Freightshipping"><dir name="Block"><dir name="Checkout"><dir name="Cart"><file name="Shipping.php" hash="9f31997c24962235488aa96675176adf"/></dir></dir><dir name="Onepage"><dir name="Shipping"><dir name="Method"><file name="Available.php" hash="3e89a511024eec51b8f2433a8e38f13e"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="88f73f083da2afb81ffccc43891496fa"/></dir><dir name="Model"><dir name="Carrier"><file name="Abstract.php" hash="f9e97767af08046ddf504245362b6361"/><file name="Bestquote.php" hash="72e1221fc53282ba124be8b6fec9addf"/><file name="Conway.php" hash="43f4a0c77abc90f998ce16ec29fd0e7b"/><file name="Rlcarriers.php" hash="3e3594a673f1511f44f60772ce81e631"/></dir><file name="Observer.php" hash="13001164c18445092725d3f0cafd195f"/><dir name="Source"><dir name="Conway"><file name="Country.php" hash="333e20bda51cd8ec8b7e93e17cadfa6e"/><file name="Shipcode.php" hash="f44f28fcf4f543e74d10d7d7a7490986"/></dir><file name="Destinationtype.php" hash="ce0f59e8004b52c43df7b17523c68be2"/><dir name="Rlcarriers"><file name="Country.php" hash="23f4a272483bc99945bd49ade34fc907"/><file name="Method.php" hash="ee456489afc27d267b561953f065e0cc"/></dir><file name="Shipclass.php" hash="baf6f08fe1fc4e327f1076cba647761b"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="e361ca69bef1ee1b8b579e99bcebd809"/><file name="config.xml" hash="1619f6ddfef58f24e28b9a4d2ad4e9bb"/><file name="system.xml" hash="8bb0a409765ef74b540c96b083921711"/></dir><dir name="sql"><dir name="freightshipping_setup"><file name="mysql4-install-0.0.1.php" hash="b173341fc438b2489429ba412eccc1b7"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Raveinfosys_Freightshipping.xml" hash="a8a5aae17ad0f8fbf003486b68f020fc"/></dir></target></contents>
17
  <compatible/>
18
+ <dependencies><required><php><min>5.2.0</min><max>5.6.11</max></php><extension><name>curl</name><min>7.16.0</min><max>7.40.0</max></extension><extension><name>soap</name><min/><max/></extension></required></dependencies>
19
  </package>