From 8885e1fb318d5056aabef58a26fc1cdc9502e480 Mon Sep 17 00:00:00 2001 From: imaksimus Date: Wed, 4 Jul 2012 17:25:14 +0300 Subject: [PATCH] It would be very helpful to have such functionality for catalog prices like shipping prices already have. This is particularly necessary for 3rd party extensions which creates orders based on data from external sources (i.e. eBay, Amazon etc). --- app/code/core/Mage/Tax/Model/Config.php | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/app/code/core/Mage/Tax/Model/Config.php b/app/code/core/Mage/Tax/Model/Config.php index 4f9bc3f0a9d30..1ff2e1814b26e 100644 --- a/app/code/core/Mage/Tax/Model/Config.php +++ b/app/code/core/Mage/Tax/Model/Config.php @@ -91,6 +91,11 @@ class Mage_Tax_Model_Config */ protected $_needUsePriceExcludeTax = false; + /** + * @var $_priceIncludeTax bool + */ + protected $_priceIncludeTax = null; + /** * Flag which notify what we need use shipping prices exclude tax for calculations * @@ -114,7 +119,23 @@ public function priceIncludesTax($store=null) if ($this->_needUsePriceExcludeTax) { return false; } - return (bool)Mage::getStoreConfig(self::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, $store); + if ($this->_priceIncludeTax === null) { + $this->_priceIncludeTax = (bool)Mage::getStoreConfig( + self::CONFIG_XML_PATH_PRICE_INCLUDES_TAX, + $store + ); + } + return $this->_priceIncludeTax; + } + + /** + * Declare prices type + * @param bool $flag + */ + public function setPriceIncludeTax($flag) + { + $this->_priceIncludeTax = $flag; + return $this; } /**