Overriding Product Data
You can override the product model Nosto extension uses as data source for both the tagging in the store front and the API calls. Please read here the basics how to alter the functionalities of Nosto extension.
Note: As of extension version > 3.0.0 you must use getters and setters to populate and access Nosto product object attributes.
Required files and configurations
1. The module configuration app/code/local/My/Nosto/etc/config.xml
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>
</rewrite>
</nosto_tagging>
</models>
</global>
</config>2. The overridden product model app/code/local/My/Nosto/Model/Meta/Product.php
app/code/local/My/Nosto/Model/Meta/Product.phpAfter this, you can modify the Product.php file according to your needs. Clearing the Magento cache will make the extension work.
Verifying
Once you have overridden the product model and customised whatever fields you may need, you should verify that it, in fact, working as expected.
A simple way to verify that the changes are working would be to view any product page with the Nosto debug-mode enabled. The debug mode can be enabled by adding the query parameter nostodebug=true to the end of any URL. This will cause a helpful debug toolbar to appear where you can view the tagged data on the page. For more information on the debug-toolbar, please refer to this guide titled Nosto Debug Toolbar in our Support Center.
If you were to extend the product model using the example given above, you would see that the "Tags" field in the debug-toolbar will read "nosto".
NOTE: Please note that in order to verify the changes using the debug-toolbar, you must have a Nosto account for the given store.
Last updated
Was this helpful?