Zen Cart Logo
Forums / General Questions / Help with whats new sidebox.

Help with whats new sidebox.

Views: 583

Results 1 to 6 of 6
26 Sep 2012, 5:23 PM
#1
bwalt302 avatar

bwalt302

New Zenner

Join Date:
Sep 2012
Posts:
4
Plugin Contributions:
0

Help with whats new sidebox.

Quick question, on our zen cart store we have a special category called Whats' new. Is there a way to set the new products sidebox to only pull products from this category, instead of all of them? And also remove the time limit it keeps them there?

I don't want to use the featured items as we have several items unrelated that are already featured.

27 Sep 2012, 9:37 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Help with whats new sidebox.

Sideboxes come in two parts:
/includes/modules/sideboxes (and a subdirectory where your custom sideboxes are stored, based on your template name)
/includes/templates/your-template-name-here/sideboxes

THe whats_new sidebox could be cloned to do what you seek. Maybe call it "mynewprods". Adjust the SQL query as needed, and then the template only needs a few changes to DIV names etc since it'll just output whatever the sql pulls in.

27 Sep 2012, 1:19 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Help with whats new sidebox.

Are the Products in your What's New Category using that categories_id as its master_categories_id or are they just Linked to that What's New Category?

28 Sep 2012, 10:04 PM
#4
bwalt302 avatar

bwalt302

New Zenner

Join Date:
Sep 2012
Posts:
4
Plugin Contributions:
0

Re: Help with whats new sidebox.

They will be linked into the Whats new category; which is category id 121

28 Sep 2012, 10:04 PM
#5
bwalt302 avatar

bwalt302

New Zenner

Join Date:
Sep 2012
Posts:
4
Plugin Contributions:
0

Re: Help with whats new sidebox.

I tried adding an and master_category_id = 121; statement with no luck.

29 Sep 2012, 12:10 AM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Help with whats new sidebox.

First, check the settings on your Maximum Values for what you are limiting your New Products to ...

Next, using your templates and overrides, you should change the:
/includes/modules/sideboxes/your_template_dir/whats_new.php

and change the code to include the line in RED:

  $random_whats_new_sidebox_product_query = "select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_name,
                                              p.master_categories_id
                           from (" . TABLE_PRODUCTS . " p
                           left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
                           where p.products_id = pd.products_id
[B]and p.master_categories_id = 121[/B]
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                           and p.products_status = 1 " . $display_limit;

Next, check that your products that are showing are using in the table:
products

the master_categories_id of: 121