2

I have a csv file with more than 400 items to import.

All the attributes are imported fine except for the fixed product tax (that is the same for all products).

I tried to manually create one on a product and to export it, but nothing appears in the generated csv.

Is there a way to add it in the csv, or to manually trigger it on all products?

  • Did you find an answer here? Please mark it as solution. – Fabian Blechschmidt May 8 '13 at 14:20
  • Nope, @FabianBlechschmidt, none of that worked. As I said FPT do not work as regular taxes in magento. – TopperH May 15 '13 at 21:32
2

TopperH, You have probably manually edited your 400 products and no longer need this but this is provided for future reference, since it was all new to me.

I went thru the process of setting up a flat tax attribute of recycle, added it to products and tried to export. I got the header in the csv as you did but no values for the tax.

Look in the table mage_weee_tax for the entries you have entered already (mage_ is my prefix) WEEE = waste of electrical and electronical equipment.

I created a recycle_fee attribute (my entity 137) and added this to default attribute group and then set it in two of my three products in Manage Products: US california for one and Angola for the other to stand out in a search of the db dump. that is values 1 & 2 below Then I added two more states to product with entity "2" and it removed value_id 1 and added 3, 4 & 5 CA = 12 & etc from mage_directory_country_region And I changed the value of value_id 2 from 6.00 to 4.00 to 2.00 and it removed value_id 2 and added 6 removed 6 and added 7

value_id, website_id, entity_id, country, value, state, attribute_id, entity_type_id
    1   0   2   US  4.0000  12  137     4
    2   0   3   AO  6.0000  *   137     4
    3   0   2   US  4.0000  12  137     4
    4   0   2   US  3.0000  43  137     4
    5   0   2   US  2.0000  13  137     4
    6   0   3   AO  4.0000  *   137     4
    7   0   3   AO  2.0000  *   137     4

The effect is that the saving of any change to a products fixed product tax removes all records for that product and adds all them all as new records.

So how does this help you? Depends on where you are in the process and the complexity of these taxes. If your 400 items all have the same tax country and state and you have the entity_id of your product you could directly update or import into this table.

I tested this on test products and a test database. I changed records so each product had only one entry US and one state 12 for California and it displayed correctly in the Manage Product page

If you have only the sku you'll have to get the entity_id ...

<?php
error_reporting(E_ALL | E_STRICT);
require_once '../ohs1/app/Mage.php';
$app = Mage::app();
Mage::register('isSecureArea', true);

$file = 'skus_ids.csv';
$csv = new Varien_File_Csv();
$headdata = array();

$headdata['id'] = 'id' ;
$headdata['sku']  = 'sku';

$csvdata = array();
$csvdata[] = $headdata;
$products = Mage::getModel('catalog/product')->getCollection();

foreach ($products as $product) 
{
    $product_data = array();
    $product_data['id'] = $product->getId();
    $product_data['sku'] = $product->getSku();

    $csvdata[] = $product_data;
}

$csv->saveData($file, $csvdata);

And use this to import back into the weee_tax table.

1

Fabian is correct on that header. I will add that you will find this stuff really helpful. http://sourceforge.net/projects/magmi/

I have had to do some pretty hectic imports. That stuff rules the day. If you fudge something you can simply keep running it.

0

You can filter the products in the admin product grid and "Change attribute" and set the tax class for all products.

Or do you mean in the import? There can be a column with the name tax_class_id which sets the tax class.

  • Nope, this will not work. I'm not talking about regular taxes but about FPT (magentocommerce.com/knowledge-base/entry/…) - Those are treated pretty much like an attribute but do not appear in the mass change attribute, nor can be imported in a csv in any way that I'm aware of – TopperH Mar 25 '13 at 11:14
  • Wow, damn it, there are things in the tax I never heard about :( – Fabian Blechschmidt Mar 25 '13 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.