Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

    Default Hide Product info on upcoming items

    Would there be a quick and easy way to hide or not allow the cart to put in the information on products that are waiting to go in the store.

    I.E.

    Product 1234 "Our New Product" is 0 Status

    You cannot select it from any listing, but if you go to the top and add the 1234 to the url (like the following)
    http://mystore.com/index.php?main_pa...oducts_id=1234
    ...the customer can see the product name next to the category name and in the page title of the browser bar

    Home :: "Our New Product"
    Sorry, the product was not found.

    and

    Browser Bar Title = Name, Model, Price :: Store Name

    We don't want customers to guess subsequent numbers and see upcoming stock.


    Looking for an easy solution... anyone have one?

    I have already tried changing the product number on the products table, but tha t messes up the auto increment.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Hide Product info on upcoming items

    /includes/modules/pages/product_info/header_php.php

    around line 15 you have this:
    Code:
      require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
    add this right after it:
    Code:
      $sql = "select count(*) as total
              from " . TABLE_PRODUCTS . " p, " .
                       TABLE_PRODUCTS_DESCRIPTION . " pd
              where    p.products_status = '1'
              and      p.products_id = '" . (int)$_GET['products_id'] . "'
              and      pd.products_id = p.products_id
              and      pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
      $res = $db->Execute($sql);
      if ( $res->fields['total'] < 1 ) {
        unset($_GET['products_id']);
      }
    Do the same for your other product-types if you're using other than the default Product General type for your products.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

    Default Re: Hide Product info on upcoming items

    AWESOME!! It takes the info out of the browser title bar.

    Now, is there a way to remove it from the product info page? It shows in the category bar at the top of the product info display.

    Example:

    Home :: Name of Product

    Sorry, the product was not found.


    Quote Originally Posted by DrByte View Post
    /includes/modules/pages/product_info/header_php.php

    around line 15 you have this:
    Code:
      require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
    add this right after it:
    Code:
      $sql = "select count(*) as total
              from " . TABLE_PRODUCTS . " p, " .
                       TABLE_PRODUCTS_DESCRIPTION . " pd
              where    p.products_status = '1'
              and      p.products_id = '" . (int)$_GET['products_id'] . "'
              and      pd.products_id = p.products_id
              and      pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
      $res = $db->Execute($sql);
      if ( $res->fields['total'] < 1 ) {
        unset($_GET['products_id']);
      }
    Do the same for your other product-types if you're using other than the default Product General type for your products.

  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Hide Product info on upcoming items

    One way to do it would be to add this minor addition:
    Code:
      if ( $res->fields['total'] < 1 ) {
        unset($_GET['products_id']);
        unset($breadcrumb->_trail[sizeof($breadcrumb->_trail)-1]['title']);
      }
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Jan 2004
    Posts
    482
    Plugin Contributions
    0

    Default Re: Hide Product info on upcoming items

    Doing the DrByte TOTALLY ROCKS Dance!!!!!

    YOU so totally rock!!!!

    Thanks!!! :)


    Quote Originally Posted by DrByte View Post
    /includes/modules/pages/product_info/header_php.php

    around line 15 you have this:
    Code:
      require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));
    add this right after it:
    Code:
      $sql = "select count(*) as total
              from " . TABLE_PRODUCTS . " p, " .
                       TABLE_PRODUCTS_DESCRIPTION . " pd
              where    p.products_status = '1'
              and      p.products_id = '" . (int)$_GET['products_id'] . "'
              and      pd.products_id = p.products_id
              and      pd.language_id = '" . (int)$_SESSION['languages_id'] . "'";
      $res = $db->Execute($sql);
      if ( $res->fields['total'] < 1 ) {
        unset($_GET['products_id']);
      }
    Do the same for your other product-types if you're using other than the default Product General type for your products.
    Quote Originally Posted by DrByte View Post
    One way to do it would be to add this minor addition:
    Code:
      if ( $res->fields['total'] < 1 ) {
        unset($_GET['products_id']);
        unset($breadcrumb->_trail[sizeof($breadcrumb->_trail)-1]['title']);
      }

 

 

Similar Threads

  1. v151 Hide some attributes from product info display.
    By Marta van Eck in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 27 May 2014, 05:46 PM
  2. Hide upcoming products from all and category listings
    By jmsnyder23 in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 8 Mar 2012, 02:44 PM
  3. Hide Green Circle in Product Info Page Attributes
    By sivivatu in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 14 May 2010, 02:20 PM
  4. Hide items of info depending on language
    By joomoo79 in forum General Questions
    Replies: 3
    Last Post: 22 Feb 2009, 05:02 AM
  5. How to hide price on Product Info page?
    By otakushark in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 14 Dec 2007, 09:18 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