Jump to content

custom module get all displayed products


Recommended Posts

I'm working on a custom module that will return some data unique to each product displayed.  I don't know how to get the product id of each displayed product back to my module.  Once I have the product IDs in my module, I should be able to query the database to get information about each product, do some calculations, and then display the results in the product list via a custom hook in product-list.tpl.


I already have a custom hook in product-list.tpl that displays static test data.  I just don't know how to get the product ID and then return each unique/dynamic result to the appropriate product displayed in product-list.tpl.


I'm fairly new to Prestashop, so this is probably a trivial matter, but I'm not quite sure how to get started.  I attached a screenshot that might help explain.  I'm using Prestashop 1.6.





Share this post

Link to post
Share on other sites

Hi jkr,


Maybe just look at some code and see how others do things. An example of how to add product specific code on the product list, maybe this one could help :




Maybe not fully up to date, but you should be able to filter out the idea on how to get to product data and display it in a tpl.



My 2 cents,


Share this post

Link to post
Share on other sites

  • 1 month later...

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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More