Magento

Uit Rolandow
Versie door Rolandow (Overleg | bijdragen) op 17 apr 2012 om 08:27

(wijz) ← Oudere versie | Huidige versie (wijz) | Nieuwere versie → (wijz)
Ga naar: navigatie, zoeken

Remove compare

To remove the compare button, and the sidebar, there's two things that need to be changed. One thing is in the core of magento. To keep installation clean, copy /app/code/core/Mage/Catalog/Helper/Product/Compare.php to /app/code/local/Mage/Catalog/Helper/Product/Compare.php. Then change function getAddUrl, let it return false.

Second, we need to change the template. Edit /app/design/frontend/<package>/<theme>/layout/config.xml .. In the default element, comment out the block that refers to the compare stuff.

It's all explained here:

http://www.aschroder.com/2009/07/removing-the-compare-function-in-magento-the-easy-way/

Add a link

You can use local.xml, or another xml, to add and remove links. I wanted to add a link on the top.links menu. It seems that the order of the xml elements is important for correct parsing.

<?xml version="1.0" encoding="utf-8"?>
<layout version="0.1.0">
    <default>
        <reference name="root">
            <reference name="top.links">
                <action method="addLink" translate="label title">
                    <label>snel bestellen</label>
                    <url>quickorder</url>
                    <title>snel bestellen</title>
                    <prepare>true</prepare>
                    <urlParams/>
                    <position>141</position>
                </action>
            </reference>
        </reference>
    </default>

So to alter the position of the link, this has to be the 6th element in the XML. The XML node names are not used!

Source: http://www.magentocommerce.com/boards/viewreply/121137