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
Re: Set number of products displayed per page (support thread)
Hi...
When i run the 'new_install.sql' i get this:
Code:
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
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:
Code:
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.
Re: Set number of products displayed per page (support thread)
That did the trick!!:yes:
THANKS for sharing yellow1912!
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);
Re: Set number of products displayed per page (support thread)
I was planning to do that, too lazy. Will do it now ^^
Quote:
Originally Posted by
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);
Re: Set number of products displayed per page (support thread)
Quote:
Originally Posted by
yellow1912
I was planning to do that, too lazy.
I also :oops:
Re: Set number of products displayed per page (support thread)
I was wondering... any ideas on how i would go about to have the
Code:
Per pages 10,20,30,All
to display in a drop down menu?:lookaroun
Thanks!!!!:smile:
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
Re: Set number of products displayed per page (support thread)
yep i see it
PHP Code:
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