1、获取产品加上税之后的价格:
3、获取产品的税率方法二:
4、获取产品的税率方法三:
$_finalPriceInclTax = Mage::helper(’tax’)->getPrice($_product, $_product->getFinalPrice(), true);
2、获取产品的税率方法一:
// Get the product's tax class' ID
$taxClassId = $_product->getData("tax_class_id");
// Get the tax rates of each tax class in an associative array
$taxClasses = $this->helper("core")->jsonDecode( $this->helper("tax")->getAllRatesByProductClass() );
// Extract the tax rate from the array
$taxRate = $taxClasses["value_" . $taxClassId];
3、获取产品的税率方法二:
/**
* @var $tax_helper Mage_Tax_Model_Calculation
*/
$tax_helper = Mage::getSingleton('tax/calculation');
$tax_request = $tax_helper->getRateOriginRequest();
$tax_request->setProductClassId($product->getTaxClassId());
$tax = $tax_helper->getRate($tax_request);
4、获取产品的税率方法三:
$store = Mage::app()->getStore('default');
$request = Mage::getSingleton('tax/calculation')->getRateRequest(null, null, null, $store);
$taxclassid = $product->getData('tax_class_id')
$percent = Mage::getSingleton('tax/calculation')->getRate($request->setProductClassId($taxclassid));