Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2005
    Posts
    72
    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

  2. #2
    Join Date
    Sep 2004
    Posts
    1,388
    Plugin Contributions
    4

    Default 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

  3. #3
    Join Date
    Sep 2005
    Posts
    72
    Plugin Contributions
    0

    Default Re: Blocking Category from New Items

    Quote Originally Posted by 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. #4
    Join Date
    Sep 2004
    Posts
    1,388
    Plugin Contributions
    4

    Default 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

  5. #5
    Join Date
    Sep 2005
    Posts
    72
    Plugin Contributions
    0

    Default 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

  6. #6
    Join Date
    Sep 2004
    Posts
    1,388
    Plugin Contributions
    4

    Default 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...
    Code:
    $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.
    Frank Koehl
    "Cleverly Disguised as a Responsible Adult"

    frankkoehl.com

 

 

Similar Threads

  1. Replies: 3
    Last Post: 2 Aug 2016, 01:03 PM
  2. v139h blocking new users from registering with certain email providers
    By JoseWilliams in forum Basic Configuration
    Replies: 4
    Last Post: 7 Nov 2013, 05:37 PM
  3. Replies: 3
    Last Post: 12 Jun 2011, 06:26 AM
  4. Blocking a Category from showing in 'New Poducts' boxes
    By Macbusa in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 12 Jul 2008, 12:30 AM
  5. Blocking Category from New Item Listing
    By dng in forum General Questions
    Replies: 2
    Last Post: 22 Sep 2006, 03:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg