Jump to content

Which hook before the title


Recommended Posts

Hi.

There is no such catch.
You need to create your own hook and insert it into the TPL template.
E.g. ./themes/classic/templates/catalog/product.tpl
before the h1 tag.

Then you need to register such a hook in your module and then program the function.

Original TPL:

image.thumb.png.b9fb22a843cbe8004e4d4fc2a37f01e8.png

Updated TPL:

image.thumb.png.ff42e566197e77e6d3012a7593f44835.png

 

And your module:

public function hookDisplayBeforeProductName($params)
{
    $product = new Product((int)$params['product']['id_product'], false, $this->context->language->id, $this->context->shop->id);
    $idProduct = $product->id;

    $category = new Category((int)params['category']['id_category'], $this->context->language->id, $this->context->shop->id);
    $idCategory = $category->id;

    /* your code */
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...