Hi
I'm Editing one of my older 2.4 sites as the client has requested the jquery pagination needs to be a physical one which i added to the Category page yesterday, this was working initially but has since stopped giving me any results. I cant fault the code or find any reason why in the instance of the pagination function its no longer giving any results?
The first function retrieves all the products to this category, this works but when i reference the function or replicate the process in pagination it doesn't return any results or errors?
//Return the list of products for this category
public function getProductsList(){
return $this->Products(Null, 'Title ASC');
}
//Return the list of products using pagination
function getChildPages() {
if(!isset($_GET['start']) || !is_numeric($_GET['start']) || (int)$_GET['start'] < 1) $_GET['start'] = 0;
$SQL_start = (int)$_GET['start'];
$listedProducts = $this->getProductsList();
$doSet = new DataObjectSet();
foreach ($listedProducts as $listedProduct) {
if ($listedProduct->canView()) {
$doSet->push($listedProduct);
}
}
$doSet->setPageLimits($SQL_start, 12, $doSet->Count());
return $doSet;
}
In the page we have:
<div class="product_navigation">
<% if getChildPages.MoreThanOnePage %><p><% if getChildPages.PrevLink %><a href="$getChildPages.PrevLink">< Prev</a> | <% end_if %><% control getChildPages.Pages %><% if CurrentBool %><strong> $PageNum </strong><% else %><a href="$Link" title="Go to page $PageNum">$PageNum</a><% end_if %><% end_control %><% if getChildPages.NextLink %> | <a href="$getChildPages.NextLink">Next ></a><% end_if %></p><% end_if %>
</div>
<div class="products">
<% control getChildPages.Pagination %>
<div class="box">
<a href="$Link" title="$Title">
<div class="img_holder">
<% if MainImage %>
$MainImage.CroppedImage(125,90)
<% else %>
<img src="$ThemeDir/images/comingsoon.jpg" alt="Image coming soon" />
<% end_if %>
</div>
<h1>$Year $Make<br/>$Model</h1>
<p>more information »</p>
</a>
</div>
<% end_control %>
</div>
Any help would be welcomed