j.k.r Posted April 29, 2015 Share Posted April 29, 2015 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. Link to comment Share on other sites More sharing options...
PascalVG Posted May 1, 2015 Share Posted May 1, 2015 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 : https://www.prestashop.com/forums/topic/274843-module-product-ratings-on-category-list-ps-15/ 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, pascal. Link to comment Share on other sites More sharing options...
j.k.r Posted June 11, 2015 Author Share Posted June 11, 2015 The ratings module you linked to helped me a lot, thank you! 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