Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Show New Products from all categories

Show New Products from all categories

Locked

Views: 1,248

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
12 Feb 2008, 12:52 PM
#1
dml311071 avatar

dml311071

New Zenner

Join Date:
Sep 2006
Location:
Grimsby UK
Posts:
98
Plugin Contributions:
0

Show New Products from all categories

When the 'New Products for {month}' is displayed, is there a way of selecting products from all categories rather than just the relevant category and its subcategory? I have been asked specifically for this by a customer of mine.

I'm certain that this must be straightforward but I'm still geting to know the core php and I don't want to dig about in there if I can use something within the admin.

Regards

Dave

12 Feb 2008, 1:39 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Show New Products from all categories

Look at the includes/modules/new_products.php

12 Feb 2008, 2:44 PM
#3
dml311071 avatar

dml311071

New Zenner

Join Date:
Sep 2006
Location:
Grimsby UK
Posts:
98
Plugin Contributions:
0

Re: Show New Products from all categories

Hi Kobra

I suspected that it may php code. My php is very basic and I don't have enough experience of the zencart php variables to pick out which variable I should be changing or to what values! I can read back most of that file but not well enough to pin down what I am after.

Also, I am waiting for my hosting co to issue a fixed IP address for the gravisuk.com domain and then I can conatct you for the cert.

Regards

Dave

12 Feb 2008, 4:13 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Show New Products from all categories

In a copy of includes/modules/new_products.php placed in your template override folder includes/modules/your_template/new_products.php- Try commenting this out - add red entries at these locations

$display_limit = zen_get_new_date_range();
/**
if ( (($manufacturers_id > 0 && $_GET['filter_id'] == 0) || $_GET['music_genre_id'] > 0 || $_GET['record_company_id'] > 0) || (!isset($new_products_category_id) || $new_products_category_id == '0') ) {
  $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
                                p.products_date_added, p.products_price, p.products_type, p.master_categories_id
                           from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd
                           where p.products_id = pd.products_id
                           and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'
                           and   p.products_status = 1 " . $display_limit;
} else {
  // get all products and cPaths in this subcat tree
  $productsInCategory = zen_get_categories_products_list( (($manufacturers_id > 0 && $_GET['filter_id'] > 0) ? zen_get_generated_category_path_rev($_GET['filter_id']) : $cPath), false, true, 0, $display_limit);

  if (is_array($productsInCategory) && sizeof($productsInCategory) > 0) {
    // build products-list string to insert into SQL query
    foreach($productsInCategory as $key => $value) {
      $list_of_products .= $key . ', ';
    }
    $list_of_products = substr($list_of_products, 0, -2); // remove trailing comma
*/
    $new_products_query = "select distinct p.products_id, p.products_image, p.products_tax_class_id, pd.products_name,
12 Feb 2008, 4:38 PM
#5
dml311071 avatar

dml311071

New Zenner

Join Date:
Sep 2006
Location:
Grimsby UK
Posts:
98
Plugin Contributions:
0

Re: Show New Products from all categories

Hi Kobra

I did try your suggested solution, I kind of see where you are coming from removing the filters and so on. Unfortunately, all this did was blank all products and categories out completely! ie all columns empty below the header.

Odd:wacko: