Disable pagination on selected categories

  • Posts: 1028
  • Thank you received: 11
  • Hikashop Business
11 years 5 months ago #76980

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.

Please Log in or Create an account to join the conversation.

  • Posts: 26017
  • Thank you received: 4004
  • MODERATOR
11 years 5 months ago #77114

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

<?php if(in_array($pagination,array('bottom','both')) && $this->params->get('show_limit') && $this->pageInfo->elements->total){ $this->pagination->form = '_bottom'; ?>
And you can replace it by
<?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';
?>
Just change the "$currentCategory != 10" by the ID of the target category.

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.
Last edit: 11 years 5 months ago by Jerome.

Please Log in or Create an account to join the conversation.

  • Posts: 1028
  • Thank you received: 11
  • Hikashop Business
11 years 5 months ago #77405

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.

  • Posts: 13201
  • Thank you received: 2322
11 years 5 months ago #77411

Hi,

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.

  • Posts: 1028
  • Thank you received: 11
  • Hikashop Business
11 years 5 months ago #77413

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.

  • Posts: 13201
  • Thank you received: 2322
11 years 5 months ago #77418

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:

$hideCategory = array('10','11');
if(!in_array($currentCategory,$hideCategory) && in_array($pagination,array('bottom','both')) ...

Last edit: 11 years 5 months ago by Xavier.

Please Log in or Create an account to join the conversation.

  • Posts: 1028
  • Thank you received: 11
  • Hikashop Business
11 years 5 months ago #77420

I understand but I tried

<?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: 11 years 5 months ago by Jerome. Reason: fix code

Please Log in or Create an account to join the conversation.

  • Posts: 26017
  • Thank you received: 4004
  • MODERATOR
11 years 5 months ago #77507

Hi,

Can you give us a link to your product listing ?

Thanks,


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.

  • Posts: 1028
  • Thank you received: 11
  • Hikashop Business
11 years 5 months ago #77511

pmd thanks!

Please Log in or Create an account to join the conversation.

  • Posts: 26017
  • Thank you received: 4004
  • MODERATOR
11 years 5 months ago #77512

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,


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.

  • Posts: 1028
  • Thank you received: 11
  • Hikashop Business
11 years 5 months ago #77521

Can you please post the final code, for than one categories.. thanks!

Please Log in or Create an account to join the conversation.

  • Posts: 26017
  • Thank you received: 4004
  • MODERATOR
11 years 5 months ago #77599

Hi,

As I said, I modified the code in your previous post.

<?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.

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.

Time to create page: 0.082 seconds
Powered by Kunena Forum