Maria Gonzalez Posted May 30 Share Posted May 30 Hi, I'll like to add some info before the title on the products page.... which hook should I use? I tried displayProductBeforeInfo but it is show after the title... Thanks for your help Link to comment Share on other sites More sharing options...
ps8modules Posted June 1 Share Posted June 1 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: Updated TPL: 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 More sharing options...
Maria Gonzalez Posted June 1 Author Share Posted June 1 ok, thanks!! Link to comment Share on other sites More sharing options...
ps8modules Posted June 1 Share Posted June 1 I hope I directed you in the right direction 🤫 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now