Hi guys,
I have a big problem with my Master & Slave products.
I cloned a MP3 download store to another server. On the orignal server two instances of this shop are running perfect. Order Download products (master & Slave), as you can see it in the picture above, works without any problem.
The products are send correctly to the basket and if you press the checkout button, you will be send directly to the checkout_payment.php.
After installing the system on another Server one big problem appeared.
If you order a product out of the product_info.php that produce the listing above, then the products are send to the basket, but if you want to checkout, you will be send to checkout_shipping.php and afterwards downloads do not work.
After checking every tiny peace of code, I found out that if I use a non modified product_info.php, then everthing works correct. Downloading is possible.
I checked every detail of the configuration and as good as possible, if there is any mistake inside the script, but cant find the problem.
This is the code, witch produces the mistake (I think, one problem is, that products are not correctly indentified as virtual downloadable products).
/*
$Id: product_info.php,v 1.97 2003/07/01 14:34:54 hpdl Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2003 osCommerce
Released under the GNU General Public License
*/
<?php
require('includes/application_top.php');
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);
$product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
$product_check = tep_db_fetch_array($product_check_query);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="style.css">
<script language="javascript">
<!--
function popupWindow(url) {
window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=no,copyhistory=no,width=310,height=200,screenX=0,screenY=0,top=200,left=35
0')
}
//-->
</script>
</head>
<body>
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<?php
// Master Products EOF
if ($product_check['total'] < 1) {
?>
<div class="itemInfo">
<table width='100%'>
<tr>
<td align='left'><b> </b></td>
</tr>
</table>
</div>
<div class="itemBody">
<br />
<?php include(DIR_WS_MODULES . FILENAME_NAVI_CATEGORIES); ?>
<br />
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td align="center"><strong><?php echo TEXT_PRODUCT_NOT_FOUND; ?></strong></td>
</tr>
</table>
<br />
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td align="center"><input type="button" value="<?php echo BUTTON_CONTINUE ?>" onclick="location='<?php echo tep_href_link(FILENAME_DEFAULT) ?>'" class="submit" /></td>
</tr>
</table>
<br />
</div>
<?php
}
else
{
//Master Products
$product_info_query = tep_db_query("select p.products_id, pd.products_name, p.products_label, p.products_spiel_dauer, p.products_release_datum, p.products_titel_anzahl, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_mp3, p.products_price, p.products_master, p.products_master_status, p.products_tax_class_id, p.products_date_available, p.manufacturers_id, p.label_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
//Master Products EOF
$product_info = tep_db_fetch_array($product_info_query);
tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
$products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
}
else {
$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
}
// Master Status
$master_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_master = '" . (int)$HTTP_GET_VARS['products_id'] . " '");
$results = tep_db_fetch_array($master_query);
if ((tep_not_null($product_info['products_model'])) && ($product_info['products_master_status'] != 1)) {
$products_name = '<strong>' . $product_info['products_name'] . ' </strong> ' . TEXT_PRODUCTS_AUS_ALBUM . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO . '?products_id=' . $product_info['products_master'], '', 'NONSSL') . '"> <strong>' . $product_info['products_model'] . '</strong></a>';
}
else {
$products_name = '<strong>' . $product_info['products_name'] . '</strong>';
}
?>
<div class="itemInfo">
<table width='100%'>
<tr>
<td align='left'><b><?php
if (($results['products_id'] != null) && ($product_info['products_master_status'] == 1)) {
echo TEXT_PRODUCTS_ALBUM; } else { echo TEXT_PRODUCTS_TITLE;
}
?></b></td>
</tr>
</table>
</div>
<div class="itemBody">
<br />
<?php include(DIR_WS_MODULES . FILENAME_NAVI_CATEGORIES); ?>
<br />
<?php echo '<form name="buy_now_1" method="post" action="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=add_slave', 'NONSSL') . '">'; ?>
<?php
$manufacturers_id = $product_info['manufacturers_id'];
$category_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$manufacturers_id . "'");
$category = tep_db_fetch_array($category_query);
?>
<?php if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { ?>
<table width="100%" border="0" cellpadding="0" cellspacing="10">
<tr>
<?php
if ($product_info['products_master_status'] == 1) { ?>
<td align="center"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_short($product_info['products_date_available'])); ?></td>
<?php
}
else { ?>
<td align="center"><?php echo sprintf(TEXT_DATE_AVAILABLE_TITEL, tep_date_short($product_info['products_date_available'])); ?></td>
<?php } ?>
</tr>
</table>
<br />
<?php
}
?>
<table width="100%" border="0" cellpadding="0" cellspacing="10">
<tr>
<td align="left" valign="top" width="<?php echo PRODUKT_INFO_IMAGE_WIDTH ?>">
<?php
if (tep_not_null($product_info['products_image'])) {
echo tep_image(DIR_WS_IMAGES . $product_info['products_image'], $category['manufacturers_name'].' » '.$product_info['products_name'], PRODUKT_INFO_IMAGE_WIDTH, PRODUKT_INFO_IMAGE_HEIGHT).'<br />';
}
else {
echo tep_draw_separator('no_img.gif', PRODUKT_INFO_IMAGE_WIDTH, PRODUKT_INFO_IMAGE_HEIGHT).'';
}
if ($product_info['products_master_status'] == 1) {
echo tep_draw_separator('album.gif', PRODUKT_INFO_IMAGE_WIDTH, 20);
}
else {
echo tep_draw_separator('title.gif', PRODUKT_INFO_IMAGE_WIDTH, 20);
}
?>
</td>
<td valign="top">
<?php
$parent_query = "select categories_id from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_name ='" . $category['manufacturers_name'] . "'";
$arr_parent_category_query = tep_db_query($parent_query);
$parent_category = tep_db_fetch_array($arr_parent_category_query);
?>
<table border="0" align="left" cellpadding="0" cellspacing="2" width="100%">
<tr>
<td align="left"><strong><?php echo '<a href="' . tep_href_link(FILENAME_LISTE . '?cPath=' . $parent_category['categories_id'], '', 'NONSSL') . '">' . $category['manufacturers_name'] .'</a>'; ?></strong></td>
</tr>
<tr>
<td align="left"><?php echo $products_name; ?></td>
</tr>
<tr>
<td align="left"> </td>
</tr>
<tr>
<td align="left">
<table border="0" align="left" cellpadding="0" cellspacing="2" width="100%">
<tr>
<td align="left" width="150"><?php echo TEXT_PRODUCTS_PREIS; ?></td>
<td align="left"><strong>
<?php
if ($product_info['products_quantity'] > 0) {
if ($products_price > '0') {
echo $products_price;
}
else {
echo TEXT_PRODUCTS_PREIS_NEIN;
}
}
else {
echo TEXT_PRODUCTS_PREIS_NEIN;
}
?></strong>
</td>
</tr>
<tr>
<td align="left" colspan="2"> </td>
</tr>
<tr>
<td align="left" width="150">
<?php
$label_id = $product_info['label_id'];
$category_query = tep_db_query("select label_name from " . TABLE_LABEL . " where label_id = '" . (int)$label_id . "'");
$category = tep_db_fetch_array($category_query);
$category['label_name'];
echo TEXT_PRODUCTS_LABEL;
?>
</td>
<td align="left"><?php echo $category['label_name']; ?></td>
</tr>
<tr>
<td align="left" width="150"><?php echo TEXT_PRODUCTS_RELEASE_DATUM; ?></td>
<td align="left"><?php echo $product_info['products_release_datum']; ?></td>
</tr>
<tr>
<td align="left" width="150"><?php echo TEXT_PRODUCTS_SPIEL_DAUER; ?></td>
<td align="left"><?php echo $product_info['products_spiel_dauer']; ?></td>
</tr>
<?php
if ($product_info['products_master_status'] == 1) { ?>
<tr>
<td align="left" width="150"><?php echo TEXT_PRODUCTS_TITEL_ANZAHL; ?></td>
<td align="left"><?php echo $product_info['products_titel_anzahl']; ?></td>
</tr>
<?php } ?>
<tr>
<td align="left" width="150"><?php echo TEXT_REVIEW_AVERAGE; ?></td>
<td align="left">
<?php
$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
$reviews = tep_db_fetch_array($reviews_query);
$reviews_query_average = tep_db_query("select (avg(reviews_rating)) as average_rating from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
$reviews_average = tep_db_fetch_array($reviews_query_average);
$reveiws_stars = $reviews_average['average_rating'];
$reveiws_rating = number_format($reveiws_stars,0);
if ($reviews['count'] > 0) {
echo tep_image(DIR_WS_IMAGES . 'stars_' . $reveiws_rating . '.gif') . ' ' . $reviews['count'] . ' ' . TEXT_CURRENT_REVIEWS;
// echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image(DIR_WS_IMAGES . 'stars_' . $reveiws_rating . '.gif') . ' ' . $reviews['count'] . ' ' . TEXT_CURRENT_REVIEWS . '</a>';
}
else {
echo "-";
}
?>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">
<?php
$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
$products_attributes = tep_db_fetch_array($products_attributes_query);
if ($products_attributes['total'] > 0) {
?>
<table border="0" align="left" cellpadding="0" cellspacing="2" width="100%">
<tr>
<td>
<?php
$products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
$products_options_array = array();
$products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
while ($products_options = tep_db_fetch_array($products_options_query)) {
$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
if ($products_options['options_values_price'] != '0') {
$products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
}
}
if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
$selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
}
else {
$selected_attribute = false;
}
?>
<?php echo tep_draw_hidden_field2('id_' . $HTTP_GET_VARS['products_id'] . '[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?>
<?php
}
?>
</td>
</tr>
</table>
<?php
}
?>
</td>
</tr>
<tr>
<td valign="top">
<table border="0" align="left" cellpadding="0" cellspacing="2" width="100%">
<?php
if ($product_info['products_price']>0) {
$qty_array = array();
for ($i=0; $n2 = (($product_info['products_quantity'] < 1) ? $product_info['products_quantity'] : 1), $i <= $n2; $i++) {
$qty_array[] = array('id' => $i, 'text' => $i);
}
?>
<tr>
<td align="right">
<?php
if ($product_info['products_quantity'] > 0) {
echo ' ' . tep_draw_hidden_field2('Qty_ProdId_' . $product_info['products_id'], $qty_array);
}
elseif ((STOCK_CHECK == 'false')&& ($product_info['products_quantity'] < 1)) {
$qty_array = array();
for ($i=0; $ns = 1, $i <= $ns; $i++) {
$qty_array[] = array('id' => $i, 'text' => $i);
$zahl = '1';
}
echo TEXT_QUANTITY . ' ' . tep_draw_hidden_field2('Qty_ProdId_' . $product_info['products_id'], $qty_array);
}
else {
$bestellbutton = '1';
// echo TEXT_STOCK;
}
?>
</td>
</tr>
<?php
}
?>
<tr>
<td valign="top">
<table border="0" align="left" cellpadding="0" cellspacing="2" width="100%">
<tr>
<!--MP3 player start -->
<td align="left" width="33%">
<?php
if (tep_not_null($product_info['products_mp3'])) {
$titelename = $product_info['products_name'];
$titelename = str_replace("'", "", $titelename);
?>
<input type="button" value="<?php echo BUTTON_MP3 ?>" onclick="<?php echo 'javascript:popupWindow(\'' . 'player.php?track=' . $product_info['products_mp3'] . '&title=' . $titelename . '\') ';?>" class="submit" />
<?php } ?>
</td>
<!--MP3 player end -->
<td align="center">
<input type="button" value="<?php echo IMAGE_BUTTON_REVIEWS ?>" onclick="location='<?php echo tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) ?>'" class="submit" />
</td>
<td align="right" width="33%">
<?php
if ($product_info['products_quantity'] > 0) {
if ($product_info['products_master_status'] == 1) {
echo tep_draw_hidden_field('products_id', $product_info['products_id']) . '<input type="submit" value="'.BUTTON_BUY_ALBUM.'" class="submit">';
}
else {
echo tep_draw_hidden_field('products_id', $product_info['products_id']) . '<input type="submit" value="'.BUTTON_BUY_TITLE.'" class="submit">';
}
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br />
<?php
$master_query = tep_db_query("select products_id from " . TABLE_PRODUCTS . " where products_master = '" . (int)$HTTP_GET_VARS['products_id'] . " ' and products_status = '1'");
$results = tep_db_fetch_array($master_query);
if (($results['products_id'] != null) && ($product_info['products_master_status'] == 1)) {
include(DIR_WS_MODULES . FILENAME_MASTER_PRODUCTS);
}
?>
</form>
<br />
<?php
include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
?>
<br />
<?php
if (MAX_REVIEWS_IN_PRODUCT_INFO > 0) {
?>
<table border="0" width="100%">
<tr class="even">
<td><strong><?php echo TEXT_HEADER_CUSTOMERS_REVIEWS . ' (' . $reviews['count'] . ')';?></strong></td>
</tr>
<tr>
<td>
<?php
$reviews_query = tep_db_query("select r.reviews_id, rd.reviews_text, r.reviews_rating, r.date_added, r.customers_name from " . TABLE_REVIEWS . " r, " . TABLE_REVIEWS_DESCRIPTION . " rd where r.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and rd.reviews_id = r.reviews_id and rd.languages_id = '" . $languages_id . "' order by r.reviews_id DESC");
$num_rows = tep_db_num_rows($reviews_query);
?>
<table border="0" width="100%">
<tr>
<td align="left">
<a href="<?php echo tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, substr(tep_get_all_get_params(), 0, -1)); ?>"><?php echo BUTTON_WRITE_REVIEW; ?></a> -
<a href="<?php echo tep_href_link(FILENAME_PRODUCT_REVIEWS, substr(tep_get_all_get_params(), 0, -1)); ?>"><?php echo BUTTON_MORE_REVIEWS; ?></a> -
<a href="<?php echo tep_href_link(FILENAME_TELL_A_FRIEND, substr(tep_get_all_get_params(), 0, -1)); ?>"><?php echo IMAGE_BUTTON_TELL_A_FRIEND; ?></a>
</td>
</tr>
<?php
$row = 0;
while (($reviews_values = tep_db_fetch_array($reviews_query)) && ($row < MAX_REVIEWS_IN_PRODUCT_INFO)) {
$row++;
$date_added = tep_date_short($reviews_values['date_added']);
if (($row/2) == floor($row/2)) {
$class = 'class="even"';
}
else {
$class = 'class="odd"';
}
?>
<tr>
<td valign="top" align="left" <?php echo $class; ?>><?php echo sprintf(tep_image(DIR_WS_IMAGES . 'stars_' . $reviews_values['reviews_rating'] . '.gif')) . ' von <strong>' . $reviews_values['customers_name'] . '</strong> am ' . $date_added . '<br />' . htmlspecialchars($reviews_values['reviews_text']) ?></td>
</tr>
<?php
}
?>
</table>
</td>
</tr>
</table>
<?php
}
?>
<br />
</div>
<?php
}
?>
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>
... with this code inside the product_info.php buying an downloading is no problem..
/* $Id: product_info.php 2003/07/01 14:34:54 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Released under the GNU General Public License */ <?php require('includes/application_top.php'); require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO); $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_check = tep_db_fetch_array($product_check_query); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="de" lang="de"> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo TITLE; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <link rel="stylesheet" type="text/css" href="style.css"> <script language="javascript"> <!-- function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=no,copyhistory=no,width=310,height=200,screenX=0,screenY=0,top=200,left=35 0') } //--> </script> </head> <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> <!-- header //--> <?php require(DIR_WS_INCLUDES . 'header.php'); ?> <!-- header_ende //--> <!-- body //--> <table border="0" width="75%" cellspacing="0" cellpadding="0"> <!-- body_text //--> <td valign="top" class="item"> <?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?> <table border="0" width="75%" cellspacing="0" cellpadding="0"> <?php if ($product_check['total'] < 1) { ?> <td class="item"> <table border="0" width="75%" cellspacing="5" cellpadding="0"> <tr> <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td> </tr> </table> </td> </tr> <tr> <td> <table width="75%" border="0" cellpadding="0" cellspacing="0" class="wt_bodyhg"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td> </tr> </table> </td> </tr> <tr> <td class="item"> <table border="0" width="75%" cellspacing="5" cellpadding="0"> <tr> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td> </tr> </table> </td> </tr> <tr> <td> <table width="75%" border="0" cellspacing="0" cellpadding="0" class="wt_bodyhg"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td> </tr> </table> </td> </tr> <?php } else { $product_info_query = tep_db_query("select p.products_id, pd.products_name, p.products_spiel_dauer, p.products_release_datum, p.products_titel_anzahl, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on (p.manufacturers_id = m.manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); $product_info = tep_db_fetch_array($product_info_query); tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } ?> <tr> <td valign="top" class="item"> <table border="0" width="75%" cellspacing="10" cellpadding="0" class="item"> <tr> <td align="left" valign="top" class="wt_ueberschrift"><?php echo $products_name; ?></td> <td align="right" valign="top" class="wt_ueberschrift"><?php echo $products_price; ?></td> </tr> <tr> <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <td align="left" valign="top" class="item"> <?php echo sprintf(TEXT_PRODUCTS_LABEL, ($product_info['manufacturers_name'])); ?><br> <?php echo sprintf(TEXT_PRODUCTS_SPIEL_DAUER, ($product_info['products_spiel_dauer'])); ?><br> </td> <td align="right" valign="top"> <?php if (tep_not_null($product_info['products_image'])) { ?> <table cellspacing="0" cellpadding="0" border="0"> <tr> <td align="right" valign="top"> <?php echo tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"'); ?> </td> </tr> </table> <?php } ?> </td> </tr> </table> </td> </tr> <tr> <td> <table width="75%" border="0" cellpadding="0" cellspacing="0" class="wt_bodyhg"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td> </tr> </table> </td> </tr> <tr> <td class="item"> <table width="75%" border="0" cellpadding="0" cellspacing="20"> <tr> <td align="left" valign="top" class="item"> <p><?php echo stripslashes($product_info['products_description']); ?></p> <?php $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'"); $products_attributes = tep_db_fetch_array($products_attributes_query); if ($products_attributes['total'] > 0) { ?> <table border="0" cellspacing="0" cellpadding="0"> <tr> <td valign="top" align="left" class="item" colspan="3"> <?php echo TEXT_PRODUCT_OPTIONS; ?> </td> </tr> <?php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { $products_options_array = array(); $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'"); while ($products_options = tep_db_fetch_array($products_options_query)) { $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']); if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) { $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']]; } else { $selected_attribute = false; } ?> <tr> <td valign="top" align="left" class="item" colspan="3"> </td> </tr> <tr> <td valign="top" align="left" class="item"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td valign="top" align="left" class="item"> </td> <td valign="top" align="left" class="item"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute, ' class="item" '); ?></td> </tr> <?php } ?> </table> <?php } ?> </td> </tr> <?php if (tep_not_null($product_info['products_url'])) { ?> <tr> <td class="item"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td> </tr> <?php } ?> </table> </td> </tr> <tr> <td> <table width="75%" border="0" cellpadding="0" cellspacing="0" class="wt_bodyhg"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td> </tr> </table> </td> </tr> <tr> <td class="item"> <table width="75%" cellspacing="0" cellpadding="0" border="0"> <tr> <td> <table width="75%" cellspacing="15" cellpadding="0" border="0"> <tr> <td width="33%" align="center" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td> <td align="center" valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL') . '">' . tep_image_button('button_checkout.gif', IMAGE_BUTTON_CHECKOUT) . '</a>'; ?></td> <td width="33%" align="center" valign="middle"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td> <table width="75%" border="0" cellpadding="0" cellspacing="0" class="wt_bodyhg"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td> </tr> </table> </td> </tr> <?php $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'"); $reviews = tep_db_fetch_array($reviews_query); if ($reviews['count'] > 0) { ?> <tr> <td class="item"> <table width="75%" cellspacing="5" cellpadding="0" border="0"> <tr> <td align="left" valign="middle" class="item"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td> </tr> </table> </td> </tr> <tr> <td> <table width="75%" border="0" cellpadding="0" cellspacing="0" class="wt_bodyhg"> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td> </tr> </table> </td> </tr> <?php } if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) { ?> <tr> <td class="item"> <table width="75%" cellspacing="5" cellpadding="0" border="0"> <tr> <td align="center" valign="middle" class="item"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td> </tr> </table> </td> </tr> <?php } else { ?> <tr> <td class="item"> <table width="75%" cellspacing="5" cellpadding="0" border="0"> <tr> <td align="center" class="item"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td> </tr> </table> </td> </tr> <?php } ?> <tr> <td> </td> </tr> <tr> <td class="item"> <?php if ((USE_CACHE == 'true') && empty($SID)) { echo tep_cache_also_purchased(3600); } else { include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS); } } ?> </td> </tr> <tr> <td> </td> </tr> </table> </form> </td> <!-- body_text_ende //--> </tr> </table> ******************************************************************************** ************* <?php // Master Products EOF if ($product_check['total'] < 1) { ?> <div class="itemInfo"> <table width='100%'> <tr> <td align='left'><b> </b></td> </tr> </table> </div> <div class="itemBody"> <br /> <?php include(DIR_WS_MODULES . FILENAME_NAVI_CATEGORIES); ?> <br /> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td align="center"><strong><?php echo TEXT_PRODUCT_NOT_FOUND; ?></strong></td> </tr> </table> <br /> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td align="center"><input type="button" value="<?php echo BUTTON_CONTINUE ?>" onclick="location='<?php echo tep_href_link(FILENAME_DEFAULT) ?>