This is an old revision of the document!
Zen Cart automatically adds product numbers to each of your products. Here's how to make the product IDs a little more useful.
Add this code to includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_display.php wherever you like (we chose right under the title, line 62)
ID: <?php echo $_GET['products_id']; ?><br />
in includes/modules/meta_tags.php
Find line 275
define('META_TAG_TITLE', str_replace('"','',$review_on . $meta_products_name . $meta_products_price . PRIMARY_SECTION . TITLE . TAGLINE));
and replace it with
$meta_products_name .= " ID: " . $product_info_metatags->fields['products_id']; define('META_TAG_TITLE', str_replace('"','',$review_on . $meta_products_name . $meta_products_price . PRIMARY_SECTION . TITLE . TAGLINE));
in includes/modules/pages/advanced_search_results/header_php.php
Insert right after (line 58)
if (isset($_GET['keyword']) && $_GET['keyword'] != HEADER_SEARCH_DEFAULT_TEXT && $_GET['keyword'] != KEYWORD_FORMAT_STRING) { $keywords = $_GET['keyword']; }
this code
if (strpos($keywords, ' ') === FALSE && is_numeric($keywords) && (int)$keywords == $keywords) { $exists = $db->Execute("SELECT products_id FROM products WHERE products_id = " . (int)$keywords . " AND products_status = 1"); if( !$exists->EOF) { zen_redirect(zen_href_link('product_info' , 'products_id=' . (int)$keywords , 'NONSSL', false)); } }
This will make searches for a product number jump straight to that page. It will also make numbers that are product ID unsearchable!