Magento Forum

   
Batch Tax Class Update/MySQL table location
 
monsterweb
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2009-05-18
 

Easy one here I hope - I need to do a batch tax class id update on about 3000 products in a Magento database. I have looked a good bit, but I don’t see a ‘tax_class_id’ type field on any of the product tables.

So, a two part question.

1. What table is this on in the database?

2. Is there a way to do this in the UI?

The reason to do the batch update is that the previous developers had 2 tax classes, and we do not need them both. Half the products have one class, the other half has a different class set. Thanks a lot!

 
Magento Community Magento Community
Magento Community
Magento Community
 
monsterweb
Jr. Member
 
Avatar
Total Posts:  16
Joined:  2009-05-18
 

Bump! Still haven’t got this guy figured out...any help would be great. Thanks!

 
Magento Community Magento Community
Magento Community
Magento Community
 
GalerieGaertner
Jr. Member
 
Total Posts:  8
Joined:  2008-08-04
 

Hi there,
You could use the Import/expot -feature of magento:
export all your Products, only the Fields “SKU” and “Tax_class_ID” to xml or csv,
Change the “Tax_class_ID” in excel or calc and import it again.
regards!

 
Magento Community Magento Community
Magento Community
Magento Community
 
perandre
Jr. Member
 
Total Posts:  30
Joined:  2009-02-06
 

Is it possible to do an import with just those two fields?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jase Clamp
Jr. Member
 
Total Posts:  19
Joined:  2009-06-09
 

UPDATE `catalog_product_entity_int` SET `value` =2 WHERE `attribute_id` =81;
Just change the value with the ID of the tax class you want all products to be updated to.
81 is the id of the attribute ‘tax class’
I just used this to update a store with 500 products. Very handy.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Benxamin
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2009-10-06
Sioux Falls, SD
 

@ChaseWalker This worked perfectly! Thank you

 
Magento Community Magento Community
Magento Community
Magento Community
 
agavss
Jr. Member
 
Total Posts:  4
Joined:  2010-03-09
 
ChaseWalker - 07 December 2009 08:45 AM

UPDATE `catalog_product_entity_int` SET `value` =2 WHERE `attribute_id` =81;
Just change the value with the ID of the tax class you want all products to be updated to.
81 is the id of the attribute ‘tax class’
I just used this to update a store with 500 products. Very handy.

in my magento version (v1.4.0.1) the attribute_id is 85 so i changed the query this way:

UPDATE `catalog_product_entity_intSET `value` =2 WHERE `attribute_id` =85;

 
Magento Community Magento Community
Magento Community
Magento Community
 
Jeena Paradies
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2008-03-10
 
agavss - 23 November 2010 02:12 AM

in my magento version (v1.4.0.1) the attribute_id is 85 so i changed the query this way:

UPDATE `catalog_product_entity_intSET `value` =2 WHERE `attribute_id` =85;

How can I find out which id it is in my magento?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Hatimeria
Jr. Member
 
Avatar
Total Posts:  1
Joined:  2011-08-30
Kraków, Poland
 
Jeena Paradies - 09 June 2011 07:02 AM

agavss - 23 November 2010 02:12 AM

in my magento version (v1.4.0.1) the attribute_id is 85 so i changed the query this way:
UPDATE `catalog_product_entity_intSET `value` =2 WHERE `attribute_id` =85;

How can I find out which id it is in my magento?

You can use this query:

select from eav_attribute where attribute_code like 'tax_class_id';

Or use it in your update query:

UPDATE `catalog_product_entity_intSET `value` =2 WHERE `attribute_id` = (select from eav_attribute where attribute_code like 'tax_class_id');

good luck!

 
Magento Community Magento Community
Magento Community
Magento Community
 
mrsopacua
Jr. Member
 
Total Posts:  3
Joined:  2012-11-05
 
Hatimeria - 06 October 2011 01:28 AM

How can I find out which id it is in my magento?

You can use this query:

select from eav_attribute where attribute_code like 'tax_class_id';

It’s a bit more complicated in 1.7:

SELECT attribute_id FROM eav_attribute A LEFT JOIN eav_entity_type T ON A.entity_type_id=T.entity_type_id WHERE attribute_code LIKE 'tax_class_id' AND T.entity_type_code='catalog_product';

The other two entities that can match are quote_item and quote_address_item. YMMV.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top