Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / need help with customizing product listing

need help with customizing product listing

Locked

Views: 1,097

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
14 May 2010, 10:57 PM
#1
hangman21 avatar

hangman21

Zen Follower

Join Date:
May 2010
Posts:
138
Plugin Contributions:
0

need help with customizing product listing

So this is what i want do...

Right now I just have a new product catagory showing with 6 items,

  1. I want the program to automatically create a new page
  • For example when i create items 7-12, it will know to make page 2 so when the use clicks on page 2, it will show the next 6 items, in the same category box.

I also want to be able to sent the number layout links like this:

< 1 2 3 4 5 6 7 8 9 >

below the new product category box

Also for some reason i change the config to number per page for both product listing and new product listing value to 6, and nothing happen its still showing 7

thanks everyone

Right now it looks like this:

15 May 2010, 11:10 PM
#2
hangman21 avatar

hangman21

Zen Follower

Join Date:
May 2010
Posts:
138
Plugin Contributions:
0

Re: need help with customizing product listing

still need, if anyone could help me out that will be nice

16 May 2010, 7:19 AM
#3
hangman21 avatar

hangman21

Zen Follower

Join Date:
May 2010
Posts:
138
Plugin Contributions:
0

Re: need help with customizing product listing

still need help anyone????

16 May 2010, 1:09 PM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: need help with customizing product listing

It sounds like you want the New Products section to work like the product listing display, where you can set a limit to the number of products displayed per page.

There's no function or mod I'm aware of that will do that, so you would need to adapt the product listing code to the New Products section.

A very big programming job, I think.

16 May 2010, 2:55 PM
#6
aliepinieks avatar

aliepinieks

Zen Follower

Join Date:
Jun 2009
Location:
Brisbane, QLD AUS
Posts:
209
Plugin Contributions:
0

Re: need help with customizing product listing

I haven't looked at the mod recommended in the earlier post, but here's my two cents anyway.

First regarding the restriction on the number of records, I'm pretty sure the value you want to change is in Configuration\Maximum values\New Products Module. This will reduce the products displaying here, unless you've removed or otherwise edited code in the new_products.php module.

As far as pagination is concerned, I have implemented this fairly quickly with results I retrieve for some custom forms I built. I tried doing it quickly to see if it would work in the new products module, but it failed for me for two reasons. First, I couldn't quite figure out how to split the results and randomise them at the same time. Probably if I spent some time, but don't have it to spend. Secondly, the query became malformed when trying to split the results, although this technique worked on simpler queries in the past. I suspect it may have something to do with the left joins, but who knows, perhaps you'll have more luck so I'll show you what I did anyway, in case you want to have a play around.

First you would need to set the aforementioned New Products Module to something quite high (e.g. 9999) and then pass this query into the splitPageResults() function. you would do this in the new_products.php module, so look for the line below:

if ($new_products_query != '') $new_products = $db->ExecuteRandomMulti($new_products_query, MAX_DISPLAY_NEW_PRODUCTS);

comment this out, and add the following immediately before or after it:

if ($new_products_query != '') {
	$new_products_split = new splitPageResults($new_products_query, 6);
	$new_products = $db->Execute($new_products_split->sql_query);
}

the number 6 here refers to the number of results you want on each 'page'. once you're done here, find the template file tpl_modules_whats_new.php, and add the following code to see paginated results below or above your results:

<div class="navSplitPagesLinks forward"><?php echo TEXT_RESULT_PAGE . ' ' . $new_products_split->display_links(MAX_DISPLAY_PAGE_LINKS, $page_query . zen_get_all_get_params(array('page', 'info', 'x', 'y', 'main_page'))); ?></div>
<div class="navSplitPagesResult"><?php echo $new_products_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS); ?></div>

as i stated earlier, this didn't quite work for me but it should in theory if you play around with either the query in the module file itself, or probably more appropriately the splitPageResults() function as this seems to be where the query is altered, and subsequently malformed. i have it working with other more simple queries and found it quite useful.

hope this helps!
andrejs

20 May 2010, 2:10 PM
#7
gjh42 avatar

gjh42

Black Belt

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

Re: need help with customizing product listing

You say you have a "new product catagory"... so you created a category called Jewelries. Are you trying to display only the newest products? If not, why are you trying to use the new products centerbox instead of the product listing page? If you want the grid layout, get the Column Layout Grid mod from Free Addons. And if you want the category's product listing to show on the homepage, try admin > Configuration > Layout Settings >
Categories - Always Show on Main Page > set to 1
Main Page - Opens with Category > set to your category's id (1 in this case)

It will be easier to give advice looking at your current live site than a screenshot.