cancel
Showing results for 
Search instead for 
Did you mean: 

Change Tax Rates in Database

SOLVED

Change Tax Rates in Database

Hey,

 

I wanted to change all the products with "Taxable Goods" which was ID 2 and change it to ID 12 that is a custom.

So I went to the catalog_product_index_price and changed all the Tax_class_ID to 12 but some products didn't change.

There is any other place where the tax might be defined?

 

Thanks Smiley Very Happy

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Change Tax Rates in Database

Hi @rui_silva1 

Tax_class_id are saved in catalog_product_entity_int table based on attribute_id.

You can get attribute_id for tax_class_id from following query.

SELECT *  FROM `eav_attribute` WHERE `attribute_code`='tax_class_id'


For selct products

SELECT * FROM `catalog_product_entity_int` WHERE `attribute_id` in (SELECT attribute_id FROM `eav_attribute` WHERE `attribute_code`='tax_class_id' )


For Update

Update `catalog_product_entity_int` set `tax_class_id`=12  WHERE `attribute_id` in (SELECT attribute_id FROM `eav_attribute` WHERE `attribute_code`='tax_class_id' )


NOTE: Take the DB table backup first before update query or try once with single product.

I hope it will help you!

View solution in original post

3 REPLIES 3

Re: Change Tax Rates in Database

Hi @rui_silva1 

Tax_class_id are saved in catalog_product_entity_int table based on attribute_id.

You can get attribute_id for tax_class_id from following query.

SELECT *  FROM `eav_attribute` WHERE `attribute_code`='tax_class_id'


For selct products

SELECT * FROM `catalog_product_entity_int` WHERE `attribute_id` in (SELECT attribute_id FROM `eav_attribute` WHERE `attribute_code`='tax_class_id' )


For Update

Update `catalog_product_entity_int` set `tax_class_id`=12  WHERE `attribute_id` in (SELECT attribute_id FROM `eav_attribute` WHERE `attribute_code`='tax_class_id' )


NOTE: Take the DB table backup first before update query or try once with single product.

I hope it will help you!

Re: Change Tax Rates in Database

@rui_silva1 

does it work for you?

Re: Change Tax Rates in Database

@Vimal Kumar 

Sorry for the late reply, it worked, changed all to ID12 but some of the products in the backoffice stayed in Taxable Goods for some reason, but they were few so they were changed there.

 

Thanks Smiley Very Happy