Jump to content

Configuring $itemlimit and $itemsperpage


poliquinp

Recommended Posts

Hello,

I am developping a custom theme in WHMCS and I am having issues working with ClientArea pages.

It looks like many people are having this issue.

On my Client Area (www.mydomain.com/clientarea.php?action=products), it only shows 10 items. When I do a {debug} from the template file, I get those two configurations :

  1. $itemlimit (Origin: "Smarty object") with a value of 10
  2. $itemsperpage (Origin: "Smarty object") with a value of 10

limit.thumb.PNG.7b791be62942e00449df18bbc3de1bff.PNG

I am trying to find a place in the Admin Panel or in the database if I can alter those values. 

I keep searching and I will post updates as soon as I have.

In the meantime, if any body can help me it would be nice!

Link to comment
Share on other sites

On 08/11/2018 at 16:32, poliquinp said:

I am trying to find a place in the Admin Panel or in the database if I can alter those values. 

I don't think it's in either - it will be determined by your Datatables settings... which you should be able to tweak by either editing /includes/tablelist.tpl or with JavaScript... the documentation on their site should prove useful to you as you'll find nothing about it in the official WHMCS documentation! 🙄

64YwVsu.png

Link to comment
Share on other sites

  • 3 years later...
On 11/8/2018 at 6:32 PM, poliquinp said:

It looks like many people are having this issue

I faced with same trouble.  Only 10 items is displayed  by default for any table (tickets, invoices, email etc.).  Smarty value {$invoices} contains only 10 items.

 

If I add &itemlimit=all to URI - it start displaying all items  until logoff / cookie clear.

How and what should I change, so all items was displayed by default? 

 

If I  enable default twenty-one theme there is no such issue, all records displayed by default.

 

 

Edited by vdswin.com
Link to comment
Share on other sites

1 minute ago, Kian said:

It's DataTables. Simply use pageLenght API.

Not so easy....

In fact it does not matter what pageLenght is set (I set it to -1) because  WHMCS gives only 10 records to DataTables. 

So if create clientareainvoices.tpl just as 

{$invoices|count}

 

it shows "10" by default until I add &itemlimit=all to query string.

So this issue has no relation to DataTable settings =(

I can not figure out why   theme "trweny-one" sets this itemlimit to all by default ((

Link to comment
Share on other sites

2 hours ago, vdswin.com said:

because  WHMCS gives only 10 records to DataTables

I have no direct experience with twenty-one but are you sure that WHMCS gives only 10 records?

As far as I know WHMCS doesn't use server-side processing of DataTables hence all rows are accessible from {$invoices}. For example at the moment I am browsing a system where I have almost 4000 invoices. Each of them is accessible from {$invoices}. In fact when I change page limite from "10" to "All" they all show up without any need of ajax POST.

Link to comment
Share on other sites

Yes, with "six" or "twenty-one" theme all existing records are passed to $invoices and DataTables has all of them.

But with custom theme  it is like default  &itemlimit=10 is set and so only 10 records is passed to $invoices.  So there is only 10 records in page source.  And DataTable can display only 10 invoices (like there is ONLY 10 invoices exists) regardless of settings, changing Limit in datatble, or setting  "pageLength": -1.  "Showing 1 to 10 of 10 entries" until I add &itemlimit=10 and then get "Showing 1 to 10 of 54 entries" like in "six" or "twenty-one" theme.

1) Is it possible to change some internal WMCS setting, that is managed by adding URL parameter  &itemlimit from 10 to "all" by default?

2) Why can WHCMS return different number of items with different theme?

3) Could you please try add any custom theme to WHMCS, place  just {$invoices|count}  into clientareainvoices.tpl, clear cookie and check  how many records will WHMCS return by default? If it is only 10 - could this be changed to "-1" or "all" in some way?

   

Edited by vdswin.com
Link to comment
Share on other sites

You should edit the theme.yaml file.

templates\THEME_NAME\theme.yaml

Add the following lines.

properties:
  serverSidePagination: false

Full code:

name: "Custom Theme"
description: "Custom theme description"
author: "Samet Girginer"
properties:
  serverSidePagination: false

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated