Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to force catalog prices include or exclude tax #36

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion app/code/core/Mage/Tax/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand All @@ -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;
}

/**
Expand Down