- Posts: 1184
- Thank you received: 13
Disable pagination on selected categories
13 years 10 months ago #76980
by verzevoul
Disable pagination on selected categories was created by verzevoul
Hi!
Is it possible to disable the pagination in a selected category? Not all via css.
I need to have in my mainpage a product listing category with no pagination and all the other categories,should display pagination.
Is it possible to disable the pagination in a selected category? Not all via css.
I need to have in my mainpage a product listing category with no pagination and all the other categories,should display pagination.
Please Log in or Create an account to join the conversation.
13 years 10 months ago - 13 years 10 months ago #77114
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Disable pagination on selected categories
Hi,
You can edit the view "product / listing_div" (if it the type of listing you use).
At the end of the view, there is a block which would display the pagination. You can add a condition in order to not display it for a specific category.
You would find this
And you can replace it by
Just change the "$currentCategory != 10" by the ID of the target category.
Regards,
You can edit the view "product / listing_div" (if it the type of listing you use).
At the end of the view, there is a block which would display the pagination. You can add a condition in order to not display it for a specific category.
You would find this
Code:
<?php if(in_array($pagination,array('bottom','both')) && $this->params->get('show_limit') && $this->pageInfo->elements->total){ $this->pagination->form = '_bottom'; ?>
Code:
<?php
$currentCategory = (int)trim($this->category_selected, '_');
if($currentCategory != 10 && in_array($pagination,array('bottom','both')) && $this->params->get('show_limit') && $this->pageInfo->elements->total){
$this->pagination->form = '_bottom';
?>
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Last edit: 13 years 10 months ago by Jerome.
Please Log in or Create an account to join the conversation.
13 years 10 months ago #77405
by verzevoul
Replied by verzevoul on topic Disable pagination on selected categories
a comma seperated ids is an option to add more categories to be excluded?
Please Log in or Create an account to join the conversation.
13 years 10 months ago #77411
by Xavier
Replied by Xavier on topic Disable pagination on selected categories
Hi,
To add more categories to be excluded, you have to use "&& $currentCategory != 11" (etc) in the if condition.
To add more categories to be excluded, you have to use "&& $currentCategory != 11" (etc) in the if condition.
Please Log in or Create an account to join the conversation.
13 years 10 months ago #77413
by verzevoul
Replied by verzevoul on topic Disable pagination on selected categories
I tried with 1 category and it doesn t work. Which id should I use. I tried both. Hikashop cat id and joomla menu id
Please Log in or Create an account to join the conversation.
13 years 10 months ago - 13 years 10 months ago #77418
by Xavier
Replied by Xavier on topic Disable pagination on selected categories
You can find the hikashop categories in HikaShop > Products > Categories, then you will find the id.
The id should start at "11".
To add more categories, you can too use:
The id should start at "11".
To add more categories, you can too use:
Code:
$hideCategory = array('10','11');
if(!in_array($currentCategory,$hideCategory) && in_array($pagination,array('bottom','both')) ...
Last edit: 13 years 10 months ago by Xavier.
Please Log in or Create an account to join the conversation.
13 years 10 months ago - 13 years 10 months ago #77420
by verzevoul
Replied by verzevoul on topic Disable pagination on selected categories
I understand but I tried
and pagination is still there
Code:
<?php
$currentCategory = (int)trim($this->category_selected, '_');
if($currentCategory != 26 && in_array($pagination,array('bottom','both')) && $this->params->get('show_limit') && $this->pageInfo->elements->total){
$this->pagination->form = '_bottom';
?>
and pagination is still there
Last edit: 13 years 10 months ago by Jerome. Reason: fix code
Please Log in or Create an account to join the conversation.
13 years 10 months ago #77507
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Disable pagination on selected categories
Hi,
Can you give us a link to your product listing ?
Thanks,
Can you give us a link to your product listing ?
Thanks,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
13 years 10 months ago #77511
by verzevoul
Replied by verzevoul on topic Disable pagination on selected categories
pmd thanks!
Please Log in or Create an account to join the conversation.
13 years 10 months ago #77512
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Disable pagination on selected categories
Hi,
I've just see that there was a double "$this->" in my code (width "$this->$this->category_selected").
I have modified my code and yours, please update it in your website.
Regards,
I've just see that there was a double "$this->" in my code (width "$this->$this->category_selected").
I have modified my code and yours, please update it in your website.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
13 years 10 months ago #77521
by verzevoul
Replied by verzevoul on topic Disable pagination on selected categories
Can you please post the final code, for than one categories.. thanks!
Please Log in or Create an account to join the conversation.
13 years 10 months ago #77599
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Disable pagination on selected categories
Hi,
As I said, I modified the code in your previous post.
Regards,
As I said, I modified the code in your previous post.
Code:
<?php
$currentCategory = (int)trim($this->category_selected, '_');
if($currentCategory != 26 && in_array($pagination,array('bottom','both')) && $this->params->get('show_limit') && $this->pageInfo->elements->total){
$this->pagination->form = '_bottom';
?>
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Please Log in or Create an account to join the conversation.
Time to create page: 0.224 seconds