Skip to content
This repository has been archived by the owner on Oct 30, 2019. It is now read-only.

Commit

Permalink
bugfix, removed collectTotals(), replaced $quote->getSubtotal() with …
Browse files Browse the repository at this point in the history
…$request->getPackageValueWithDiscount()
  • Loading branch information
bastianccm committed Mar 16, 2012
1 parent 6a19956 commit dfc6536
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/app/code/community/Thebod/Shippingrates/Model/Carrier.php
Expand Up @@ -82,16 +82,14 @@ public function checkRate(array $rate, Mage_Shipping_Model_Rate_Request $request
break;

case 'min_subtotal':
Mage::getSingleton('checkout/session')->getQuote()->collectTotals();
$subtotal = Mage::getSingleton('checkout/session')->getQuote()->getSubtotal();
$subtotal = $request->getPackageValueWithDiscount();
if($subtotal < $value) {
$passed = false;
}
break;

case 'max_subtotal':
Mage::getSingleton('checkout/session')->getQuote()->collectTotals();
$subtotal = Mage::getSingleton('checkout/session')->getQuote()->getSubtotal();
$subtotal = $request->getPackageValueWithDiscount();
if($subtotal > $value) {
$passed = false;
}
Expand Down Expand Up @@ -119,8 +117,7 @@ public function checkRate(array $rate, Mage_Shipping_Model_Rate_Request $request
* @param Mage_Shipping_Model_Rate_Request $request
* @return Mage_Shipping_Model_Rate_Result
*/
public function collectRates(Mage_Shipping_Model_Rate_Request $request)
{
public function collectRates(Mage_Shipping_Model_Rate_Request $request) {
if(!$this->getConfigFlag('active')) {
return false;
}
Expand Down

0 comments on commit dfc6536

Please sign in to comment.