Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21
  1. #11
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,697
    Plugin Contributions
    6

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    What version of Zen Cart are you using?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  2. #12
    Join Date
    Jun 2006
    Posts
    385
    Plugin Contributions
    0

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    Hi I am on 1.3.8a

    (Sorry not able to upgarde at the moment, not i my capacity)

    Thanks
    RR

  3. #13
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,697
    Plugin Contributions
    6

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    Post the whole SELECT statement that you have in your code ... it is not making a lot of sense why it does not work for you to add:
    AND p.products_quantity > 0

    to the WHERE portion of the SELECT statements ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  4. #14
    Join Date
    Jun 2006
    Posts
    385
    Plugin Contributions
    0

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    <?php
    /**
    * Specials
    *
    * @package page
    * @copyright Copyright 2003-2007 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: main_template_vars.php 6912 2007-09-02 02:23:45Z drbyte $
    */

    if (MAX_DISPLAY_SPECIAL_PRODUCTS > 0 ) {
    $specials_query_raw = "SELECT p.products_id, p.products_image, pd.products_name,
    p.master_categories_id
    FROM (" . TABLE_PRODUCTS . " p
    LEFT JOIN " . TABLE_SPECIALS . " s on p.products_id = s.products_id
    LEFT JOIN " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id )
    WHERE p.products_id = s.products_id and p.products_id = pd.products_id and p.products_status = '1'
    AND s.status = 1
    AND p.products_quantity > 0

    AND pd.language_id = :languagesID
    ORDER BY s.specials_date_added DESC";

    $specials_query_raw = $db->bindVars($specials_query_raw, ':languagesID', $_SESSION['languages_id'], 'integer');
    $specials_split = new splitPageResults($specials_query_raw, MAX_DISPLAY_SPECIAL_PRODUCTS);
    $specials = $db->Execute($specials_split->sql_query);
    $row = 0;
    $col = 0;
    $list_box_contents = array();
    $title = '';

    $num_products_count = $specials->RecordCount();
    if ($num_products_count) {
    if ($num_products_count < SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS || SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS==0 ) {
    $col_width = floor(100/$num_products_count);
    } else {
    $col_width = floor(100/SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS);
    }

    $list_box_contents = array();
    while (!$specials->EOF) {

    $products_price = zen_get_products_display_price($specials->fields['products_id']);
    $specials->fields['products_name'] = zen_get_products_name($specials->fields['products_id']);
    $list_box_contents[$row][$col] = array('params' => 'class="specialsListBoxContents"' . ' ' . 'style="width:' . $col_width . '%;"',
    'text' => '<a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . (($specials->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : zen_image(DIR_WS_IMAGES . $specials->fields['products_image'], $specials->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>') . '<br /><a href="' . zen_href_link(zen_get_info_page($specials->fields['products_id']), 'cPath=' . zen_get_generated_category_path_rev($specials->fields['master_categories_id']) . '&products_id=' . $specials->fields['products_id']) . '">' . $specials->fields['products_name'] . '</a><br />' . $products_price);
    $col ++;
    if ($col > (SHOW_PRODUCT_INFO_COLUMNS_SPECIALS_PRODUCTS - 1)) {
    $col = 0;
    $row ++;
    }
    $specials->MoveNext();
    }
    require($template->get_template_dir('tpl_specials_default.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_specials_default.php');
    }
    }
    ?>

  5. #15
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,697
    Plugin Contributions
    6

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    I am sorry but I am not seeing the problem in the code ...

    I do not have a functional v1.3.8 to fool with to see if there is something to break this but it works on v1.3.9h and v1.5 ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  6. #16
    Join Date
    Aug 2009
    Posts
    148
    Plugin Contributions
    0

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    I hope to have a little help from you .

    After I eliminate all sold products for being listed by applying advices on this thread I still have an Issue . When I click on next product button ( product info page ) products already sold are coming out . Do you know which file should a check in order to prevent that ?

    Thx

  7. #17
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,697
    Plugin Contributions
    6

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    If you do not want Sold Out Products in the Listings, sideboxes or in the Previous/Next ... then do you want Sold Out Products to ever show?

    If not, why don't you set your site up that Sold Out Products are marked as Out of Stock and they are turned off an do not show ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  8. #18
    Join Date
    Aug 2009
    Posts
    148
    Plugin Contributions
    0

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    I need products remain on stock in order to have google working links and to avoid a loop problem ( another own trhread ) but hide them from categories listing . Everything works ok except previous/next . Is there any solution ?

  9. #19
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    64,697
    Plugin Contributions
    6

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    Try customizing the file:
    /includes/modules/product_prev_next.php

    using your templates and overrides and add the code in RED:
    Code:
      $sql = "select p.products_id, p.products_model, p.products_price_sorter, pd.products_name, p.products_sort_order
              from   " . TABLE_PRODUCTS . " p, "
      . TABLE_PRODUCTS_DESCRIPTION . " pd, "
      . TABLE_PRODUCTS_TO_CATEGORIES . " ptc
              where  p.products_quantity >= 1 and p.products_status = '1' and p.products_id = pd.products_id and pd.language_id= '" . (int)$_SESSION['languages_id'] . "' and p.products_id = ptc.products_id and ptc.categories_id = '" . (int)$current_category_id . "'" .
      $prev_next_order;
    and see if that does what you want where you can still get to the product_info page for the Products with products_quantity 0, like a spider would, but not get to these products using the Previous/Next ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.1]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...

  10. #20
    Join Date
    Aug 2009
    Posts
    148
    Plugin Contributions
    0

    Default Re: Make a product that is sold out not appear in listings, sideboxes

    Thank you so much Linda , worked perfect .

    Have anice day !

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Replies: 15
    Last Post: 16 Sep 2012, 04:45 PM
  2. Sold out button only on main page product listings?
    By jt3c in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Jun 2011, 04:14 PM
  3. Make product listing look like the all listings
    By Derek_ICD in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 11 May 2009, 12:42 PM
  4. Make all product listings formatted like Specials?
    By Bad Wolf in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 24 Jun 2008, 05:37 PM
  5. Make a product go to affiliate link not product page (sold out)
    By apemusic in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 29 May 2006, 09:03 AM

Bookmarks

Posting Permissions

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