Skip to content
This repository has been archived by the owner on Apr 26, 2022. It is now read-only.

Overriding or extending functionalities

Hannu Pölönen edited this page Mar 23, 2018 · 9 revisions

You can extend the functionality of Nosto extension and modify what data is sent to Nosto.

In order to extend Nosto extension's functionality (methods, data, etc.) you must create a small Magento extension. This way, you can override the product model, order model or any other functionality provided by Nosto extension.

You need two configuration files for your custom extension: the main module file and the actual module configuration that defines the overrides.

The main module file in app/etc/modules/My_Nosto.xml

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

The module config file in app/code/local/My/Nosto/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <My_Nosto>
            <version>0.1.0</version>
        </My_Nosto>
    </modules>
    <global>
        <models>
            <nosto_tagging>
                <rewrite>
                    <meta_product>My_Nosto_Model_Meta_Product</meta_product>
                    <meta_order>My_Nosto_Model_Meta_Order</meta_product>
                </rewrite>
            </nosto_tagging>
        </models>
    </global>
</config>

In the example configuration above we are overriding Nosto's Product and Order models. See full example how to override Product data from here