anaism Posted July 30, 2008 Share Posted July 30, 2008 hello I really need someone to help me since I found a pagination problem in my store. Please kindly visit below link and click next page.http://www.heartdisk.com/store/category.php?id_category=10it still showed the first page, and not able to move forward to another page...Anyone can help to fix this?Thanks so much! Link to comment Share on other sites More sharing options...
ejectcore Posted July 30, 2008 Share Posted July 30, 2008 Should be easy enough to fix if you could either send me your FTP/Back office details or copy & paste you pagination code into this topic using the editor block Link to comment Share on other sites More sharing options...
anaism Posted July 31, 2008 Author Share Posted July 31, 2008 Thanks!Please see my pagination page as below: <?php $nArray = array(10, 20, 50); $n = abs(intval(Tools::getValue('n', intval(Configuration::get('PS_PRODUCTS_PER_PAGE'))))); $p = abs(intval(Tools::getValue('p', 1))); $range = 2; // how many pages around page selected if (!$n) $n = $nArray[0]; if ($p < 0) $p = 0; if ($p > ($nbProducts / $n)) $p = ceil($nbProducts / $n); $pages_nb = ceil($nbProducts / intval($n)); $start = $p-$range; if ($start < 1) $start = 1; $stop = $p+$range; if ($stop > $pages_nb) $stop = $pages_nb; $smarty->assign(array( 'pages_nb' => $pages_nb, 'p' => intval($p), 'n' => intval($n), 'nArray' => $nArray, 'range' => intval($range), 'start' => intval($start), 'stop' => intval($stop) )); ?> Link to comment Share on other sites More sharing options...
anaism Posted July 31, 2008 Author Share Posted July 31, 2008 code in pagination.tpl {if isset($p) AND $p} <!-- Pagination --> {if $start!=$stop} {if $p != 1} << {l s='Previous'} {else} << {l s='Previous'} {/if} {if $start>3} 1 ... {/if} {section name=pagination start=$start loop=$stop+1 step=1} {if $p == $smarty.section.pagination.index} {$p|escape:'htmlall':'UTF-8'} {else} {$smarty.section.pagination.index|escape:'htmlall':'UTF-8'} {/if} {/section} {if $pages_nb>$stop+2} ... {$pages_nb|intval} {/if} {if $pages_nb > 1 AND $p != $pages_nb} {l s='Next'} >> {else} {l s='Next'} >> {/if} {/if} <form action="{$request_uri|escape:'htmlall':'UTF-8'}" method="get" class="pagination"> {if isset($category) AND $category}<input type="hidden" name="id_category" value="{$category->id|intval}" />{/if} {if isset($manufacturer) AND $manufacturer}<input type="hidden" name="id_manufacturer" value="{$manufacturer->id|intval}" />{/if} {if isset($supplier) AND $supplier}<input type="hidden" name="id_supplier" value="{$supplier->id|intval}" />{/if} {if isset($orderway) AND $orderway}<input type="hidden" name="orderway" value="{$orderway|escape:'htmlall':'UTF-8'}" />{/if} {if isset($orderby) AND $orderby}<input type="hidden" name="orderby" value="{$orderby|escape:'htmlall':'UTF-8'}" />{/if} {if isset($query) AND $query}<input type="hidden" name="search_query" value="{$query|escape:'htmlall':'UTF-8'}" />{/if} {if isset($tag) AND $tag}<input type="hidden" name="tag" value="{$tag|escape:'htmlall':'UTF-8'}" />{/if} <input type="submit" class="button_mini" value="{l s='OK'}" /> {l s='items:'} {foreach from=$nArray item=nValue} {$nValue|escape:'htmlall':'UTF-8'} {/foreach} </form> <!-- /Pagination --> {/if} Link to comment Share on other sites More sharing options...
anaism Posted July 31, 2008 Author Share Posted July 31, 2008 I think pagniation is fine as i found that it works on prices-drop.php, but not working on category.php ....Anyone can help?? Link to comment Share on other sites More sharing options...
ejectcore Posted July 31, 2008 Share Posted July 31, 2008 The problem is with &?id_category=10&p=2should be ?id_category=10&p=2I will look into the fix for you ;-) Link to comment Share on other sites More sharing options...
ejectcore Posted July 31, 2008 Share Posted July 31, 2008 replace your pagination.tpl with this: {if isset($p) AND $p} {if $smarty.get.id_category|intval} {assign var='requestPage' value=$link->getPaginationLink('category', $category, false, false, true, false)} {assign var='requestNb' value=$link->getPaginationLink('category', $category, true, false, false, true)} {elseif $smarty.get.id_manufacturer|intval} {assign var='requestPage' value=$link->getPaginationLink('manufacturer', $manufacturer, false, false, true, false)} {assign var='requestNb' value=$link->getPaginationLink('manufacturer', $manufacturer, true, false, false, true)} {elseif $smarty.get.id_supplier|intval} {assign var='requestPage' value=$link->getPaginationLink('supplier', $supplier, false, false, true, false)} {assign var='requestNb' value=$link->getPaginationLink('supplier', $supplier, true, false, false, true)} {else} {assign var='requestPage' value=$link->getPaginationLink(false, false, false, false, true, false)} {assign var='requestNb' value=$link->getPaginationLink(false, false, true, false, false, true)} {/if} <!-- Pagination --> {if $start!=$stop} {if $p != 1} {assign var='p_previous' value=$p-1} « {l s='Previous'} {else} « {l s='Previous'} {/if} {if $start>3} 1 ... {/if} {section name=pagination start=$start loop=$stop+1 step=1} {if $p == $smarty.section.pagination.index} {$p|escape:'htmlall':'UTF-8'} {else} {$smarty.section.pagination.index|escape:'htmlall':'UTF-8'} {/if} {/section} {if $pages_nb>$stop+2} ... {$pages_nb|intval} {/if} {if $pages_nb > 1 AND $p != $pages_nb} {assign var='p_next' value=$p+1} {l s='Next'} » {else} {l s='Next'} » {/if} {/if} <form action="{if !is_array($requestNb)}{$requestNb}{else}{$requestNb.requestUrl}{/if}" method="get" class="pagination"> {if isset($query) AND $query}<input type="hidden" name="search_query" value="{$query|escape:'htmlall':'UTF-8'}" />{/if} {if isset($tag) AND $tag AND !is_array($tag)}<input type="hidden" name="tag" value="{$tag|escape:'htmlall':'UTF-8'}" />{/if} <input type="submit" class="button_mini" value="{l s='OK'}" /> {l s='items:'} {foreach from=$nArray item=nValue} {$nValue|escape:'htmlall':'UTF-8'} {/foreach} {if is_array($requestNb)} {foreach from=$requestNb item=requestValue key=requestKey} {if $requestKey != 'requestUrl'} <input type="hidden" name="{$requestKey|escape:'htmlall':'UTF-8'}" value="{$requestValue|escape:'htmlall':'UTF-8'}" /> {/if} {/foreach} {/if} </form> <!-- /Pagination --> {/if} Link to comment Share on other sites More sharing options...
anaism Posted July 31, 2008 Author Share Posted July 31, 2008 thanks so much amwdesign!however it showed as below error: Fatal error: Call to undefined method Link::getPaginationLink() in /home/.bedouin/heartdis/heartdisk/store/tools/smarty/compile/%j^6AB^6ABEC739%%pagination.tpl.php on line 7 could you pls help me? many thankssssss! Link to comment Share on other sites More sharing options...
ejectcore Posted July 31, 2008 Share Posted July 31, 2008 send me your FTP access & Back office details & I will look into this Link to comment Share on other sites More sharing options...
webstranger Posted August 9, 2008 Share Posted August 9, 2008 I have the same problem and not only for pagination but also for sorting.Instead of http://domain.com/category-name&p=2 it links to http://domain.com/category-name?p=3 with "?" instead of "&"Sorting the products dispalys URLs like ?orderby=price&orderway=asc instead of &orderby=price&orderway=ascThe solutions above for pagination.tpl doesn't work and I don't have any error messages. Link to comment Share on other sites More sharing options...
webstranger Posted August 12, 2008 Share Posted August 12, 2008 Has anybody found a solution to fix pagination and sorting ? Link to comment Share on other sites More sharing options...
anaism Posted August 12, 2008 Author Share Posted August 12, 2008 I also want to know .... Link to comment Share on other sites More sharing options...
pcbob Posted August 19, 2008 Share Posted August 19, 2008 For anyone who is getting this problem when upgrading - as I was getting this problem - All I did was REPLACE the .htaccess file in the root with the htaccess.txt in V1.0..0.8All is working well now Link to comment Share on other sites More sharing options...
brett Posted September 3, 2008 Share Posted September 3, 2008 My problem is only with the manufacturers list page. (the category page paginated properly, as did the product list for each manufacturer)The complete list of manufacturers is shown all at once (all 36 of them) instead of only showing the first 10. At the bottom, the pagination links also show giving me the option of page 1, 2, 3. However since all of the manufacturers are already showing, when i click one of the other page links, the url seems correct (manufacturer.php?p=2) but the manufacturer list still only shows the complete list of 36 products and not 10 per page like it should be.Has anyone else had this problem and worked out how to fix it? Link to comment Share on other sites More sharing options...
Malakomaha Posted September 5, 2008 Share Posted September 5, 2008 The same problem with Manufacturers. Link to comment Share on other sites More sharing options...
AffableAardvark Posted February 20, 2009 Share Posted February 20, 2009 For anyone who is getting this problem when upgrading - as I was getting this problem - All I did was REPLACE the .htaccess file in the root with the htaccess.txt in V1.0..0.8All is working well now Hello PcbobCan you list your htaccess file as I have the same seo rewrite error.FIXEDI needed to add SetEnv DEFAULT_PHP_VERSION 5 to my htaccess file so that the server used PHP5 instead of 4Hope this helps ;-) Link to comment Share on other sites More sharing options...
Recommended Posts