Forums / General Questions / Hide Product info on upcoming items

Hide Product info on upcoming items

Locked

Started by ksoup on 23 Aug 2007, 1:19 PM · Views: 1,403

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
23 Aug 2007, 1:19 PM
#1
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

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_page=product_info&products_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.

23 Aug 2007, 2:28 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Hide Product info on upcoming items

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

around line 15 you have this:require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));add this right after it:```
$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']);
}

.
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.

23 Aug 2007, 3:02 PM
#3
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

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.

DrByte:

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

around line 15 you have this:require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));add this right after it:```
$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']);
}

23 Aug 2007, 3:36 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Hide Product info on upcoming items

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

.
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.

23 Aug 2007, 4:04 PM
#5
ksoup avatar

ksoup

Zen Follower

Join Date:
Jan 2004
Posts:
413
Plugin Contributions:
1

Re: Hide Product info on upcoming items

Doing the DrByte TOTALLY ROCKS Dance!!!!!

YOU so totally rock!!!!

Thanks!!! :)

DrByte:

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

around line 15 you have this:require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php'));add this right after it:```
$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']);
}


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