Mage_Weee_Helper_Data
extends Mage_Core_Helper_Abstract
in package
Table of Contents
Constants
- LOADED_AND_DISPLAY_WITH_TAX : mixed = '2'
- 'FPT Tax Configuration' for LOADED_AND_DISPLAY_WITH_TAX
- TAXED : mixed = '1'
- 'FPT Tax Configuration' for TAXED
- XML_PATH_FPT_ENABLED : mixed = 'tax/weee/enable'
- Config Path for FPT
Properties
- $_layout : Mage_Core_Model_Layout
- Layout model object
- $_moduleName : string
- Helper module name
- $_request : Mage_Core_Controller_Request_Http
- Request object
- $_store : Mage_Core_Model_Store
- Current store, in the case of backend order, it could be different from admin store
- $_storeDisplayConfig : array<string|int, mixed>
- $modulesDisabled : array<string|int, mixed>
Methods
- __() : string
- Translate
- escapeHtml() : ($data is array ? ?string[] : ?string)
- Escape html entities
- escapeScriptIdentifiers() : string
- Remove `javascript:`, `vbscript:`, `data:` words from the string.
- escapeSpecial() : string
- Remove `\t`,`\n`,`\r`,`\0`,`\x0B:` symbols from the string.
- escapeUrl() : string
- Escape html entities in url
- getAmount() : float
- Get weee tax amount for product based on shipping and billing addresses, website and tax settings
- getAmountForDisplay() : float
- Returns amount to display excluding taxes
- getAmountForDisplayInclTaxes() : float
- Returns amount to display including taxes
- getAmountInclTaxes() : float
- Returns all summed weee taxes with all local taxes applied
- getApplied() : array<string|int, mixed>
- Returns applied weee taxes
- getBaseRowWeeeAmountAfterDiscount() : float
- Calculate base row weee amount for an order, invoice or credit memo item The returned value may contain discount if the discount is not included in the discount for subtotal
- getBaseRowWeeeTaxInclTax() : float
- Get the total base weee including tax by row
- getBaseTotalRowTaxAppliedForWeeeTax() : float
- Get the Total tax applied in base for Weee
- getBaseTotalTaxAppliedForWeeeTax() : float
- Get the total tax applied on weee by unit
- getBaseWeeeTaxInclTax() : float
- Get the total base weee tax
- getEmailPriceDisplayType() : int
- Get weee amount display type in email templates
- getLayout() : Mage_Core_Model_Layout
- Retrieve layout model object
- getListPriceDisplayType() : int
- Get weee amount display type on product list page
- getOriginalAmount() : float|int
- Returns original amount
- getPriceDisplayType() : int
- Get weee amount display type on product view page
- getProductWeeeAttributes() : array<string|int, mixed>
- Proxy for Mage_Weee_Model_Tax::getProductWeeeAttributes()
- getProductWeeeAttributesForDisplay() : array<string|int, mixed>
- Returns array of weee attributes allowed for display
- getProductWeeeAttributesForRenderer() : array<string|int, mixed>
- Get Product Weee attributes for price renderer
- getRowWeeeAmountAfterDiscount() : float
- Calculate row weee amount for an order, invoice or credit memo item The returned value may contain discount if the discount is not included in the discount for subtotal
- getRowWeeeTaxInclTax() : float
- Get the total weee including tax by row
- getSalesPriceDisplayType() : int
- Get weee amount display type in sales modules
- getTaxType() : int
- Get Weee Tax Configuration Type
- getTotalRowTaxAppliedForWeeeTax() : float
- Get the Total tax applied for Weee
- getTotalTaxAppliedForWeeeTax() : float
- Get the total tax applied on weee by unit
- getWeeeTaxInclTax() : float
- Get the total weee tax
- hasTags() : bool
- Check for tags in multidimensional arrays
- includeInSubtotal() : bool
- Check if weee tax amount should be included to subtotal
- isDiscounted() : bool
- Check if weee tax amount should be discounted
- isEnabled() : bool
- Check if fixed taxes are used in system
- isModuleEnabled() : bool
- Check is module exists and enabled in global config.
- isModuleOutputEnabled() : bool
- Check whether the module output is enabled in Configuration
- isTaxable() : bool
- Check if weee tax amount should be taxable
- isTaxIncluded() : bool
- Returns true if default store tax is already applied to the FPT(weee)
- jsQuoteEscape() : ($data is array ? string[] : string)
- Escape quotes in java script
- processTierPrices() : $this
- Adds HTML containers and formats tier prices accordingly to the currency used
- quoteEscape() : string
- Escape quotes inside html attributes Use $addSlashes = false for escaping js that inside html attribute (onClick, onSubmit etc)
- removeTags() : string
- Remove html tags, but leave "<" and ">" signs
- setApplied() : $this
- Sets applied weee taxes
- setLayout() : Mage_Core_Helper_Abstract
- Declare layout
- setStore() : mixed
- Set the store for the current quote
- setWeeeTaxesAppliedProperty() : mixed
- Set a value to a specific property searching FPT by title for the Item
- stripTags() : string
- Wrapper for standard strip_tags() function with extra functionality for html entities
- translateArray() : array<string|int, mixed>
- Translate array
- typeOfDisplay() : bool|int
- Returns display type for price accordingly to current zone
- urlDecode() : string
- base64_decode() for URLs decoding
- urlDecodeAndEscape() : string
- base64_decode() and escape quotes in url
- urlEncode() : string
- base64_encode() for URLs encoding
- validateCatalogPricesAndFptConfiguration() : bool
- Check if the configuration for the particular store causes conflicts
- _cleanCache() : Mage_Core_Helper_Abstract
- Cleaning cache
- _getModuleName() : string
- Retrieve helper module name
- _getRequest() : Mage_Core_Controller_Request_Http
- Retrieve request object
- _getUrl() : string
- Retrieve url
- _loadCache() : mixed
- Loading cache data
- _removeCache() : Mage_Core_Helper_Abstract
- Removing cache
- _saveCache() : Mage_Core_Helper_Abstract
- Saving cache
Constants
LOADED_AND_DISPLAY_WITH_TAX
'FPT Tax Configuration' for LOADED_AND_DISPLAY_WITH_TAX
public
mixed
LOADED_AND_DISPLAY_WITH_TAX
= '2'
TAXED
'FPT Tax Configuration' for TAXED
public
mixed
TAXED
= '1'
XML_PATH_FPT_ENABLED
Config Path for FPT
public
mixed
XML_PATH_FPT_ENABLED
= 'tax/weee/enable'
Properties
$_layout
Layout model object
protected
Mage_Core_Model_Layout
$_layout
$_moduleName
Helper module name
protected
string
$_moduleName
= 'Mage_Weee'
$_request
Request object
protected
Mage_Core_Controller_Request_Http
$_request
$_store
Current store, in the case of backend order, it could be different from admin store
protected
Mage_Core_Model_Store
$_store
$_storeDisplayConfig
protected
array<string|int, mixed>
$_storeDisplayConfig
= []
$modulesDisabled
protected
array<string|int, mixed>
$modulesDisabled
= []
Methods
__()
Translate
public
__() : string
Return values
stringescapeHtml()
Escape html entities
public
escapeHtml(null|string|array<string|int, string> $data[, null|array<string|int, string> $allowedTags = null ]) : ($data is array ? ?string[] : ?string)
Parameters
- $data : null|string|array<string|int, string>
- $allowedTags : null|array<string|int, string> = null
Return values
($data is array ? ?string[] : ?string)escapeScriptIdentifiers()
Remove `javascript:`, `vbscript:`, `data:` words from the string.
public
escapeScriptIdentifiers(string $data) : string
Parameters
- $data : string
Return values
stringescapeSpecial()
Remove `\t`,`\n`,`\r`,`\0`,`\x0B:` symbols from the string.
public
escapeSpecial(string $data) : string
Parameters
- $data : string
Return values
stringescapeUrl()
Escape html entities in url
public
escapeUrl(string $data) : string
Parameters
- $data : string
Return values
stringgetAmount()
Get weee tax amount for product based on shipping and billing addresses, website and tax settings
public
getAmount(Mage_Catalog_Model_Product $product[, null|Mage_Customer_Model_Address_Abstract $shipping = null ][, null|Mage_Customer_Model_Address_Abstract $billing = null ][, mixed $website = null ][, bool $calculateTaxes = false ]) : float
Parameters
- $product : Mage_Catalog_Model_Product
- $shipping : null|Mage_Customer_Model_Address_Abstract = null
- $billing : null|Mage_Customer_Model_Address_Abstract = null
- $website : mixed = null
- $calculateTaxes : bool = false
Return values
floatgetAmountForDisplay()
Returns amount to display excluding taxes
public
getAmountForDisplay(Mage_Catalog_Model_Product $product) : float
Parameters
- $product : Mage_Catalog_Model_Product
Return values
floatgetAmountForDisplayInclTaxes()
Returns amount to display including taxes
public
getAmountForDisplayInclTaxes(Mage_Catalog_Model_Product $product) : float
Parameters
- $product : Mage_Catalog_Model_Product
Return values
floatgetAmountInclTaxes()
Returns all summed weee taxes with all local taxes applied
public
getAmountInclTaxes(array<string|int, mixed> $attributes) : float
Parameters
- $attributes : array<string|int, mixed>
-
Array of \Maho\DataObject, result from getProductWeeeAttributes()
Tags
Return values
floatgetApplied()
Returns applied weee taxes
public
getApplied(Mage_Sales_Model_Quote_Item_Abstract|DataObject $item) : array<string|int, mixed>
Parameters
Return values
array<string|int, mixed>getBaseRowWeeeAmountAfterDiscount()
Calculate base row weee amount for an order, invoice or credit memo item The returned value may contain discount if the discount is not included in the discount for subtotal
public
getBaseRowWeeeAmountAfterDiscount(mixed $item) : float
Parameters
- $item : mixed
Return values
floatgetBaseRowWeeeTaxInclTax()
Get the total base weee including tax by row
public
getBaseRowWeeeTaxInclTax(Mage_Core_Model_Abstract $item) : float
Parameters
- $item : Mage_Core_Model_Abstract
Return values
floatgetBaseTotalRowTaxAppliedForWeeeTax()
Get the Total tax applied in base for Weee
public
getBaseTotalRowTaxAppliedForWeeeTax(Mage_Core_Model_Abstract|DataObject $item) : float
Parameters
- $item : Mage_Core_Model_Abstract|DataObject
Return values
floatgetBaseTotalTaxAppliedForWeeeTax()
Get the total tax applied on weee by unit
public
getBaseTotalTaxAppliedForWeeeTax(Mage_Core_Model_Abstract $item) : float
Parameters
- $item : Mage_Core_Model_Abstract
Return values
floatgetBaseWeeeTaxInclTax()
Get the total base weee tax
public
getBaseWeeeTaxInclTax(Mage_Core_Model_Abstract $item) : float
Parameters
- $item : Mage_Core_Model_Abstract
Return values
floatgetEmailPriceDisplayType()
Get weee amount display type in email templates
public
getEmailPriceDisplayType([bool|int|Mage_Core_Model_Store|null|string $store = null ]) : int
Parameters
- $store : bool|int|Mage_Core_Model_Store|null|string = null
Return values
intgetLayout()
Retrieve layout model object
public
getLayout() : Mage_Core_Model_Layout
Return values
Mage_Core_Model_LayoutgetListPriceDisplayType()
Get weee amount display type on product list page
public
getListPriceDisplayType([bool|int|Mage_Core_Model_Store|null|string $store = null ]) : int
Parameters
- $store : bool|int|Mage_Core_Model_Store|null|string = null
Return values
intgetOriginalAmount()
Returns original amount
public
getOriginalAmount(Mage_Catalog_Model_Product $product) : float|int
Parameters
- $product : Mage_Catalog_Model_Product
Return values
float|intgetPriceDisplayType()
Get weee amount display type on product view page
public
getPriceDisplayType([bool|int|Mage_Core_Model_Store|null|string $store = null ]) : int
Parameters
- $store : bool|int|Mage_Core_Model_Store|null|string = null
Return values
intgetProductWeeeAttributes()
Proxy for Mage_Weee_Model_Tax::getProductWeeeAttributes()
public
getProductWeeeAttributes(Mage_Catalog_Model_Product $product[, null|false|DataObject $shipping = null ][, null|false|DataObject $billing = null ][, int|Mage_Core_Model_Website|null|string|true $website = null ][, bool $calculateTaxes = false ]) : array<string|int, mixed>
Parameters
- $product : Mage_Catalog_Model_Product
- $shipping : null|false|DataObject = null
- $billing : null|false|DataObject = null
- $website : int|Mage_Core_Model_Website|null|string|true = null
- $calculateTaxes : bool = false
Return values
array<string|int, mixed>getProductWeeeAttributesForDisplay()
Returns array of weee attributes allowed for display
public
getProductWeeeAttributesForDisplay(Mage_Catalog_Model_Product $product) : array<string|int, mixed>
Parameters
- $product : Mage_Catalog_Model_Product
Return values
array<string|int, mixed>getProductWeeeAttributesForRenderer()
Get Product Weee attributes for price renderer
public
getProductWeeeAttributesForRenderer(Mage_Catalog_Model_Product $product[, null|false|DataObject $shipping = null ][, null|false|DataObject $billing = null ][, int|Mage_Core_Model_Website|null|string|true $website = null ][, mixed $calculateTaxes = false ]) : array<string|int, mixed>
Parameters
- $product : Mage_Catalog_Model_Product
- $shipping : null|false|DataObject = null
-
Shipping Address
- $billing : null|false|DataObject = null
-
Billing Address
- $website : int|Mage_Core_Model_Website|null|string|true = null
- $calculateTaxes : mixed = false
Return values
array<string|int, mixed>getRowWeeeAmountAfterDiscount()
Calculate row weee amount for an order, invoice or credit memo item The returned value may contain discount if the discount is not included in the discount for subtotal
public
getRowWeeeAmountAfterDiscount(mixed $item) : float
Parameters
- $item : mixed
Return values
floatgetRowWeeeTaxInclTax()
Get the total weee including tax by row
public
getRowWeeeTaxInclTax(Mage_Core_Model_Abstract $item) : float
Parameters
- $item : Mage_Core_Model_Abstract
Return values
floatgetSalesPriceDisplayType()
Get weee amount display type in sales modules
public
getSalesPriceDisplayType([bool|int|Mage_Core_Model_Store|null|string $store = null ]) : int
Parameters
- $store : bool|int|Mage_Core_Model_Store|null|string = null
Return values
intgetTaxType()
Get Weee Tax Configuration Type
public
getTaxType([bool|int|Mage_Core_Model_Store|null|string $store = null ]) : int
Parameters
- $store : bool|int|Mage_Core_Model_Store|null|string = null
Return values
intgetTotalRowTaxAppliedForWeeeTax()
Get the Total tax applied for Weee
public
getTotalRowTaxAppliedForWeeeTax(Mage_Core_Model_Abstract|DataObject $item) : float
Parameters
- $item : Mage_Core_Model_Abstract|DataObject
Return values
floatgetTotalTaxAppliedForWeeeTax()
Get the total tax applied on weee by unit
public
getTotalTaxAppliedForWeeeTax(Mage_Core_Model_Abstract $item) : float
Parameters
- $item : Mage_Core_Model_Abstract
Return values
floatgetWeeeTaxInclTax()
Get the total weee tax
public
getWeeeTaxInclTax(Mage_Core_Model_Abstract $item) : float
Parameters
- $item : Mage_Core_Model_Abstract
Return values
floathasTags()
Check for tags in multidimensional arrays
public
hasTags(string|array<string|int, mixed> $data[, array<string|int, mixed> $arrayKeys = [] ][, bool $skipTags = true ]) : bool
Parameters
- $data : string|array<string|int, mixed>
- $arrayKeys : array<string|int, mixed> = []
-
keys of the array being checked that are excluded and included in the check
- $skipTags : bool = true
-
skip transferred array keys, if false then check only them
Return values
boolincludeInSubtotal()
Check if weee tax amount should be included to subtotal
public
includeInSubtotal([bool|int|Mage_Core_Model_Store|null|string $store = null ]) : bool
Parameters
- $store : bool|int|Mage_Core_Model_Store|null|string = null
Return values
boolisDiscounted()
Check if weee tax amount should be discounted
public
isDiscounted([bool|int|Mage_Core_Model_Store|null|string $store = null ]) : bool
Parameters
- $store : bool|int|Mage_Core_Model_Store|null|string = null
Return values
boolisEnabled()
Check if fixed taxes are used in system
public
isEnabled([bool|int|Mage_Core_Model_Store|null|string $store = null ]) : bool
Parameters
- $store : bool|int|Mage_Core_Model_Store|null|string = null
Return values
boolisModuleEnabled()
Check is module exists and enabled in global config.
public
isModuleEnabled([string $moduleName = null ]) : bool
Parameters
- $moduleName : string = null
-
the full module name, example Mage_Core
Return values
boolisModuleOutputEnabled()
Check whether the module output is enabled in Configuration
public
isModuleOutputEnabled([string $moduleName = null ]) : bool
Parameters
- $moduleName : string = null
-
Full module name
Return values
boolisTaxable()
Check if weee tax amount should be taxable
public
isTaxable([bool|int|Mage_Core_Model_Store|null|string $store = null ]) : bool
Parameters
- $store : bool|int|Mage_Core_Model_Store|null|string = null
Return values
boolisTaxIncluded()
Returns true if default store tax is already applied to the FPT(weee)
public
isTaxIncluded([bool|int|Mage_Core_Model_Store|null|string $store = null ]) : bool
Parameters
- $store : bool|int|Mage_Core_Model_Store|null|string = null
Return values
booljsQuoteEscape()
Escape quotes in java script
public
jsQuoteEscape(string|array<string|int, string> $data[, string $quote = '\'' ]) : ($data is array ? string[] : string)
Parameters
- $data : string|array<string|int, string>
- $quote : string = '\''
Tags
Return values
($data is array ? string[] : string)processTierPrices()
Adds HTML containers and formats tier prices accordingly to the currency used
public
processTierPrices(Mage_Catalog_Model_Product $product, array<string|int, mixed> &$tierPrices[, bool $includeIndex = true ]) : $this
Parameters
- $product : Mage_Catalog_Model_Product
- $tierPrices : array<string|int, mixed>
- $includeIndex : bool = true
Return values
$thisquoteEscape()
Escape quotes inside html attributes Use $addSlashes = false for escaping js that inside html attribute (onClick, onSubmit etc)
public
quoteEscape(string $data[, bool $addSlashes = false ]) : string
Parameters
- $data : string
- $addSlashes : bool = false
Return values
stringremoveTags()
Remove html tags, but leave "<" and ">" signs
public
removeTags(string $html) : string
Parameters
- $html : string
Return values
stringsetApplied()
Sets applied weee taxes
public
setApplied(Mage_Sales_Model_Quote_Item_Abstract $item, array<string|int, mixed> $value) : $this
Parameters
- $item : Mage_Sales_Model_Quote_Item_Abstract
- $value : array<string|int, mixed>
Return values
$thissetLayout()
Declare layout
public
setLayout(Mage_Core_Model_Layout $layout) : Mage_Core_Helper_Abstract
Parameters
- $layout : Mage_Core_Model_Layout
Return values
Mage_Core_Helper_AbstractsetStore()
Set the store for the current quote
public
setStore(Mage_Core_Model_Store $store) : mixed
Parameters
- $store : Mage_Core_Model_Store
setWeeeTaxesAppliedProperty()
Set a value to a specific property searching FPT by title for the Item
public
setWeeeTaxesAppliedProperty(Mage_Core_Model_Abstract $item, string $title, string $property, string $value) : mixed
Parameters
- $item : Mage_Core_Model_Abstract
- $title : string
- $property : string
- $value : string
stripTags()
Wrapper for standard strip_tags() function with extra functionality for html entities
public
stripTags(string $data[, null|string|array<string|int, string> $allowableTags = null ][, bool $escape = false ]) : string
Parameters
- $data : string
- $allowableTags : null|string|array<string|int, string> = null
- $escape : bool = false
Return values
stringtranslateArray()
Translate array
public
translateArray([mixed $arr = [] ]) : array<string|int, mixed>
@param array $arr
Parameters
- $arr : mixed = []
Return values
array<string|int, mixed>typeOfDisplay()
Returns display type for price accordingly to current zone
public
typeOfDisplay(mixed $product[, array<string|int, mixed>|int|null $compareTo = null ][, string $zone = null ][, Mage_Core_Model_Store $store = null ]) : bool|int
Parameters
- $product : mixed
- $compareTo : array<string|int, mixed>|int|null = null
- $zone : string = null
- $store : Mage_Core_Model_Store = null
Return values
bool|inturlDecode()
base64_decode() for URLs decoding
public
urlDecode(mixed $url) : string
@param string $url
Parameters
- $url : mixed
Return values
stringurlDecodeAndEscape()
base64_decode() and escape quotes in url
public
urlDecodeAndEscape(mixed $url) : string
@param string $url
Parameters
- $url : mixed
Return values
stringurlEncode()
base64_encode() for URLs encoding
public
urlEncode(mixed $url) : string
@param string $url
Parameters
- $url : mixed
Return values
stringvalidateCatalogPricesAndFptConfiguration()
Check if the configuration for the particular store causes conflicts
public
validateCatalogPricesAndFptConfiguration([Mage_Core_Model_Store|null $store = null ]) : bool
Parameters
- $store : Mage_Core_Model_Store|null = null
Return values
bool_cleanCache()
Cleaning cache
protected
_cleanCache([array<string|int, mixed> $tags = [] ]) : Mage_Core_Helper_Abstract
Parameters
- $tags : array<string|int, mixed> = []
Return values
Mage_Core_Helper_Abstract_getModuleName()
Retrieve helper module name
protected
_getModuleName() : string
Return values
string_getRequest()
Retrieve request object
protected
_getRequest() : Mage_Core_Controller_Request_Http
Return values
Mage_Core_Controller_Request_Http_getUrl()
Retrieve url
protected
_getUrl(string $route[, array<string|int, mixed> $params = [] ]) : string
Parameters
- $route : string
- $params : array<string|int, mixed> = []
Return values
string_loadCache()
Loading cache data
protected
_loadCache(string $id) : mixed
Parameters
- $id : string
_removeCache()
Removing cache
protected
_removeCache(string $id) : Mage_Core_Helper_Abstract
Parameters
- $id : string
Return values
Mage_Core_Helper_Abstract_saveCache()
Saving cache
protected
_saveCache(mixed $data, string $id[, array<string|int, mixed> $tags = [] ][, null|false|int $lifeTime = false ]) : Mage_Core_Helper_Abstract
Parameters
- $data : mixed
- $id : string
- $tags : array<string|int, mixed> = []
- $lifeTime : null|false|int = false