0

So guys, got a question, need to edit the value of a system.xml more specifically app/code/core/Mage/Customer/etc/system.xml in the following excerpt:

<dob_show translate="label">
                            <label>Show Date of Birth</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_nooptreq</source_model>
                            <sort_order>70</sort_order>
                            <backend_model>adminhtml/system_config_backend_customer_show_customer</backend_model>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>0</show_in_store>
                        </dob_show>
                        <taxvat_show translate="label">
                            <label>Show Tax/VAT Number</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_nooptreq</source_model>
                            <backend_model>adminhtml/system_config_backend_customer_show_customer</backend_model>
                            <sort_order>80</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>0</show_in_store>
                        </taxvat_show>

for this:

<dob_show translate="label">
                            <label>Show Date of Birth</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_nooptreq</source_model>
                            <sort_order>70</sort_order>
                            <backend_model>adminhtml/system_config_backend_customer_show_customer</backend_model>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </dob_show>
                        <taxvat_show translate="label">
                            <label>Show Tax/VAT Number</label>
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_nooptreq</source_model>
                            <backend_model>adminhtml/system_config_backend_customer_show_customer</backend_model>
                            <sort_order>80</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </taxvat_show>

the case would change the value of "Show Date of Birth" and "Show Tax / VAT Number" for required, using my module, anybody have any idea how to do this?

update

I used the tip from David Manners, but it has not changed the values ​​in the panel

options on panel

my code:

/etc/modules/Ceicom_CustomerAccount.xml

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

system.xml

<config>
    <sections>
        <customer>
            <groups>
                <address>
                    <fields>
                        <dob_show>
                            <show_in_store>1</show_in_store>
                        </dob_show>
                        <taxvat_show>
                            <show_in_store>1</show_in_store>
                        </taxvat_show>
                    </fields>
                </address>
            </groups>
        </customer>
    </sections>
</config>
1

To update the value either add a value in the core_config_data table for the path customer/address/dob_show or if there is no value already in the table add the following in your config.xml

<default>
    <customer>
        <address>
            <dob_show>req</dob_show>
        </address>
    </customer>
</default>

Original Answer

Simply create your module that has a depends on Mage_Customer in the module xml file, so that the modules are loaded in the correct order.

Then you need to add the system.xml for your module with only the changes you need. So you do not need the full information if you are not changing it.

<config>
    <sections>
        <customer>
            <groups>
                <address>
                    <fields>
                        <dob_show>
                            <show_in_store>1</show_in_store>
                        </dob_show>
                        <taxvat_show>
                            <show_in_store>1</show_in_store>
                        </taxvat_show>
                    </fields>
                </address>
            </groups>
        </customer>
    </sections>
</config>
  • I tried but did not change the values ​​in the panel, i changed the post and put my code above – Jonatan Ribeiro dos Santos Apr 1 '14 at 12:39
  • 1
    @JonatanRibeirodosSantos I have updated my answer to include how to change the value, if it is the default value you want to change then use the config.xml change, if it is just what value set then try the path. If it is something altogether different you want sorry I miss understood :) – David Manners Apr 1 '14 at 12:52
  • thanks, that was it, I managed using a new field, but when I try with "taxvat_show" fields and "dob_show" he funciou not, I need of some permission or something? – Jonatan Ribeiro dos Santos Apr 1 '14 at 13:10
0

I solved my problem by creating an installation script to change the value directly in the database:

Mage::getModel('core/config')->saveConfig('customer/address/dob_show', 'req', 'default' );
Mage::getModel('core/config')->saveConfig('customer/address/taxvat_show', 'req', 'website' );

$dobAtribute = Mage::getModel('eav/entity_attribute')->loadByCode('customer', 'dob');
$dobAtribute->setData('is_required', 1);
$dobAtribute->setData('is_visible', 1);
$dobAtribute->save();

$taxvatAtribute = Mage::getModel('eav/entity_attribute')->loadByCode('customer', 'taxvat');
$taxvatAtribute->setData('is_required', 1);
$taxvatAtribute->setData('is_visible', 1);
$taxvatAtribute->save();

$genderAtribute = Mage::getModel('eav/entity_attribute')->loadByCode('customer', 'gender');
$genderAtribute->setData('is_required', 1);
$genderAtribute->setData('is_visible', 1);
$genderAtribute->save();

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.