Jump to content

View all sale items limit


fldavidallsop

Recommended Posts

Is there a limit to the amount of sale items which can be displayed at once?

I have a client who has over 350 sale items which you can access through the pagination on the sales page, however when they use the 'view all' link which is usually included on a product category, only approx 100 of the sale items are displayed.

I know in the foundation skin the 'view all' link has been replaced by the 'view more' link, just wondering if there is an overall limit in CubeCart for the amount of sale items on one page.

Link to comment
Share on other sites

Yes, there is a limit of 100 when page=all. This applies to Search Results and Sale Items.

This limit is hard-coded in /classes/catalogue.class.php, near line 1440:

if (strtolower($page) != 'all') {
	$page = (is_numeric($page)) ? $page : 1;
	$limit = sprintf('LIMIT %d OFFSET %d', (int)$per_page, $per_page*($page-1));
} else {
	$limit = 'LIMIT 100';
}

 

Link to comment
Share on other sites

Many thanks for the information bsmither.

Is this worth flagging as a potential issue/bug? I see it that way because the website user/store owner is expecting CubeCart to output all results on a page=all for sale items and search results but it is only outputting 100 results max? What are your thoughts...?

Link to comment
Share on other sites

I have a good suspicion, based on comments made in the PHP code files from many versions ago, that a limit of 100 was imposed on 'page=all' lists because of the state of the server environment five to ten some-odd years ago.

CubeCart still has reams of un-optimized database queries, so when asking for an initial recordset that could possibly contain hundreds or thousands of records, the end result is literally a possible million of database requests. While that is very much in the "typical" realm of high-traffic high-volume sites, the limitations of $5.00/month hosting accounts would have your hosting provider issue you a very stern letter.

So, even if server environments are now more robust, there is still a valid reason to optimize the queries -- but I guess this is a low-priority endevour.

My thoughts: 350 items on sale is a lot. Perhaps this is a small percentage of the store's total inventory that may number in the thousands, but 350? Wow.

So, you can edit the code to remove the limit. If you do, I would hope the hosting account is "tuned" for that level of activity.

My other thoughts: a User's Manual would sort a lot of misconceptions and misunderstandings about how CubeCart actually works vs what would otherwise be inferred.

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.

×
×
  • Create New...