1

I have a controller rewrite (working fine) that rewrites the customer login action.

It's just an exercise, and I'm trying to automatically direct the user to the men's section of the store immediately upon login.

In the module's config (the one rewriting the controller), I have the following section:

<default>
    <customer_rewrite>
        <customer>
            <target_category_id>16</target_category_id>
        </customer>
    </customer_rewrite>
</default>

The overwritten login controller looks like this:

public function loginAction()
{
    parent::loginAction();

    $categoryId = Mage::getStoreConfig('customer_rewrite/customer/target_category_id');
    // Do more stuff here...
}

My question is this: When using Mage::getStoreConfig(), how does Magento know which config.xml to look in? Does it parse through all of them to find my unique node, or does it somehow get told which module's config to use?

2

Magento have a table named core_config_data which structure is like this: enter image description here

In this table magento store all value of system.xml defined path.

Like for category root id it store catalog/category/root_id as a path.

| improve this answer | |
  • Thanks Asish, but I already know about the core_config_data table, my question is more with regards to reading XML configs, and not the configs in the DB :) – Skytiger Apr 26 '16 at 11:32

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.