Hi Currently I am getting tax class name as follows
$_product = $item->getProduct()
$taxClassId = $_product->getTaxClassId();
$taxClass = Mage::getModel('tax/class')->load($taxClassId);
Which is fine if it is not called in for loop. But my problem is that I am doing that in a for loop. Which is very expensive. I have a invoice collection and calling the above code block for each invoice.
What I want to be able to do is have a query that will fetch all the SKUS and its corresponding tax class names. Which I will load before the for loop and when I need it I will call it from array.
**SKU Tax_Class_Name**
SKU_001 Taxable Goods
SKU_002 Taxable Goods
SKU_SHIP SHIPPING
I am not able to establish the correct tables so I can fire the query. catalog_product_entity
and tax_class
table will be needed but cannot find connection between the two.
Best Answer
I found answer to my question. It is not exactly what I wanted to but my way would have been wrong anyways. Since Tax class is assigned based on combination of Product and Website. Hence the following query.