notify('NOTIFY_HEADER_START_PRODUCT_INFO'); require(DIR_WS_MODULES . zen_get_module_directory('require_languages.php')); // if specified product_id is disabled or doesn't exist, ensure that metatags and breadcrumbs don't share inappropriate information $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']); unset($breadcrumb->_trail[sizeof($breadcrumb->_trail)-1]['title']); $robotsNoIndex = true; header('HTTP/1.1 404 Not Found'); } // ensure navigation snapshot in case must-be-logged-in-for-price is enabled if (!$_SESSION['customer_id']) { $_SESSION['navigation']->set_snapshot(); } if (isset($_GET['action']) && ($_GET['action'] == 'addtag')) { $product_tag = zen_db_prepare_input($_POST['product_tag']); $error = false; if ($product_tag=='') { $error = true; $messageStack->add('product_tag_form', JS_REVIEW_TEXT); } $sql = "INSERT INTO product_tag (products_id, products_tag) VALUES (".$_GET['products_id'].",'". $product_tag ."')"; $db->Execute($sql); zen_redirect(zen_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_GET['products_id'], 'SSL')); } // This should be last line of the script: $zco_notifier->notify('NOTIFY_HEADER_END_PRODUCT_INFO');