- Posts: 63
- Thank you received: 3
Filter list all crashes website
13 years 4 months ago #104126
by ians
Filter list all crashes website was created by ians
Hi there,
I have a shop with 5,500 products which is working OK, except that when I click to show all, I just get a blank screen and then cant get back to the product list again.
url is www.wslr.co.uk/index.php/resources-catalogue
Can I change the filter at the bottom of the page so it only displays up to 100 results and remove the "all" button.
I think the number of products is too much to expect many pc's / connections to cope.
Yours,
ian
I have a shop with 5,500 products which is working OK, except that when I click to show all, I just get a blank screen and then cant get back to the product list again.
url is www.wslr.co.uk/index.php/resources-catalogue
Can I change the filter at the bottom of the page so it only displays up to 100 results and remove the "all" button.
I think the number of products is too much to expect many pc's / connections to cope.
Yours,
ian
Please Log in or Create an account to join the conversation.
13 years 4 months ago #104211
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic Filter list all crashes website
Hi,
When I try to open your link, I have got a 500 error page.
You can override the pagination system yes but in your case I think it will be easier to set a maximum limitation.
You can edit the file "components/com_hikashop/views/product/view.html.php" and add some code in the "listing()" function before
Like:
At this moment, the listing won't display more than 100 elements.
Note that, it is a modification of a core file so, by updating HikaShop, you will loose your modification.
Regards,
When I try to open your link, I have got a 500 error page.
You can override the pagination system yes but in your case I think it will be easier to set a maximum limitation.
You can edit the file "components/com_hikashop/views/product/view.html.php" and add some code in the "listing()" function before
Code:
$database->setQuery($select.$query,(int)$pageInfo->limit->start,(int)$pageInfo->limit->value);
$rows = $database->loadObjectList();
if(!empty($rows)){
$ids = array();
$productClass = hikashop_get('class.product');
Code:
// begin of lines to add
if((int)$pageInfo->limit->value > 100)
$pageInfo->limit->value = 100;
// end of lines to add
$database->setQuery($select.$query,(int)$pageInfo->limit->start,(int)$pageInfo->limit->value);
Note that, it is a modification of a core file so, by updating HikaShop, you will loose your modification.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
13 years 4 months ago #105174
by ians
Replied by ians on topic Filter list all crashes website
Hi Jerome,
Sorry the site wasn't available for you to look at. It's live again now.
Thanks for the code - it doesn't seem to work though.
I have the following code - have I misunderstood your post?
if((int)$pageInfo->limit->value > 100)
$pageInfo->limit->value = 100;
$database->setQuery($select.$query,(int)$pageInfo->limit->start,(int)$pageInfo->limit->value);
$rows = $database->loadObjectList();
if(!empty($rows)){
$ids = array();
$productClass = hikashop_get('class.product');
foreach($rows as $key => $row){
$ids[]=$row->product_id;
$productClass->addAlias($rows[$key]);
Yours,
ian
Sorry the site wasn't available for you to look at. It's live again now.
Thanks for the code - it doesn't seem to work though.
I have the following code - have I misunderstood your post?
if((int)$pageInfo->limit->value > 100)
$pageInfo->limit->value = 100;
$database->setQuery($select.$query,(int)$pageInfo->limit->start,(int)$pageInfo->limit->value);
$rows = $database->loadObjectList();
if(!empty($rows)){
$ids = array();
$productClass = hikashop_get('class.product');
foreach($rows as $key => $row){
$ids[]=$row->product_id;
$productClass->addAlias($rows[$key]);
Yours,
ian
Please Log in or Create an account to join the conversation.
13 years 4 months ago #105224
by nicolas
Replied by nicolas on topic Filter list all crashes website
The modification proposed by jerome won't remove the "all" option but it will limit the display of the products to maximum 100 per page.
If you want to remove the all option, you could remove the line:
$limits[] = JHTML::_('select.option', '0', JText::_('HIKA_ALL'));
in the file administrator/components/com_hikashop/helpers/pagination.php
If you want to remove the all option, you could remove the line:
$limits[] = JHTML::_('select.option', '0', JText::_('HIKA_ALL'));
in the file administrator/components/com_hikashop/helpers/pagination.php
The following user(s) said Thank You: ians
Please Log in or Create an account to join the conversation.
13 years 3 months ago #108846
by ians
Replied by ians on topic Filter list all crashes website
Thank you Nicolas, This worked fine 
Ian
Ian
Please Log in or Create an account to join the conversation.
Time to create page: 0.163 seconds