Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Overriding Navigation.php SOLVED
 
warren
Member
 
Total Posts:  67
Joined:  2007-12-18
 

Folks

I would like to add 1 line of code to \app\code\core\Mage\Catalog\Block\Navigation.php

Its not ideal to edit the core code so i have been trying to separate it out into local code.

Its not working and im wondering if you can help?

Im creating

\app\code\core\BOW\Catalog\Block\Navigation.php - and added the line of code i need

I changed the top line of code to:

class BOW_Catalog_Block_Navigation extends Mage_Catalog_Block_Navigation

I then created:

\app\code\local\BOW\Catalog\etc\config.xml

and added this code:

<config>
    <
modules>
        <
BOW_Navigation>
            <
version>0.1.0</version>
        </
BOW_Navigation>
    </
modules>

    <global>
        <
blocks>
          <
catalog>
            <
rewrite>
              <
navigation>BOW_Catalog_Block_Navigation</navigation>
            </
rewrite>
          </
catalog>
        </
blocks>

    </global>
</
config>

I then edited:

\app\etc\local.xml

to contain:

<config>
    <
modules>
        <
BOW_Navigation>
            <
active>true</active>
            <
codePool>local</codePool>
        </
BOW_Navigation>
    </
modules>

    <global>
        <
install>
            <
date>{{date}}</date>
        </
install>
        <
crypt>
            <
key>{{key}}</key>
        </
crypt>
        <
disable_local_modules>false</disable_local_modules>
        <
resources>
            <
db>
                <
table_prefix>{{db_prefix}}</table_prefix>
            </
db>
            <
default_setup>
                <
connection>
                    <
host>{{db_host}}</host>
                    <
username>{{db_user}}</username>
                    <
password>{{db_pass}}</password>
                    <
dbname>{{db_name}}</dbname>
                    <
active>1</active>
                </
connection>
            </
default_setup>
         </
resources>
     </global>
</
config>

Every time i run a page, magento times out and i have to do the reinstalation process again :o(

Could someone point out where im going wrong?

Cheers

Warren

 
Magento Community Magento Community
Magento Community
Magento Community
 
warren
Member
 
Total Posts:  67
Joined:  2007-12-18
 

Sorry for bumping this guys, but im totally stalled on this one smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
warren
Member
 
Total Posts:  67
Joined:  2007-12-18
 

OK so this was a real pain in the arse smile

But here are pointers you MUST read.

1) This link has the steps, you can ignore the other tutorials until you try this.

http://www.magentocommerce.com/wiki/groups/174/changing_and_customizing_magento_code

2) the local.xml file is supposed to have your instalation data in it!! every thing in {{***}} should have actual data inside it *Otherwise you have to reinstall every time*

3) Delete all the code and functions you are not editing and just leave in the function you are changing.

4) Double check you are adding the information to the correct XML file, and in the correct place inside that XML file.

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