Magento get price including tax in a none-template file

夙愿已清 提交于 2019-11-30 14:35:00
Alex

You can get a helper-instance in any file using:

Mage::helper('tax')

Your full code is:

$_product = Mage::getModel('catalog/product')->load($productId);
$_priceIncludingTax = Mage::helper('tax')
    ->getPrice($_product, $_product->getFinalPrice());

Thanks @Alex:

If the product has FinalPrice special price is the final price of the product to access the most serious tax base price:

    $_product = Mage::getModel('catalog/product')->load($p->getId());

    $_specialPriceIncTax = Mage::helper('tax')
        ->getPrice($_product, $_product->getFinalPrice());

    $_priceTax = Mage::helper('tax')
        ->getPrice($_product, $_product->getPrice());
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!