1

I only have one TAX option but when entering new product I'm forced to set the TAX option.

Is there a way set a TAX value to default?

5

The easiest way is changing a value in Magento Database

UPDATE `eav_attribute` SET `default_value` = '2' WHERE `eav_attribute`.`attribute_code`='tax_class_id';

By default is set as NULL So change default_value = 'Your value tax'

If you inspect Taxes Dropdrop you will find Tax Value

enter image description here

3

You could add a small custom module, MyModule\Taxdefault

This way you have some history and deployment covered.

app/etc/modules/MyModule_Taxdefault.xml

<?xml version="1.0"?>
<config>
    <modules>
        <MyModule_Taxdefault>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <Mage_Catalog />
            </depends>
        </MyModule_Taxdefault>
    </modules>
</config>

app/code/local/MyModule/Taxdefault/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <MyModule_Taxdefault>
            <version>0.0.1</version>
        </MyModule_Taxdefault>
    </modules>
    <global>
        <resources>
            <mymodule_taxdefault>
                <setup>
                    <module>MyModule_Taxdefault</module>
                    <class>Mage_Catalog_Model_Resource_Setup</class>
                </setup>
            </mymodule_taxdefault>
        </resources>
    </global>
</config>

app/code/local/MyModule/Taxdefault/sql/mymodule_taxdefault/install-0.0.1.php

<?php
$installer = $this;
/* @var $installer Mage_Catalog_Model_Resource_Setup */

$installer->startSetup();

// Will update the attribute
$installer->updateAttribute('catalog_product','tax_class_id','default_value',YOUR_WANTED_TAX_CLASS_ID);

$installer->endSetup();
2
  • Its not working, correctly...
    – Srihari
    Jul 27 '16 at 14:51
  • it should be updateAttribute() instead of addAttribute() Apr 28 '17 at 12:18
0

Go to your sql_db and find the record "tax_class_id" in the table "eav_attribute" and update the field "default_value" with the desired value.

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.