Skip to content

Commit

Permalink
Fix firegento#13 - Properly get the quote
Browse files Browse the repository at this point in the history
Fetching the quote was dependend on checkout session which
might not be available

- in UnitTests
- when creating orders in backend
  • Loading branch information
Alexander Menk committed Mar 28, 2013
1 parent fe1533b commit d932d51
Showing 1 changed file with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,6 @@
*/
class FireGento_GermanSetup_Model_Tax_Sales_Total_Quote_Tax extends Mage_Tax_Model_Sales_Total_Quote_Tax {


protected function _getQuoteItems()
{
/* @var $session Mage_Checkout_Model_Session */
$session = Mage::getSingleton('checkout/session');

if ($session->hasQuote()) {
$quoteItems = $session->getQuote()->getAllItems();
} else {
$quoteItems = array();
}
return $quoteItems;
}

/**
* Calculates the portions of a quote with a specifc tax class
* The price incl tax is used for the calculation
Expand Down Expand Up @@ -102,7 +88,7 @@ protected function _calculateShippingTax(Mage_Sales_Model_Quote_Address $address
if (!$address->getIsShippingInclTax()) {
throw Exception('Not implemented');
}
$portions = $this->_collectTaxClassPortions($this->_getQuoteItems());
$portions = $this->_collectTaxClassPortions($address->getQuote()->getAllItems());

$totalTaxable = $address->getShippingTaxable();
$totalBaseTaxable = $address->getBaseShippingTaxable();
Expand Down

0 comments on commit d932d51

Please sign in to comment.