Forums / General Questions / Blocking Category from New Items

Blocking Category from New Items

Locked

Views: 1,158

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
3 Oct 2006, 2:51 PM
#1
dng avatar

dng

New Zenner

Join Date:
Sep 2005
Posts:
31
Plugin Contributions:
0

Blocking Category from New Items

Hello all,

I wanted to block 1 category from going into the New Item Listing... the way to do this is said by Ajeh "you would need to alter the select statement in the /includes/modules/pages/products_new/header_php.php"

Can any1 assist me in this please...
the header_php.php code

require(DIR_WS_MODULES . 'require_languages.php');
$breadcrumb->add(NAVBAR_TITLE);

Thank you for your support
DNG

3 Oct 2006, 3:02 PM
#2
blindside avatar

blindside

Totally Zenned

Join Date:
Sep 2004
Posts:
1,237
Plugin Contributions:
1

Re: Blocking Category from New Items

If that's all that's in your header file, you are using an older version. Upgrade to the latest version and this customization is pretty easy.

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com

4 Oct 2006, 3:28 PM
#3
dng avatar

dng

New Zenner

Join Date:
Sep 2005
Posts:
31
Plugin Contributions:
0

Re: Blocking Category from New Items

BlindSide:

If that's all that's in your header file, you are using an older version. Upgrade to the latest version and this customization is pretty easy.

I can not upgrade because I have customizations on my site... and if i upgrade.. it my give me problems... so I can't upgade but i want to do this on this version?

any help is appricate!

Thanks
DNG

4 Oct 2006, 4:40 PM
#4
blindside avatar

blindside

Totally Zenned

Join Date:
Sep 2004
Posts:
1,237
Plugin Contributions:
1

Re: Blocking Category from New Items

Upgrading is never a 100% easy process, however you will only fall more and more behind if you do not do it, making upgrading later an even more arduous task. Plus there are some especially important security updates in the latest version. I strongly recommend you suck it up and move to upgrade ASAP.

That being said, take a look at
/includes/templates/YOUR_TEMPLATE/templates/tpl_products_new_default.php

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com

6 Oct 2006, 2:27 PM
#5
dng avatar

dng

New Zenner

Join Date:
Sep 2005
Posts:
31
Plugin Contributions:
0

Re: Blocking Category from New Items

When i check that file... here is what I see..

Now what do i need to edit to fix this...

<table border="0" width="100%" cellspacing="2" cellpadding="2"> <tr> <td class="breadCrumb" colspan="2"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></td> </tr> <tr> <td class="pageHeading" colspan="2"><h1><?php echo HEADING_TITLE; ?></h1></td> </tr> <?php // display order dropdown $disp_order_default = PRODUCT_NEW_LIST_SORT_DEFAULT; include(DIR_WS_MODULES . 'listing_display_order.php'); ?> <?php $products_new_array = array();

//define('SHOW_NEW_PRODUCTS_LIMIT','30');
switch (true) {
case (SHOW_NEW_PRODUCTS_LIMIT == '0'):
$display_limit = '';
break;
case (SHOW_NEW_PRODUCTS_LIMIT == '1'):
$display_limit = " and date_format(p.products_date_added, '%Y%m') >= date_format(now(), '%Y%m')";
break;
case (SHOW_NEW_PRODUCTS_LIMIT == '30'):
$display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 30';
break;
case (SHOW_NEW_PRODUCTS_LIMIT == '60'):
$display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 60';
break;
case (SHOW_NEW_PRODUCTS_LIMIT == '90'):
$display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 90';
break;
case (SHOW_NEW_PRODUCTS_LIMIT == '120'):
$display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 120';
break;
}

$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'" . $display_limit . $order_by;

$products_new_split = new splitPageResults($products_new_query_raw, MAX_DISPLAY_PRODUCTS_NEW);

?>

<?php $show_submit = zen_run_normal(); if (PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART > 0 and $show_submit == 'true' and $products_new_split->number_of_rows > 0) { // bof: multiple products // check how many rows $check_products_all = $db->Execute($products_new_split->sql_query); $how_many = 0; while (!$check_products_all->EOF) { if (zen_has_product_attributes($check_products_all->fields['products_id'])) { } else { $how_many++; } $check_products_all->MoveNext(); } if ( (($how_many > 0 and $show_submit == 'true' and $products_new_split->number_of_rows > 0) and (PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART == 1 or PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART == 3)) ) { $show_top_submit_button = 'true'; } else { $show_top_submit_button = 'false'; } if ( (($how_many > 0 and $show_submit == 'true' and $products_new_split->number_of_rows > 0) and (PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART >= 2)) ) { $show_bottom_submit_button = 'true'; } else { $show_bottom_submit_button = 'false'; } if ($show_top_submit_button == 'true' or $show_bottom_submit_button == 'true') { echo zen_draw_form('multiple_products_cart_quantity', zen_href_link(zen_get_info_page($_GET['products_id']), zen_get_all_get_params(array('action')) . 'action=multiple_products_add_product'), 'post', 'enctype="multipart/form-data"'); } } ?> <?php if ($show_top_submit_button == 'true') { // only show when there is something to submit ?> <tr> <td align="right" colspan="2"><input type="submit" align="absmiddle" value="<?php echo SUBMIT_BUTTON_ADD_PRODUCTS_TO_CART; ?>" id="submit1" name="submit1" Class="SubmitBtn"></td> </tr> <?php } // PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART > 0 ?> <?php if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '1') || (PREV_NEXT_BAR_LOCATION == '3'))) { ?> <tr> <td class="pageresults"><?php echo $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?></td> <td align="right" class="pageresults"><?php echo TEXT_RESULT_PAGE . ' ' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y', 'main_page'))); ?></td> </tr> <?php } ?> <tr> <td class="main" colspan="2"><?php include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_PRODUCTS_NEW_LISTING)); ?></td> </tr> <?php if (($products_new_split->number_of_rows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) { ?> <tr> <td class="pageresults"><?php echo $products_new_split->display_count(TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?></td> <td align="right" class="pageresults"><?php echo TEXT_RESULT_PAGE . ' ' . $products_new_split->display_links(MAX_DISPLAY_PAGE_LINKS, zen_get_all_get_params(array('page', 'info', 'x', 'y', 'main_page'))); ?></td> </tr> <?php } ?> <?php if ($show_bottom_submit_button == 'true') { // only show when there is something to submit ?> <tr> <td align="right" colspan="2"><input type="submit" align="absmiddle" value="<?php echo SUBMIT_BUTTON_ADD_PRODUCTS_TO_CART; ?>" id="submit1" name="submit1" Class="SubmitBtn"></td> </tr> <?php } // PRODUCT_NEW_LISTING_MULTIPLE_ADD_TO_CART > 0 ?> <?php // only end form if form is created if ($show_top_submit_button == 'true' or $show_bottom_submit_button == 'true') { ?> </form> <?php } // end if form is made ?> </table> --------------- Thank You DNG
10 Oct 2006, 12:52 AM
#6
blindside avatar

blindside

Totally Zenned

Join Date:
Sep 2004
Posts:
1,237
Plugin Contributions:
1

Re: Blocking Category from New Items

At this point it should be obvious, so you probably don't have any experience with editing PHP and SQL queries. Here's the line you want to edit...

$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, p.products_date_added, m.manufacturers_name, p.products_model, p.products_quantity, p.products_weight from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$_SESSION['languages_id'] . "'" . $display_limit . $order_by;

I've shown you the door, now walk through it. Hit Google and start reading up. :smile:

Frank Koehl
"Cleverly Disguised as a Responsible Adult"

frankkoehl.com