Magento CE ver. 1.7.0.2
I'm trying to grab some order data from our Magento store to integrate into our other business software. In my case I need to compute the price plus tax on individual items. The below code only works if Display Product Prices In Catalog is set to Include or Both (in System > Configuration > Sales > Tax). How can I calculate the tax on an item while still having the website display prices excluding tax?
$customer_tax_class = Mage::getModel('tax/calculation')->getRateRequest()->getCustomerClassId();
$_product = Mage::getModel('catalog/product')->loadByAttribute('sku',$skunumber);
$my_price = Mage::helper('tax')->getPrice($_product, $_product->getPrice(), true, $shippingAddress, $billingAddress, $customer_tax_class);
I also tried using this instead, but I still get prices without tax (unless I change display settings mentioned above):
$_finalPriceInclTax = Mage::helper('tax')->getPrice($_product, $_product->getFinalPrice(), true, $shippingAddress, $billingAddress, $customer_tax_class);
I know it must be possible, as Magento figures out the tax when you place the order. Any help would be greatly appreciated.