simpshoper Posted March 13, 2013 Share Posted March 13, 2013 (edited) Hi, I wanted to implement top rated products feature in my custom rating module. I get the correct product IDs from my module database, then I create product instance from it, but still I don't know how to get product name, image, etc. I tried the following: foreach($topProductIDs as $topProductID) { $topProduct = new Product($topProductID); $name = $topProduct->getProductName(); $link = $topProduct->getLink(); $link_rewrite = $topProduct->link_rewrite; ... } but I got a lot of errors, including: Missing argument 1 for ProductCore::getProductName() and that link_rewrite is an array. I am using Prestashop 1.5.3.1 if that matters. What am I doing wrong? Maybe there is a better way to get product information from its ID? Thanks in advance Edited March 13, 2013 by simpshoper (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted March 13, 2013 Share Posted March 13, 2013 You should probably checkout the Product class file. In any case, for sure you're missing the argument 1: language id, like this: $name = $topProduct->getProductName($this->context->language->id); 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