> For the complete documentation index, see [llms.txt](https://docs.nosto.com/prestashop/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nosto.com/prestashop/guides/overriding-or-extending-functionalities/overriding-product-data.md).

# Overriding Product Data

In order to modify the product data that is sent to Nosto, you need to create your own mini-module. Please read the basics on [how to extend or override data in Nosto extension](/prestashop/guides/overriding-or-extending-functionalities.md)

For modifying Nosto's product data you must register hook **`actionNostoProductLoadAfter`** and implement corresponding action method. Below is an example of how your `MyNosto` class could look like.

File `modules/mynosto/mynosto.php`

```php
<?php

if (!defined('_PS_VERSION_')) exit;

/**
 * Module for overriding Nosto default behavior.
 *
 * Depends on the "Personalization for PrestaShop" module by Nosto.
 */
class MyNosto extends Module

{
    /**
     * Constructor.
     *
     * Defines the module.
     */
    public function __construct()
    {
        $this->name = 'mynosto';
        $this->tab = 'advertising_marketing';
        $this->version = '0.1.0';
        $this->author = 'Nosto';
        $this->need_instance = 1;
        $this->bootstrap = true;
        $this->ps_versions_compliancy = array(
            'min' => '1.4',
            'max' => _PS_VERSION_
        );
        parent::__construct();
        $this->displayName = $this->l('My Nosto');
        $this->description = $this->l('Module for overriding Nosto default behavior');
    }

    /**
     * Module installer.
     *
     * Registers the event listener for nosto events
     *
     * @return bool
     */
    public function install()
    {
        return (
            parent::install()
            && $this->registerHook('actionNostoProductLoadAfter')
        );
    }

    /**
     * Action method for modifying the Nosto product information before it is used the shop frontend or the server-to-server API.
     *
     * The input params will always include:
     *
     * - "nosto_product" which is the NostoTaggingProduct instance that has just been loaded with data
     * - "product" which is the Prestashop Product model instance used as source for the data
     * - "context" which is the Prestashop Context model instance used when loading the data
     *
     * Modifying the instance in $params['nosto_product'] will directly reflect on the data that is sent to Nosto. The
     * NostoTaggingProduct class has a public API of setter methods to modify it's content. Some common use cases are
     * document in below method.
     *
     * You can find a full reference of the available product fields in the Nosto support center.
     *
     * @param array $params
     *
     * @see https://support.nosto.com/get-started/tagging-product-pages/
     */
    public function hookActionNostoProductLoadAfter(array $params)
    {
        /** @var NostoProduct $nosto_product */
        $nosto_product = $params['nosto_product'];

        /** @var NostoTaggingProduct $prestashop_product_product */
        $prestashop_product = $params['product'];

        if ($nosto_product instanceof NostoProduct) {
           // Implement your customizations here
          $nosto_product->addTag3('nosto test');
          $nosto_product->setPrice($nosto_product->getPrice()*1.2);
          $nosto_product->setName($nosto_product->getName() . ' - TEST OVERRIDE');
        }
    }
}
```

## 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](https://help.nosto.com/en/articles/1441625-how-to-use-the-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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.nosto.com/prestashop/guides/overriding-or-extending-functionalities/overriding-product-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
