Mage_Weee_Model_Total_Quote_Weee
extends Mage_Tax_Model_Sales_Total_Quote_Tax
in package
Table of Contents
Properties
- $_address : Mage_Sales_Model_Quote_Address
- $_areTaxRequestsSimilar : bool
- Flag which is initialized when collect method is start.
- $_baseRoundingDeltas : array<string|int, mixed>
- Array for the base rounding deltas
- $_calculator : Mage_Tax_Model_Calculation
- Tax calculation model
- $_canAddAmountToAddress : bool
- Various abstract abilities
- $_canSetAddressAmount : mixed
- $_code : string
- Total Code name
- $_config : Mage_Tax_Model_Config
- Tax configuration object
- $_helper : Mage_Weee_Helper_Data
- Weee module helper object
- $_hiddenTaxes : array<string|int, mixed>
- Hidden taxes array
- $_itemRowTotalKey : string
- Key for item row total getting
- $_roundingDeltas : array<string|int, mixed>
- Array for the rounding deltas
- $_store : Mage_Core_Model_Store
- Store model
- $_weeeHelper : Mage_Weee_Helper_Data
- Weee helper class
Methods
- __construct() : mixed
- Initialize Weee totals collector
- collect() : $this
- Collect Weee taxes amount and prepare items prices for taxation and discount
- fetch() : $this
- Fetch FPT data to address object for display in totals block
- getCode() : string
- Retrieve total code name
- getIsItemRowTotalCompoundable() : bool
- Whether the item row total may be compounded with others
- getItemBaseRowTotal() : float
- Getter for row default base total
- getItemRowTotal() : float
- Getter for row default total
- getLabel() : string
- No aggregated label for fixed product tax
- processConfigArray() : array<string|int, mixed>
- Process model configuration array.
- setCode() : Mage_Sales_Model_Quote_Address_Total_Abstract
- Set total code code name
- setHelper() : mixed
- Set the helper object.
- setStore() : mixed
- Set the store Object
- _addAmount() : Mage_Sales_Model_Quote_Address_Total_Abstract
- Add total model amount value to address
- _addBaseAmount() : Mage_Sales_Model_Quote_Address_Total_Abstract
- Add total model base amount value to address
- _aggregateTaxPerRate() : $this
- Aggregate row totals per tax rate in array
- _calcRowTaxAmount() : $this
- Calculate item tax amount based on row total
- _calculateRowWeeeTax() : int
- Calculates and updates the wee tax based on the customer tax rate and discount for Row
- _calculateShippingTax() : $this
- Tax calculation for shipping price
- _calculateShippingTaxByRate() : mixed
- _calculateWeeeAmountInclTax() : mixed
- Calculates the weeeAmountInclTax for display purpose
- _calculateWeeeTax() : float
- Calculates the weee tax based on the customer tax rate and discount
- _calcUnitTaxAmount() : $this
- Calculate unit tax amount based on unit price
- _customerRatePercent() : mixed
- Get the default store rate
- _deltaRound() : float
- Round price based on previous rounding operation delta
- _getAddress() : Mage_Sales_Model_Quote_Address
- Get quote address object
- _getAddressItems() : array<string|int, Mage_Sales_Model_Quote_Address_Item>
- Get all items except nominals
- _getCalculator() : Mage_Tax_Model_Calculation
- Returns the model for calculation
- _process() : bool
- Calculate item fixed tax and prepare information for discount and regular taxation
- _processHiddenTaxes() : mixed
- Process hidden taxes for items and shipping (in accordance with hidden tax type)
- _processTotalAmount() : bool
- Process row amount based on FPT total amount configuration setting
- _recalculateParent() : $this
- Recalculate parent item amounts based on children results
- _resetItemData() : mixed
- Reset information about FPT for shopping cart item
- _roundTotals() : $this
- Round the total amounts in address
- _rowBaseCalculation() : $this
- Calculate address total tax based on row total
- _rowBaseProcessItemTax() : mixed
- _saveAppliedTaxes() : mixed
- Collect applied tax rates information on address level
- _setAddress() : Mage_Sales_Model_Quote_Address_Total_Abstract
- Set address which can be used inside totals calculation
- _setAmount() : Mage_Sales_Model_Quote_Address_Total_Abstract
- Set total model amount value to address
- _setBaseAmount() : Mage_Sales_Model_Quote_Address_Total_Abstract
- Set total model base amount value to address
- _totalBaseCalculation() : $this
- Calculate address total tax based on address subtotal
- _totalBaseProcessItemTax() : mixed
- _unitBaseCalculation() : $this
- Calculate address tax amount based on one unit price and tax amount
- _unitBaseProcessItemTax() : mixed
- _usePriceIncludeTax() : bool
- Check if price include tax should be used for calculations.
Properties
$_address
protected
Mage_Sales_Model_Quote_Address
$_address
= \null
$_areTaxRequestsSimilar
Flag which is initialized when collect method is start.
protected
bool
$_areTaxRequestsSimilar
= \false
Is used for checking if store tax and customer tax requests are similar
$_baseRoundingDeltas
Array for the base rounding deltas
protected
array<string|int, mixed>
$_baseRoundingDeltas
= []
$_calculator
Tax calculation model
protected
Mage_Tax_Model_Calculation
$_calculator
$_canAddAmountToAddress
Various abstract abilities
protected
bool
$_canAddAmountToAddress
= \true
$_canSetAddressAmount
protected
mixed
$_canSetAddressAmount
= \true
$_code
Total Code name
protected
string
$_code
$_config
Tax configuration object
protected
Mage_Tax_Model_Config
$_config
$_helper
Weee module helper object
protected
Mage_Weee_Helper_Data
$_helper
$_hiddenTaxes
Hidden taxes array
protected
array<string|int, mixed>
$_hiddenTaxes
= []
$_itemRowTotalKey
Key for item row total getting
protected
string
$_itemRowTotalKey
= \null
$_roundingDeltas
Array for the rounding deltas
protected
array<string|int, mixed>
$_roundingDeltas
= []
$_store
Store model
protected
Mage_Core_Model_Store
$_store
$_weeeHelper
Weee helper class
protected
Mage_Weee_Helper_Data
$_weeeHelper
Methods
__construct()
Initialize Weee totals collector
public
__construct() : mixed
collect()
Collect Weee taxes amount and prepare items prices for taxation and discount
public
collect(Mage_Sales_Model_Quote_Address $address) : $this
Parameters
- $address : Mage_Sales_Model_Quote_Address
Attributes
- #[Override]
Return values
$thisfetch()
Fetch FPT data to address object for display in totals block
public
fetch(Mage_Sales_Model_Quote_Address $address) : $this
Parameters
- $address : Mage_Sales_Model_Quote_Address
Attributes
- #[Override]
Return values
$thisgetCode()
Retrieve total code name
public
getCode() : string
Return values
stringgetIsItemRowTotalCompoundable()
Whether the item row total may be compounded with others
public
getIsItemRowTotalCompoundable(Mage_Sales_Model_Quote_Item_Abstract $item) : bool
Parameters
Return values
boolgetItemBaseRowTotal()
Getter for row default base total
public
getItemBaseRowTotal(Mage_Sales_Model_Quote_Item_Abstract $item) : float
Parameters
Return values
floatgetItemRowTotal()
Getter for row default total
public
getItemRowTotal(Mage_Sales_Model_Quote_Item_Abstract $item) : float
Parameters
Return values
floatgetLabel()
No aggregated label for fixed product tax
public
getLabel() : string
TODO: fix
Attributes
- #[Override]
Return values
stringprocessConfigArray()
Process model configuration array.
public
processConfigArray(array<string|int, mixed> $config, Mage_Core_Model_Store $store) : array<string|int, mixed>
This method can be used for changing totals collect sort order
Parameters
- $config : array<string|int, mixed>
- $store : Mage_Core_Model_Store
Attributes
- #[Override]
Return values
array<string|int, mixed>setCode()
Set total code code name
public
setCode(string $code) : Mage_Sales_Model_Quote_Address_Total_Abstract
Parameters
- $code : string
Return values
Mage_Sales_Model_Quote_Address_Total_AbstractsetHelper()
Set the helper object.
public
setHelper(Mage_Weee_Helper_Data $helper) : mixed
Parameters
- $helper : Mage_Weee_Helper_Data
setStore()
Set the store Object
public
setStore(Mage_Core_Model_Store $store) : mixed
Parameters
- $store : Mage_Core_Model_Store
_addAmount()
Add total model amount value to address
protected
_addAmount(float $amount) : Mage_Sales_Model_Quote_Address_Total_Abstract
Parameters
- $amount : float
Return values
Mage_Sales_Model_Quote_Address_Total_Abstract_addBaseAmount()
Add total model base amount value to address
protected
_addBaseAmount(float $baseAmount) : Mage_Sales_Model_Quote_Address_Total_Abstract
Parameters
- $baseAmount : float
Return values
Mage_Sales_Model_Quote_Address_Total_Abstract_aggregateTaxPerRate()
Aggregate row totals per tax rate in array
protected
_aggregateTaxPerRate(Mage_Sales_Model_Quote_Item_Abstract $item, float $rate, array<string|int, mixed> &$taxGroups[, null|string $taxId = null ][, bool $recalculateRowTotalInclTax = false ]) : $this
Parameters
- $item : Mage_Sales_Model_Quote_Item_Abstract
- $rate : float
- $taxGroups : array<string|int, mixed>
- $taxId : null|string = null
- $recalculateRowTotalInclTax : bool = false
Return values
$this_calcRowTaxAmount()
Calculate item tax amount based on row total
protected
_calcRowTaxAmount(Mage_Sales_Model_Quote_Item_Abstract $item, float $rate[, array<string|int, mixed> &$taxGroups = null ][, string $taxId = null ][, bool $recalculateRowTotalInclTax = false ]) : $this
Parameters
- $item : Mage_Sales_Model_Quote_Item_Abstract
- $rate : float
- $taxGroups : array<string|int, mixed> = null
- $taxId : string = null
- $recalculateRowTotalInclTax : bool = false
Return values
$this_calculateRowWeeeTax()
Calculates and updates the wee tax based on the customer tax rate and discount for Row
protected
_calculateRowWeeeTax(float $discountAmount, Mage_Sales_Model_Quote_Item_Abstract $item, float $rate[, bool $base = true ]) : int
Parameters
- $discountAmount : float
- $item : Mage_Sales_Model_Quote_Item_Abstract
- $rate : float
- $base : bool = true
Return values
int_calculateShippingTax()
Tax calculation for shipping price
protected
_calculateShippingTax(Mage_Sales_Model_Quote_Address $address, DataObject $taxRateRequest) : $this
Parameters
- $address : Mage_Sales_Model_Quote_Address
- $taxRateRequest : DataObject
Return values
$this_calculateShippingTaxByRate()
protected
_calculateShippingTaxByRate(Mage_Sales_Model_Quote_Address $address, float $rate, array<string|int, mixed> $appliedRates[, string $taxId = null ]) : mixed
Parameters
- $address : Mage_Sales_Model_Quote_Address
- $rate : float
- $appliedRates : array<string|int, mixed>
- $taxId : string = null
_calculateWeeeAmountInclTax()
Calculates the weeeAmountInclTax for display purpose
protected
_calculateWeeeAmountInclTax(Mage_Sales_Model_Quote_Item_Abstract $item, array<string|int, mixed> $appliedRates[, bool $base = true ]) : mixed
Parameters
- $item : Mage_Sales_Model_Quote_Item_Abstract
- $appliedRates : array<string|int, mixed>
- $base : bool = true
_calculateWeeeTax()
Calculates the weee tax based on the customer tax rate and discount
protected
_calculateWeeeTax(float $discountAmount, Mage_Sales_Model_Quote_Item_Abstract $item, float $rate[, bool $base = true ]) : float
Parameters
- $discountAmount : float
- $item : Mage_Sales_Model_Quote_Item_Abstract
- $rate : float
- $base : bool = true
Return values
float_calcUnitTaxAmount()
Calculate unit tax amount based on unit price
protected
_calcUnitTaxAmount(Mage_Sales_Model_Quote_Item_Abstract $item, float $rate[, array<string|int, mixed> &$taxGroups = null ][, string $taxId = null ][, bool $recalculateRowTotalInclTax = false ]) : $this
Parameters
- $item : Mage_Sales_Model_Quote_Item_Abstract
- $rate : float
- $taxGroups : array<string|int, mixed> = null
- $taxId : string = null
- $recalculateRowTotalInclTax : bool = false
Return values
$this_customerRatePercent()
Get the default store rate
protected
_customerRatePercent(Mage_Sales_Model_Quote_Address $address, Mage_Sales_Model_Quote_Item_Abstract $item) : mixed
Parameters
- $address : Mage_Sales_Model_Quote_Address
- $item : Mage_Sales_Model_Quote_Item_Abstract
_deltaRound()
Round price based on previous rounding operation delta
protected
_deltaRound(float $price, string $rate, bool $direction[, string $type = 'regular' ]) : float
Parameters
- $price : float
- $rate : string
- $direction : bool
-
price including or excluding tax
- $type : string = 'regular'
Return values
float_getAddress()
Get quote address object
protected
_getAddress() : Mage_Sales_Model_Quote_Address
Tags
Return values
Mage_Sales_Model_Quote_Address_getAddressItems()
Get all items except nominals
protected
_getAddressItems(Mage_Sales_Model_Quote_Address $address) : array<string|int, Mage_Sales_Model_Quote_Address_Item>
Parameters
- $address : Mage_Sales_Model_Quote_Address
Return values
array<string|int, Mage_Sales_Model_Quote_Address_Item>_getCalculator()
Returns the model for calculation
protected
_getCalculator() : Mage_Tax_Model_Calculation
Return values
Mage_Tax_Model_Calculation_process()
Calculate item fixed tax and prepare information for discount and regular taxation
protected
_process(Mage_Sales_Model_Quote_Address $address, Mage_Sales_Model_Quote_Item_Abstract $item) : bool
Parameters
- $address : Mage_Sales_Model_Quote_Address
- $item : Mage_Sales_Model_Quote_Item_Abstract
Return values
bool —Whether tax was affected
_processHiddenTaxes()
Process hidden taxes for items and shipping (in accordance with hidden tax type)
protected
_processHiddenTaxes() : mixed
_processTotalAmount()
Process row amount based on FPT total amount configuration setting
protected
_processTotalAmount(Mage_Sales_Model_Quote_Address $address, float $rowValue, float $baseRowValue) : bool
Parameters
- $address : Mage_Sales_Model_Quote_Address
- $rowValue : float
- $baseRowValue : float
Return values
bool —Whether tax is affected
_recalculateParent()
Recalculate parent item amounts based on children results
protected
_recalculateParent(Mage_Sales_Model_Quote_Item_Abstract $item) : $this
Parameters
Attributes
- #[Override]
Return values
$this_resetItemData()
Reset information about FPT for shopping cart item
protected
_resetItemData(Mage_Sales_Model_Quote_Item_Abstract $item) : mixed
Parameters
_roundTotals()
Round the total amounts in address
protected
_roundTotals(Mage_Sales_Model_Quote_Address $address) : $this
Parameters
- $address : Mage_Sales_Model_Quote_Address
Return values
$this_rowBaseCalculation()
Calculate address total tax based on row total
protected
_rowBaseCalculation(Mage_Sales_Model_Quote_Address $address, DataObject $taxRateRequest) : $this
Parameters
- $address : Mage_Sales_Model_Quote_Address
- $taxRateRequest : DataObject
Return values
$this_rowBaseProcessItemTax()
protected
_rowBaseProcessItemTax(Mage_Sales_Model_Quote_Address $address, Mage_Sales_Model_Quote_Item_Abstract $item, DataObject $taxRateRequest, array<string|int, mixed> &$itemTaxGroups, bool $catalogPriceInclTax) : mixed
Parameters
- $address : Mage_Sales_Model_Quote_Address
- $item : Mage_Sales_Model_Quote_Item_Abstract
- $taxRateRequest : DataObject
- $itemTaxGroups : array<string|int, mixed>
- $catalogPriceInclTax : bool
_saveAppliedTaxes()
Collect applied tax rates information on address level
protected
_saveAppliedTaxes(Mage_Sales_Model_Quote_Address $address, array<string|int, mixed> $applied, float $amount, float $baseAmount, float|null $rate) : mixed
Parameters
- $address : Mage_Sales_Model_Quote_Address
- $applied : array<string|int, mixed>
- $amount : float
- $baseAmount : float
- $rate : float|null
_setAddress()
Set address which can be used inside totals calculation
protected
_setAddress(Mage_Sales_Model_Quote_Address $address) : Mage_Sales_Model_Quote_Address_Total_Abstract
Parameters
- $address : Mage_Sales_Model_Quote_Address
Return values
Mage_Sales_Model_Quote_Address_Total_Abstract_setAmount()
Set total model amount value to address
protected
_setAmount(float $amount) : Mage_Sales_Model_Quote_Address_Total_Abstract
Parameters
- $amount : float
Return values
Mage_Sales_Model_Quote_Address_Total_Abstract_setBaseAmount()
Set total model base amount value to address
protected
_setBaseAmount(float $baseAmount) : Mage_Sales_Model_Quote_Address_Total_Abstract
Parameters
- $baseAmount : float
Return values
Mage_Sales_Model_Quote_Address_Total_Abstract_totalBaseCalculation()
Calculate address total tax based on address subtotal
protected
_totalBaseCalculation(Mage_Sales_Model_Quote_Address $address, DataObject $taxRateRequest) : $this
Parameters
- $address : Mage_Sales_Model_Quote_Address
- $taxRateRequest : DataObject
Return values
$this_totalBaseProcessItemTax()
protected
_totalBaseProcessItemTax(Mage_Sales_Model_Quote_Item_Abstract $item, DataObject $taxRateRequest, array<string|int, mixed> &$taxGroups, array<string|int, mixed> &$itemTaxGroups, bool $catalogPriceInclTax) : mixed
Parameters
- $item : Mage_Sales_Model_Quote_Item_Abstract
- $taxRateRequest : DataObject
- $taxGroups : array<string|int, mixed>
- $itemTaxGroups : array<string|int, mixed>
- $catalogPriceInclTax : bool
_unitBaseCalculation()
Calculate address tax amount based on one unit price and tax amount
protected
_unitBaseCalculation(Mage_Sales_Model_Quote_Address $address, DataObject $taxRateRequest) : $this
Parameters
- $address : Mage_Sales_Model_Quote_Address
- $taxRateRequest : DataObject
Return values
$this_unitBaseProcessItemTax()
protected
_unitBaseProcessItemTax(Mage_Sales_Model_Quote_Address $address, Mage_Sales_Model_Quote_Item_Abstract $item, DataObject $taxRateRequest, array<string|int, mixed> &$itemTaxGroups, bool $catalogPriceInclTax) : mixed
Parameters
- $address : Mage_Sales_Model_Quote_Address
- $item : Mage_Sales_Model_Quote_Item_Abstract
- $taxRateRequest : DataObject
- $itemTaxGroups : array<string|int, mixed>
- $catalogPriceInclTax : bool
_usePriceIncludeTax()
Check if price include tax should be used for calculations.
protected
_usePriceIncludeTax(null|string|bool|int|Mage_Core_Model_Store $store) : bool
We are using price include tax just in case when catalog prices are including tax and customer tax request is same as store tax request
Parameters
- $store : null|string|bool|int|Mage_Core_Model_Store