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 1 to 20 of 148
4 Sep 2007, 3:40 PM
#1
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

Set number of products displayed per page (support thread)

This mod was originally written by a_berezin and has never been released before(according to Voltage).
I'd like to thank a_berezin for coding this very useful mod, and Voltage who was so kind to send me the code.

I. Feature:
This mod will allow your customers to set the maximum number of products to be displayed per page.
Please note that this does not work in "All listing", "New listing", and "Special listing". The reason is that each of those listings actually has each own module (with all the querying, and stuff. I just can't understand why ZC can't try to use a single module and template for all the listings)
This does not mean that it's impossible, it's just that I don't have time for that now.

Link to download:
http://www.zen-cart.com/downloads.php?do=file&id=496

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

28 Sep 2007, 1:14 AM
#2
phlash avatar

phlash

New Zenner

Join Date:
Dec 2006
Location:
montreal
Posts:
25
Plugin Contributions:
0

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

Hi...

When i run the 'new_install.sql' i get this:

2000 Duplicate entry '764' for key 1
in:
[INSERT INTO configuration VALUES (764, 'Product Listing - Number of Items Per Page Steps', 'PRODUCT_LISTING_MAX_DISPLAY_STEPS', '12,20,28,48,96,All', 'Number of Items Per Page Steps', 8, 45, '2006-09-01 00:06:29', '2006-08-31 23:33:07', NULL, NULL);]
```any idea on how to fix?  i'm puzzled...

THANKS!!!!:dontgetit

Urban art to the fullest!

28 Sep 2007, 1:21 AM
#3
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

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

This can be easily fixed, the quickest (and dirty) fix is to take a look at your configuration table (using phpmyadmin), see the latest id number there, say like 899, so you change the query to:

INSERT INTO configuration VALUES (900, 'Product Listing - Number of Items Per Page Steps', 'PRODUCT_LISTING_MAX_DISPLAY_STEPS', '12,20,28,48,96,All', 'Number of Items Per Page Steps', 8, 45, '2006-09-01 00:06:29', '2006-08-31 23:33:07', NULL, NULL)

A better fix will be provided later.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

28 Sep 2007, 3:44 AM
#4
phlash avatar

phlash

New Zenner

Join Date:
Dec 2006
Location:
montreal
Posts:
25
Plugin Contributions:
0

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

That did the trick!!:yes:

THANKS for sharing yellow1912!

Urban art to the fullest!

28 Sep 2007, 11:04 AM
#5
a_berezin avatar

a_berezin

Deceased

Join Date:
Aug 2004
Location:
Saint Petersburg, Russia
Posts:
1,782
Plugin Contributions:
5

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

yellow1912,
Please update install.sql file:

INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES (NULL, 'Product Listing - Number of Items Per Page Steps', 'PRODUCT_LISTING_MAX_DISPLAY_STEPS', '12,20,28,48,96,All', 'Number of Items Per Page Steps', 8, 45, NOW(), NULL, NULL);

NOTE: We are sorry that Andrew is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

28 Sep 2007, 12:00 PM
#6
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

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

I was planning to do that, too lazy. Will do it now ^^

a_berezin:

yellow1912,
Please update install.sql file:

INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, use_function, set_function) VALUES (NULL, 'Product Listing - Number of Items Per Page Steps', 'PRODUCT_LISTING_MAX_DISPLAY_STEPS', '12,20,28,48,96,All', 'Number of Items Per Page Steps', 8, 45, NOW(), NULL, NULL);

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

28 Sep 2007, 1:44 PM
#7
a_berezin avatar

a_berezin

Deceased

Join Date:
Aug 2004
Location:
Saint Petersburg, Russia
Posts:
1,782
Plugin Contributions:
5

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

yellow1912:

I was planning to do that, too lazy.
I also :oops:

NOTE: We are sorry that Andrew is no longer with us.
We are grateful for all his contributions to the Zen Cart community.

29 Sep 2007, 4:50 AM
#8
phlash avatar

phlash

New Zenner

Join Date:
Dec 2006
Location:
montreal
Posts:
25
Plugin Contributions:
0

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

I was wondering... any ideas on how i would go about to have the

 Per pages 10,20,30,All
```to display in a drop down menu?:lookaroun

Thanks!!!!:smile:

Urban art to the fullest!

29 Sep 2007, 1:39 PM
#9
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

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

Look at the way Zencart displays drop-down menu, I think the function is called zend_draw_drop_down or something, should be in html_output.php

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

30 Sep 2007, 4:46 AM
#10
phlash avatar

phlash

New Zenner

Join Date:
Dec 2006
Location:
montreal
Posts:
25
Plugin Contributions:
0

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

yep i see it

function zen_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
    $field = '<select name="' . zen_output_string($name) . '"';
```but i don't really know what to do with it :blush:

Thanks for the help

Urban art to the fullest!

1 Oct 2007, 2:48 AM
#11
bluealice avatar

bluealice

Zen Follower

Join Date:
Jan 2007
Posts:
148
Plugin Contributions:
0

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

Hi Yellow1912-- thanks for a great module!

Is there a way to fit all this on one line, so that they appear in this order:

"Number of Products Per Page: 12 20 28 48 All", then "Displaying 1 to 8 (of 94 products)", and then lastly "1 2 3 4 5 ... [Next >>]" ???

Here's my site link to it:

http://www.musecards.com/store/index.php?main_page=index&cPath=3_10

I would actually love to get rid of tje "Diplaying 1 to ..." altogether, as it's way too cluttered right now and it's wrapping onto a second line.

Thanks in advance for your help!

Alice

1 Oct 2007, 6:36 AM
#12
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

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

Dear PHLASH: I'm sorry but I'm pretty busy this week and can't help you rite now. I'll try to add that once I have time.

Dear bluealice:
For turning off the "Displaying 1 to 8 (of 94 products)", you can try to search around the forum, someone should have asked (and got the answer) for this before. This has nothing to do with this mod tho.

Is there a way to fit all this on one line, so that they appear in this order:
--> you sure can, look at the template file that this mod edits, you can place the mod's code anywhere you want.

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

1 Oct 2007, 10:55 PM
#13
phlash avatar

phlash

New Zenner

Join Date:
Dec 2006
Location:
montreal
Posts:
25
Plugin Contributions:
0

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

THANKS yellow1912,

whenever you find some free time will do!
not a rush at all, were here till tha end!!!:cool:

Urban art to the fullest!

28 Dec 2008, 12:01 AM
#14
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
524
Plugin Contributions:
2

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

I see this thread is a bit old, however I'm trying to make the products per page mod a drop down selection? If anyone has done this can you post the code? Thanks for any help on this!

Example on how I would like ti if possible would be:
Displaying 1 to 10 (of 375 products)

The "10" above should be a drop down selection allowing the customer to select how many products to display on the page.

yellow1912:

Look at the way Zencart displays drop-down menu, I think the function is called zend_draw_drop_down or something, should be in html_output.php

marcopolo
Zen Cart 2.2.2 | PHP 8.5.12 | MariaDB 10.11.14

28 Dec 2008, 6:58 AM
#15
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)

I don't see how that would work properly; except for the first group of products, that number will never be the per-page quantity. You could add a

[] Per Page

after the Displaying # to # (of ### products)

with the [] being the quantity dropdown.

28 Dec 2008, 2:53 PM
#16
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
524
Plugin Contributions:
2

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

It would not have to be that way, but I would assume it is possible. For example if I have it defaulted at ten the page would load products 1-10, then if the customer chooses instead of the default 10, 20 or 30 then the screen siomple refreshed and displays products up to the slected amount?

If that can not be coded right do you know how to do it your way?

marcopolo
Zen Cart 2.2.2 | PHP 8.5.12 | MariaDB 10.11.14

13 Jan 2009, 10:23 PM
#18
helmetdecals avatar

helmetdecals

New Zenner

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

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

You can set your own in the product listing page under the configuration in admin. There is a selection for it toward the bottom.

13 Jan 2009, 10:44 PM
#19
yellow1912 avatar

yellow1912

Totally Zenned

Join Date:
Oct 2006
Posts:
5,422
Plugin Contributions:
0

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

helmetdecals:

You can set your own in the product listing page under the configuration in admin. There is a selection for it toward the bottom.
This code is so that your users can set the number they want to see :)

I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

15 Jan 2009, 2:33 PM
#20
marcopolo avatar

marcopolo

Totally Zenned

Join Date:
May 2008
Location:
United States
Posts:
524
Plugin Contributions:
2

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

Can this code be converted to show a drop down box instead?

marcopolo
Zen Cart 2.2.2 | PHP 8.5.12 | MariaDB 10.11.14