MAGENTO, How to find Product Tax Rate OR Tax Percentage



## MAGENTO, How to find Product tax rate

foreach ($productIds as $productId) {
$_product = Mage::getModel('catalog/product')->load($productId);
$productsPrice = floatval($_product->getData("price"));

// Get the product's tax class' ID
$taxClassId = $_product->getData("tax_class_id");
echo 'Tax Class ID '.$taxClassId.'
';
// Get the tax rates of each tax class in an associative array
$taxClasses = Mage::helper("core")->jsonDecode( Mage::helper("tax")-        
>getAllRatesByProductClass() );
echo 'Tax Classes '.$taxClasses.'
';

// Extract the tax rate from the array
$taxRate = $taxClasses["value_".$taxClassId];
echo 'Tax Rate '.$taxRate.'
';

}
?>

Comments

Post a Comment

Popular posts from this blog

AIOMgr: Preparing flush failed with VERR_NOT_SUPPORTED, disabling async flushes

Create Virtual Host in IIS Server

The model type is invalid. please select an item from the list ( ASP.Net MVC)