===================
Update the Tax Class of all products in Magento with SQL
If you have a Magento store with hundreds or even thousands of products and for some reason are not able to update the tax class through the back end you can do it directly in the database with a couple of simple SQL queries.
I have recently been working on a Magento store which for some reason has some products that don’t have SKUs, this is stopping me from batch updating the tax class through the admin system.
You will need two queries to complete this. First of all we need to find out what the attribute_id of the tax class attribute is. Query 1 shows how to retrieve this value. In my case the “attribute_id” returned was 122 but yours may be different.
Query 1:
Next we need to update the tax class id to the tax class we wish our products to fall under, 2 is for Taxable Goods. To view the different tax class ids take a look at the table called tax_class.
Query 2:
1
|
UPDATE catalog_product_entity_int SET value=2 WHERE attribute_id=122;
http://www.functionexists.co.uk/update-the-tax-class-of-all-products-in-magento-with-sql/ |