Greetings,
I've created a product database which all use the template product.php and are published on the website.
I'm trying to create an overview table with pagination of all the products, but using $pages->get does not return an object, only the object title.
$products = $pages->get("template=product, limit=10");
This returns 10 strings in the frontend but not the object. When looping over the result set to get product fields, i get the following error:
Notice: Trying to get property 'title' of non-object
Because the product database is fairly large, i've added a pagination using the same query and this does return all the pages, but i can't click on the links that the paginator renders.
$results = $pages->find("template=product, limit=10");
if($results->getTotal() > 10) {
echo $results->renderPager(array(
"nextItemLabel" => "Volgende",
"previousItemLabel" => "Vorige",
"currentItemClass" => 'active'
));
}
I've added the option in the template to allow page numbers. When i navigate to the link manually, i still end up seeing the 10 first products.
I've tried changing several settings around, but i'm a bit stuck on how to resolve these issues. Do you have any advice what I need to adjust?
Thanks in advance for your feedback.