Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

2gether pb with my product_info page


decodambiance

Recommended Posts

The 2gether contrib work fine but i don't know where i can integrate 2gether line code in product_info to avoid problem of lost form

 

<?php

/*

$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 © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

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 HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<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="stylesheet.css">

<script language="javascript"><!--

function popupWindow(url) {

var win_left = (screen.width - 500) / 2;

var win_top = (screen.height - 500) / 2;

window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re

sizable=yes,copyhistory=no,width=500,height=500,top='+win_top+',left='+win_left+'')

}

 

function display_gallery1(id) {

var url= '<? echo HTTP_SERVER . DIR_WS_CATALOG . FILENAME_GALLERY1 ?>' + '?id=' + id;

var win_left = (screen.width - 600) / 2;

var win_top = (screen.height - 650) / 2;

window.open(url,'gallery1','height=650,width=600,top='+win_top+',left='+win_left+',resizable=yes, toolbar=no,statusbar=no,scrollbars=yes').focus();

}

 

function display_gallery2(id) {

var url= '<? echo HTTP_SERVER . DIR_WS_CATALOG . FILENAME_GALLERY2 ?>' + '?id=' + id;

var win_left = (screen.width - 285) / 2;

var win_top = (screen.height - 400) / 2;

window.open(url,'gallery2','height=285,width=400,top='+win_top+',left='+win_left+',resizable=yes, toolbar=no,statusbar=no,scrollbars=yes').focus();

}

//--></script>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table class="main-table" width="<?php echo PAGE_WIDTH; ?>" height="<?php echo PAGE_HEIGHT; ?>" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" class="column-left"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="0" class="column-left">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><?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="100%" cellspacing="0" cellpadding="0">

<?php

if ($product_check['total'] < 1) {

?>

<tr>

<td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

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

 

</table></td>

</tr>

 

<?php

} else {

$product_info_query = tep_db_query("select p.products_id, pd.products_name, p.products_availability_id, pd.products_description,pd.products_format,pd.content_file1,pd.content_file2, pd.content_file3, 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, p.manufacturers_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 . "'");

$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> TTC <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span> TTC ';

} else {

$products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ' TTC';

}

 

// LC if (tep_not_null($product_info['products_model'])) {

// LC $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';

// LC } else {

$products_name = $product_info['products_name'];

// LC }

?>

<tr>

<td class="main" width="20%" valign="top">

<table border="0" cellspacing="0" cellpadding="2" align="right">

<?php

if (tep_not_null($product_info['products_image'])) {

?>

<tr>

<td class="smallText"><?php //echo tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="5" vspace="5"'); ?>

 

 

 

<script language="javascript"><!--

document.write('<?php echo '<a class="product" href="java script:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br><br>' . tep_image_button('loupe.jpg','zoom image produit').'<br>'. '</a>'; ?>');

//--></script>

<noscript>

<?php echo '<a class="product" href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT, 'hspace="5" vspace="5" ') . '<br><br>' . tep_image_button('loupe.jpg','zoom image produit').'<br><br>'. '</a>'; ?>

</noscript>

 

 

 

</td>

</tr>

 

<?php

}// Affichage des boutons pour accéder à la galerie d'images 1, à la galerie d'images 2, au contenu 1, au contenu 2

?>

<tr>

<td class="smallText">

<?php if(gallery1_exists($product_info['products_id']))

echo '<a href="java script:display_gallery1(\'' . $product_info['products_id'] . '\')">' . tep_image_button('gallery1_button.jpg', '') . '</a>';

?>

<?php echo '<a href="' . tep_href_link(FILENAME_TELL_A_FRIEND, 'products_id=' . $HTTP_GET_VARS['products_id'], 'NONSSL') . '">' . '<br><br>'.tep_image_button('button_tell_a_friend_txt.gif','conseiller un ami').'<br><br>' . '</a>'; ?>

 

 

 

</td>

</tr>

 

<tr>

<td class="smallText">

<?php if(gallery2_exists($product_info['products_id']))

echo '<a href="java script:display_gallery2(\'' . $product_info['products_id'] . '\')">' . tep_image_button('gallery2_button.jpg', '') . '</a>';

?>

</td>

</tr>

<tr>

<td class="smallText">

<?php if(strlen($product_info['content_file1']) != 0) {

?>

<a href="java script:popupWindow('<?php echo tep_href_link(DIR_WS_LANGUAGES . $language . '/content/' . $product_info['content_file1']); ?>')"><?php echo tep_image_button('content1_button.gif', ''); ?></a>

<?php

}

?>

</td>

</tr>

<tr>

<td class="smallText">

<?php if(strlen($product_info['content_file2']) != 0) {

?>

<a href="java script:popupWindow('<?php echo tep_href_link(DIR_WS_LANGUAGES . $language . '/content/' . $product_info['content_file2']); ?>')"><?php echo tep_image_button('content2_button.gif', ''); ?></a>

<?php

}

?>

</td>

</tr>

 

<tr>

<td class="smallText">

<?php if(strlen($product_info['content_file3']) != 0) {

?>

<a href="java script:popupWindow('<?php echo tep_href_link(DIR_WS_LANGUAGES . $language . '/content/' . $product_info['content_file3']); ?>')"><?php echo tep_image_button('content3_button.jpg', ''); ?></a>

<?php

}

?>

</td>

</tr>

 

<tr>

<td class="smallText">

<?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) {

echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, 'products_id=' . (int)$HTTP_GET_VARS['products_id']) . '" name="' . TEXT_CURRENT_REVIEWS . ' ' . $reviews['count'] . '">' . tep_image_button('opinion_button.jpg', '') . '</a>';

}

?>

</td>

</tr>

</table>

 

 

 

<td class="main" valign="top">

<table border="0" cellspacing="0" cellpadding="0">

<tr>

<td class="product-name" valign="top"><?php echo $products_name; ?></td>

</tr>

<tr>

<td class="product-description"><?php echo stripslashes($product_info['products_description']); ?>

</tr>

<tr>

<td class="product-description"><?php echo stripslashes($product_info['products_format']); ?>

</tr>

<?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) {

$products_id=(preg_match("/^d{1,10}({d{1,10}}d{1,10})*$/",$HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : (int)$HTTP_GET_VARS['products_id']);

require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php');

$class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN;

$pad = new $class($products_id);

echo '<tr>

<td>';

echo $pad->draw();

}

else {

$product_internal_model_number_query = tep_db_query("SELECT internal_model_number

FROM stock

WHERE product_id ='" . (int)$HTTP_GET_VARS['products_id'] . "'");

$product_internal_model_number = tep_db_fetch_array($product_internal_model_number_query);

 

// Ce produit n'a pas d'attribut: on affiche le délai de livraison

/* echo '

<tr>

<td class="product-price">' . TEXT_PRODUCT_SHIPPING_TIME . tep_display_product_availability( $product_internal_model_number['internal_model_number'], (int)$product_info['products_availability_id']) . '</td>

</tr>';*/

}

?>

<tr>

<td class="product-price"><?php echo TEXT_PRODUCT_PRICE . $products_price; ?></td>

<tr>

<td class="main"><?php echo tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . tep_draw_hidden_field('products_id', $product_info['products_id']); ?></td>

 

 

 

</table>

 

<!-- bof: Add 2gether (contribution 3929) //-->

<tr>

<td>

<?php

if (MODULE_2GETHER_DISCOUNT_STATUS) {

echo '<tr><td>';

include(DIR_WS_MODULES . '2gether.php');

echo '</td></tr>';

}

?>

</td>

</tr>

<!-- eof: Add 2gether (contribution 3929) //-->

 

<?php

if (tep_not_null($product_info['products_url'])) {

?>

<tr>

<td class="main"><?php echo sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<?php

}

 

if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {

?>

<tr>

<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>

</tr>

<?php

} else {

 

/* LC

<tr>

<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>

</tr>

*/

}

?>

 

 

</table>

 

<tr>

<?php

/* LC

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">

<tr class="infoBoxContents">

<td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

<td class="main"><?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 class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>

<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>

 

 

 

 

</tr>

 

</tr>

</table></td>

</tr>

 

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

 

<tr>

<td>

<?php

/* LC

if ((USE_CACHE == 'true') && empty($SID)) {

echo tep_cache_also_purchased(3600);

} else {

include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);

}

*/

}

 

?>

 

 

</td>

</tr>

</table></form> </td>

<?php

/* <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

 

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

*/

?>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...