Forums / All Other Contributions/Addons / Set number of products displayed per page (support thread)

Set number of products displayed per page (support thread)

Views: 37,000

Results 21 to 40 of 148
15 Jan 2009, 2:47 PM
#21
jonnylarson avatar

jonnylarson

New Zenner

Join Date:
Jan 2009
Posts:
2
Plugin Contributions:
0

Set number of products displayed per page (support thread)

My customer was asking for this as well (the dropdown on the product page that says "show: 6, 10 20, 50..." products). Any status on this?

3 Mar 2009, 9:10 AM
#22
cocteau avatar

cocteau

New Zenner

Join Date:
Feb 2009
Posts:
15
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

Hello there, thank so much for this mod first. I'm new and know nothing about PHP coding. Now testing the Zen Cart V1.3.8.

I follow the mod readme to install this mod and I think I ALMOST success...
My problem is, anyway here is the cap screen:

You may see there is 2 digit: 4 and 8 at the end of the line "TEXT_DISPLAY_STEPS_NUMBER_OF_PRODUCTS".
4 and 8 are the steps I set in the Admin page. And these 2 step numbers when I click them, they do their job well! But when I try to add more steps. The others not show...
Seems there is no space for more step numbers to show, just because that error line "TEXT_DISPLAY_STEPS_NUMBER_OF_PRODUCTS" use up all the space...

What's wrong I made? How do I hide this line and show more steps? Thanks!

13 Mar 2009, 1:45 PM
#23
cocteau avatar

cocteau

New Zenner

Join Date:
Feb 2009
Posts:
15
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

Just I quick follow up. My problem solved just because the files wrong placement!! Now it works perfectly. Give a BIG kiss to the mod author!

9 Jun 2009, 3:18 PM
#24
gueston avatar

gueston

Zen Follower

Join Date:
Apr 2009
Posts:
118
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

what happend it can't work after i install this function

the "SQL Query Executor" page display below :" Failed: 1
ERROR: Cannot insert configuration_key "PRODUCT_LISTING_MAX_DISPLAY_STEPS" because it already exists
Note: 1 statements ignored. See "upgrade_exceptions" table for additional details.
"
when i send the "new_install"

(sure i install it as readme.txt)

http://www.gueston.com Gueston wholesale plaza--wholesale cheap brand apparel

7 Oct 2009, 10:00 PM
#25
loter avatar

loter

New Zenner

Join Date:
Jun 2009
Posts:
19
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

Great mod, but how can I have the dropdown instead of text links?

thanks!

15 Nov 2009, 2:02 PM
#26
neboztik avatar

neboztik

New Zenner

Join Date:
Jan 2009
Location:
Czech Republic
Posts:
59
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

Hi, I have following problem: when I go from the subcategory with less than nine products where is set to show only 6 products per page to another category I get this kind of error:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-0, 0' at line 8
in:
[select distinct p.products_image, pd.products_name, p.products_quantity, p.products_carrot, p.products_id, p.products_type, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status =1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p2c.products_id = s.products_id where p.products_carrot = 0 and p.products_status = 1 and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '6' order by p.products_sort_order, pd.products_name limit -0, 0]

Can anybody help?

24 Nov 2009, 2:49 PM
#27
neboztik avatar

neboztik

New Zenner

Join Date:
Jan 2009
Location:
Czech Republic
Posts:
59
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

neboztik:

Hi, I have following problem: when I go from the subcategory with less than nine products where is set to show only 6 products per page to another category I get this kind of error:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-0, 0' at line 8
in:
[select distinct p.products_image, pd.products_name, p.products_quantity, p.products_carrot, p.products_id, p.products_type, p.manufacturers_id, p.products_price, p.products_tax_class_id, pd.products_description, IF(s.status = 1, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status =1, s.specials_new_products_price, p.products_price) as final_price, p.products_sort_order, p.product_is_call, p.product_is_always_free_shipping, p.products_qty_box_status from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p2c.products_id = s.products_id where p.products_carrot = 0 and p.products_status = 1 and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '6' order by p.products_sort_order, pd.products_name limit -0, 0]

> Can anybody help?
problem solved, this mod hasnt caused problem it was zencarts issue. Maybe someone could be interested there is [link](http://www.zen-cart.com/forum/showthread.php?t=108941) how to fix problem
10 Mar 2010, 6:35 PM
#28
autoace avatar

autoace

Totally Zenned

Join Date:
Jun 2009
Posts:
618
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

Quick question, is 'Number of Products Per Page:.....' ONLY suppose to appear at the bottom of the page?

I figured that since we enter the code in 2 spots that it would appear at the top and bottom of the pages.

It only shows at the bottom for me, is this right?

Thank you,
autoace

16 Sep 2010, 5:00 PM
#29
opengrave avatar

opengrave

New Zenner

Join Date:
Aug 2008
Posts:
17
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

This is showing up on my site like this:

Number of Products Per Page:
Number of Products Per Page: 21 42 60 81 102

How can I get rid of the top line so that it only says "Number of Products Per Page:" one time?

16 Sep 2010, 6:02 PM
#30
opengrave avatar

opengrave

New Zenner

Join Date:
Aug 2008
Posts:
17
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

opengrave:

This is showing up on my site like this:

Number of Products Per Page:
Number of Products Per Page: 21 42 60 81 102

How can I get rid of the top line so that it only says "Number of Products Per Page:" one time?

Forget my site address:
https://www.divinemetaldistro.com

18 Sep 2010, 10:39 PM
#31
kamelion0927 avatar

kamelion0927

Zen Follower

Join Date:
Dec 2009
Posts:
208
Plugin Contributions:
1

Re: Set number of products displayed per page (support thread)

opengrave:

This is showing up on my site like this:

Number of Products Per Page:
Number of Products Per Page: 21 42 60 81 102

How can I get rid of the top line so that it only says "Number of Products Per Page:" one time?

Go into your admin > Tools > Developers Tool Kit and search for "Number of Products Per Page". The Tool Kit will show you which file you need to edit in order to remove the duplicate verbiage.

I'm running Zen Cart 1.3.9f with tons of add-ons so mine may differ, but when I did it, it showed the file that needed to be edited was includes/templates/MY-CUSTOM-FILES/templates/tpl_modules_product_listing.php. You probably have TEXT_DISPLAY_STEPS_NUMBER_OF_PRODUCTS three times when it should only be in the template twice (one at the top and one at the bottom).

16 Nov 2010, 11:24 PM
#32
turtleo4 avatar

turtleo4

New Zenner

Join Date:
Nov 2010
Location:
Los Angeles, Ca
Posts:
5
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

Hello.

I am having an issue installing this mod. I am running v1.3.9h. I have looked endlessly, and still am, on a fix to my problem. I followed the readme.txt but when I get to the line where I must replace $max_results= in the product_listing.php file, that variable is not listed in that file. Can someone please help me with this. On the site you will see: Show Number of Products Per Page: 0 0 0 All and they link to nothing. Here is the site.

18 Nov 2010, 12:13 AM
#33
kiddieshop avatar

kiddieshop

New Zenner

Join Date:
Dec 2008
Posts:
26
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

Hi Guys

I got this working on the site as expected, thank you so much for this contribution.

I would like to take it one step forward and instead of having text links for items per page, I would like to have images displayed.

I have nearly got it but i think I have spent to much time on this now and Im just going backwards and forwards over my code and plus to much coffee doesn't help!

The code I have so far is:

if($step != '6') {
$result .= '<a href="'.zen_href_link($page, zen_get_all_get_params(array('max_display',$listing_page_name)))."&max_display=$max_display".'" title="Show All Products" style="text-align:center; margin-left:40px;"><img src="includes/templates/TEMPLATENAME/images/button_showall.png" width="150" height="20" alt="Show All Products" /></a> ';
			
			}  
			
elseif($step = 'All') {
$result .= '<a href="'.zen_href_link($page, zen_get_all_get_params(array('max_display',$listing_page_name)))."&max_display=$max_display".'" title="Show 6 Products" style="text-align:center; margin-left:40px;"><img src="includes/templates/TEMPLATENAME/images/button_show6.png" width="150" height="20" alt="Show 6 Products" /></a> ';
	}
	

So my intention with this is:

  1. When you arrive on the page, it is displayed as 6 prods per page and only the "Show All" button is displayed plus the page navigation i.e. 1 2 3 4 [Next >>]
  2. If the visitor clicks "Show All" the Image for "Show 6" is displayed
  3. If the Visitor is in "Show All" Mode, then the "Show 6" Button will display

But I'm stuck. Any help much appreciated.

Thanks in advance.

18 Nov 2010, 12:46 AM
#34
turtleo4 avatar

turtleo4

New Zenner

Join Date:
Nov 2010
Location:
Los Angeles, Ca
Posts:
5
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

kid,
what version of zen are you using? where did you replace the $max_results= ??

18 Nov 2010, 2:29 AM
#35
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Set number of products displayed per page (support thread)

Small point:

elseif($step = 'All') {

should be

elseif($step == 'All') {

And really, the logic seems odd...
If $step is '6', neither part will be executed, and if $step is 'All", it will not be '6' and only the first part will be executed. The second part can never be executed.

19 Nov 2010, 12:13 AM
#37
turtleo4 avatar

turtleo4

New Zenner

Join Date:
Nov 2010
Location:
Los Angeles, Ca
Posts:
5
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

in my includes/functions/extra_functions/ i do not have a max_display.php file. is that where you input the $max_results line? the instructions say to edit /includes/modules/YOUR_TEMPLATE/product_listing.php am I missing something/don't know how to read? let me know.

Thanks

19 Nov 2010, 12:30 PM
#38
kiddieshop avatar

kiddieshop

New Zenner

Join Date:
Dec 2008
Posts:
26
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

Sorry, I am using an older version of this module, all thats different is the name of the files. The file in the new version is named set_num_products.php. both the new and old module use $max_display

the original code that came with the module is below:

	$result .= '<a href="'.zen_href_link($page, zen_get_all_get_params(array('max_display',$listing_page_name)))."&max_display=$max_display".'">'.$step.'</a> ';

and I am trying to turn the links into images with the following code:

if($step != '6') {
$result .= '<a href="'.zen_href_link($page, zen_get_all_get_params(array('max_display',$listing_page_name)))."&max_display=$max_display".'" title="Show All Products" style="text-align:center; margin-left:40px;"><img src="includes/templates/TEMPLATENAME/images/button_showall.png" width="150" height="20" alt="Show All Products" /></a> ';
			
			}  
			
elseif($step = 'All') {
$result .= '<a href="'.zen_href_link($page, zen_get_all_get_params(array('max_display',$listing_page_name)))."&max_display=$max_display".'" title="Show 6 Products" style="text-align:center; margin-left:40px;"><img src="includes/templates/TEMPLATENAME/images/button_show6.png" width="150" height="20" alt="Show 6 Products" /></a> ';
	}
	}

but my intention with this is:

  1. When you arrive on the page, it is displayed as 6 prods per page and only the "Show All" button is displayed plus the page navigation i.e. 1 2 3 4 [Next >>]
  2. If the visitor clicks "Show All" the Image for "Show 6" is displayed
  3. If the Visitor is in "Show All" Mode, then the "Show 6" Button will display

But I'm stuck. Any help much appreciated.

19 Nov 2010, 5:04 PM
#39
turtleo4 avatar

turtleo4

New Zenner

Join Date:
Nov 2010
Location:
Los Angeles, Ca
Posts:
5
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

I understand that you are trying to put images instead of the text but how did you get it to work? how did you complete this step
Edit /includes/modules/YOUR_TEMPLATE/product_listing.php with the following code

Find:
$max_results = (PRODUCT_LISTING_LAYOUT_STYLE=='columns' && PRODUCT_LISTING_COLUMNS_PER_ROW>0) ? (PRODUCT_LISTING_COLUMNS_PER_ROW * (int)(MAX_DISPLAY_PRODUCTS_LISTING/PRODUCT_LISTING_COLUMNS_PER_ROW)) : MAX_DISPLAY_PRODUCTS_LISTING;

Replace by:
$max_results = (PRODUCT_LISTING_LAYOUT_STYLE=='columns' && PRODUCT_LISTING_COLUMNS_PER_ROW>0) ? (PRODUCT_LISTING_COLUMNS_PER_ROW * (int)($_SESSION['product_listing_max_display']/PRODUCT_LISTING_COLUMNS_PER_ROW)) : $_SESSION['product_listing_max_display'];

where did you find the $max_results line? there is no $ max_results in my Edit /includes/modules/YOUR_TEMPLATE/product_listing.php file.

19 Nov 2010, 6:30 PM
#40
kiddieshop avatar

kiddieshop

New Zenner

Join Date:
Dec 2008
Posts:
26
Plugin Contributions:
0

Re: Set number of products displayed per page (support thread)

I already have the following code in my override folder for product_listing.php

$max_results = (PRODUCT_LISTING_LAYOUT_STYLE=='columns' && PRODUCT_LISTING_COLUMNS_PER_ROW>0) ? (PRODUCT_LISTING_COLUMNS_PER_ROW * (int)($_SESSION['product_listing_max_display']/PRODUCT_LISTING_COLUMNS_PER_ROW)) : $_SESSION['product_listing_max_display'];

The module is working as it was intented to, but I want to change text links to images but only show the option relevant.

i.e.
if six products are displayed - show the "display all products" image only
if all products displayed - show the "display 6 products" image only