Darkpingouin Posted January 9, 2019 Share Posted January 9, 2019 (edited) Hello, I am very new to prestashop development and I am trying to build a module that would display custom data (from an API) depending on the product info. I want this data to be displayed inside the product list block so that it is dependant on the product itself (see image). But I don't know how to proceed. I looked for hooks but I don't fully understand which one to use for this specific case.. Do I need to create a Module that will overide products.tpl or product-prices.tpl inside /themes/classic/templates/catalog/_partials ? Or is there simply a way to add a custom hook in a loop maybe ? Edited January 9, 2019 by Darkpingouin (see edit history) Link to comment Share on other sites More sharing options...
JBW Posted January 9, 2019 Share Posted January 9, 2019 Try to use hook displayProductPriceBlock or displayProductListReviews. You can find these hooks used in classic template in themes\classic\templates\catalog\_partials\miniatures\product.tpl Link to comment Share on other sites More sharing options...
Darkpingouin Posted January 9, 2019 Author Share Posted January 9, 2019 So do I just add a function in my module.php file like this : public function hookDisplayProductListReviews($params) { return $this->hookDisplayLeftColumn($params); } Because the module doesn't seem to appear there, neither can I attach it by navigation to Appaerence>Positions Link to comment Share on other sites More sharing options...
JBW Posted January 9, 2019 Share Posted January 9, 2019 Did you register the hook in your modules installation routine? Look at some other modules example how they do it! Link to comment Share on other sites More sharing options...
Darkpingouin Posted January 9, 2019 Author Share Posted January 9, 2019 @JBW I am so dumb, I did skip that part. Thanks a lot for your time 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