Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

2gether contrib


itfitz

Recommended Posts

ok, I have the contrib installed, second time around, but now I am getting this error and I cant seem to figure out what is the problem. Probably something small that I am over looking, but here is the error:

 

Parse error: parse error, unexpected '}' in /home/lotions2/public_html/osCommerce1/catalog/admin/includes/boxes/catalog.php on line 35

 

and here is my catalog.php

 

<?php

/*

$Id: catalog.php,v 1.21 2003/07/09 01:18:53 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

?>

<!-- catalog //-->

<tr>

<td>

<?php

$heading = array();

$contents = array();

 

$heading[] = array('text' => BOX_HEADING_CATALOG,

'link' => tep_href_link(FILENAME_CATEGORIES, 'selected_box=catalog'));

 

if ($selected_box == 'catalog') {

$contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_MANUFACTURERS . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_REVIEWS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_REVIEWS . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_SPECIALS . '</a><br>' .

//kgt - discount coupons

'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>'.

'<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_DISCOUNT_COUPONS . '</a>' );

//end kgt - discount coupons

 

'<a href="' . tep_href_link(FILENAME_2GETHER, '', 'NONSSL') . '" class="menuBoxContentLink">' . '2gether specials' . '</a><br>' .

}

 

$box = new box;

echo $box->menuBox($heading, $contents);

?>

</td>

</tr>

<!-- catalog_eof //-->

 

 

then this:

 

ok, I fixed that problem and have now moved on to a new one.

 

I pulled out the } at line 35 and now I get this error:

 

Parse error: parse error, unexpected $ in /home/lotions2/public_html/osCommerce1/catalog/admin/includes/boxes/catalog.php on line 43

 

problem is, there is no line 43.

 

any help would be apreciated.

If it was easy, anyone could do it!

Link to comment
Share on other sites

ok, I have the contrib installed, second time around, but now I am getting this error and I cant seem to figure out what is the problem. Probably something small that I am over looking, but here is the error:

 

Parse error: parse error, unexpected '}' in /home/lotions2/public_html/osCommerce1/catalog/admin/includes/boxes/catalog.php on line 35

 

and here is my catalog.php

 

<?php

/*

$Id: catalog.php,v 1.21 2003/07/09 01:18:53 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

?>

<!-- catalog //-->

<tr>

<td>

<?php

$heading = array();

$contents = array();

 

$heading[] = array('text' => BOX_HEADING_CATALOG,

'link' => tep_href_link(FILENAME_CATEGORIES, 'selected_box=catalog'));

 

if ($selected_box == 'catalog') {

$contents[] = array('text' => '<a href="' . tep_href_link(FILENAME_CATEGORIES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_PRODUCTS_ATTRIBUTES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_CATEGORIES_PRODUCTS_ATTRIBUTES . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_MANUFACTURERS . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_REVIEWS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_REVIEWS . '</a><br>' .

'<a href="' . tep_href_link(FILENAME_SPECIALS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_SPECIALS . '</a><br>' .

//kgt - discount coupons

'<a href="' . tep_href_link(FILENAME_PRODUCTS_EXPECTED, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_PRODUCTS_EXPECTED . '</a><br>'.

'<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_DISCOUNT_COUPONS . '</a>' );

//end kgt - discount coupons

 

'<a href="' . tep_href_link(FILENAME_2GETHER, '', 'NONSSL') . '" class="menuBoxContentLink">' . '2gether specials' . '</a><br>' .

}

 

$box = new box;

echo $box->menuBox($heading, $contents);

?>

</td>

</tr>

<!-- catalog_eof //-->

then this:

 

ok, I fixed that problem and have now moved on to a new one.

 

I pulled out the } at line 35 and now I get this error:

 

Parse error: parse error, unexpected $ in /home/lotions2/public_html/osCommerce1/catalog/admin/includes/boxes/catalog.php on line 43

 

problem is, there is no line 43.

 

any help would be apreciated.

The } definitely belongs where it was.

If I am correct you added the last part wrongly. The ending should read:

'<a href="' . tep_href_link(FILENAME_DISCOUNT_COUPONS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_DISCOUNT_COUPONS . '</a><br>' .

//end kgt - discount coupons

 

'<a href="' . tep_href_link(FILENAME_2GETHER, '', 'NONSSL') . '" class="menuBoxContentLink">' . '2gether specials' . '</a>' );

}

As kgt coupons code is not the last entry anymore you have to amend the code 2gether for that.

Link to comment
Share on other sites

The } definitely belongs where it was.

If I am correct you added the last part wrongly. The ending should read:

 

As kgt coupons code is not the last entry anymore you have to amend the code 2gether for that.

 

 

ok, that solved one problem but created another. I also added the 2 lines to the /includes/filenames.php and database_tables.php files. It says to just add them in the admin/includes, however when it is only there, it gives me a 404 errror when I try to use it in Admin.

 

I have included me product_info.php code as well as the error. this is on the website side, not the admin. there is also an error on the admin side, which I'll put down at the bottom.

 

Parse error: parse error, unexpected '}' in /home/lotions2/public_html/osCommerce1/catalog/product_info.php on line 104

 

 

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

 

// bof: Added Enable / Disable Categories v.1.6.1.1

//Original: $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_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c on p.products_id = p2c.products_id left join " . TABLE_CATEGORIES . " c on p2c.categories_id = c.categories_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd where c.categories_status = '1' and 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 . "'");

//eof: End Added Enable / Disable Categories

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

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

izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le

ft=150')

}

//--></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 border="0" width="100%" cellspacing="3" cellpadding="3">

<tr>

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

<!-- 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, 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, 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> <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'];

}

 

}

?>

 

//DISPLAY PRODUCT WAS ADDED TO WISHLIST IF WISHLIST REDIRECT IS ENABLED

 

if(tep_session_is_registered('wishlist_id')) {

?>

<tr>

<td class="messageStackSuccess"><?php echo PRODUCT_ADDED_TO_WISHLIST; ?></td>

</tr>

<?php

tep_session_unregister('wishlist_id');

}

?>

<tr>

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

<tr>

<td class="pageHeading" valign="top"><?php echo $products_name; ?></td>

<td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td>

</tr>

</table></td>

</tr>

<tr>

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

</tr>

<tr>

<td class="main">

<?php

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

?>

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

<tr>

<td align="center" class="smallText">

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

document.write('<?php echo '<a 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']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>');

//--></script>

<noscript>

<?php echo '<a 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'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>

</noscript>

</td>

</tr>

</table>

<?php

}

?>

<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="2">

<tr>

<td class="main" colspan="2"><?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 class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>

<td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>

</tr>

<?php

}

?>

</table>

<?php

}

?>

</td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></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="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>

</tr>

<tr>

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

</tr>

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

?>

<tr>

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

</tr>

<?php

}

?>

<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 align="center"><?php echo tep_image_submit('button_wishlist.gif', 'Add to Wishlist', 'name="wishlist" value="wishlist"'); ?></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>

</table></td>

</tr>

</table></td>

</tr>

<tr>

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

</tr>

<!-- 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) //-->

<tr>

<td>

<?php

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>

<!-- body_text_eof //-->

<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'); ?>

 

 

 

 

on the admin side:

 

error:

 

Fatal error: Call to undefined function: tep_get_products_image() in /home/lotions2/public_html/osCommerce1/catalog/admin/2gether.php on line 272

 

2gether.php:

 

<?php

require('includes/application_top.php');

 

require(DIR_WS_CLASSES . 'currencies.php');

$currencies = new currencies();

 

$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

 

if (tep_not_null($action)) {

switch ($action) {

case 'setflag':

tep_set_together_status($HTTP_GET_VARS['tid'], $HTTP_GET_VARS['flag']);

tep_redirect(tep_href_link(FILENAME_2GETHER, (isset($HTTP_GET_VARS['page']) ? 'page=' . $HTTP_GET_VARS['page'] . '&' : '') . 'tID=' . $HTTP_GET_VARS['tid'], 'NONSSL'));

break;

case 'insert':

$product1_id = tep_db_prepare_input($HTTP_POST_VARS['product1_id']);

$product2_id = tep_db_prepare_input($HTTP_POST_VARS['product2_id']);

if ($product1_id != $product2_id) {

$discount = tep_db_prepare_input($HTTP_POST_VARS['discount']);

if ($discount == '') $discount = 0;

$type = tep_db_prepare_input($HTTP_POST_VARS['type']);

tep_db_query("insert into " . TABLE_2GETHER . " (product_1_id, product_2_id, discount, type, status) values ('" . (int)$product1_id . "', '" . (int)$product2_id . "', $discount, '" . $type . "', '0')");

}

tep_redirect(tep_href_link(FILENAME_2GETHER, 'page=' . $HTTP_GET_VARS['page']));

break;

case 'update':

$tid = tep_db_prepare_input($HTTP_POST_VARS['tid']);

$discount = tep_db_prepare_input($HTTP_POST_VARS['discount']);

$type = tep_db_prepare_input($HTTP_POST_VARS['type']);

tep_db_query("update " . TABLE_2GETHER . " set discount = '" . tep_db_input($discount) . "', type = '" . tep_db_input($type) . "' where tid = '" . (int)$tid . "'");

tep_redirect(tep_href_link(FILENAME_2GETHER, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tid));

break;

case 'deleteconfirm':

$tid = tep_db_prepare_input($HTTP_GET_VARS['tID']);

tep_db_query("delete from " . TABLE_2GETHER . " where tid = '" . (int)$tid . "'");

tep_redirect(tep_href_link(FILENAME_2GETHER, 'page=' . $HTTP_GET_VARS['page']));

break;

}

}

?>

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

<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">

<script language="javascript" src="includes/general.js"></script>

<?php

if ( ($action == 'new') || ($action == 'edit') ) {

?>

<link rel="stylesheet" type="text/css" href="includes/javascript/calendar.css">

<script language="JavaScript" src="includes/javascript/calendarcode.js"></script>

<?php

}

?>

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">

<div id="popupcalendar" class="text"></div>

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

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

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="1" cellpadding="1" class="columnLeft">

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

</table></td>

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

<tr>

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

<tr>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

<?php

if ( ($action == 'new') || ($action == 'edit') ) {

$form_action = 'insert';

if ( ($action == 'edit') && isset($HTTP_GET_VARS['tID']) ) {

$form_action = 'update';

$together_query = tep_db_query("select tid,

product_1_id as product1_id,

product_2_id as product2_id,

discount,

type,

status

from " . TABLE_2GETHER . "

where tid = '" . (int)$HTTP_GET_VARS['tID'] . "'");

 

$together = tep_db_fetch_array($together_query);

 

$tInfo = new objectInfo($together);

} else {

$tInfo = new objectInfo(array());

 

$excludes_array1 = array();

$exclude_query1 = tep_db_query("select product_1_id from " . TABLE_2GETHER);

while ($excludes1 = tep_db_fetch_array($exclude_query1)) {

$excludes_array1[] = $excludes1['product_1_id'];

}

$excludes_array2 = array();

$exclude_query2 = tep_db_query("select product_2_id from " . TABLE_2GETHER);

while ($excludes2 = tep_db_fetch_array($exclude_query2)) {

$excludes_array2[] = $excludes2['product_2_id'];

}

 

$excludes_array = array_merge($excludes_array1,$excludes_array2);

}

?>

<tr>

<form name="new_together" <?php echo 'action="' . tep_href_link(FILENAME_2GETHER, tep_get_all_get_params(array('action', 'info', 'tID')) . 'action=' . $form_action, 'NONSSL') . '"'; ?> method="post"><?php if ($form_action == 'update') echo tep_draw_hidden_field('tid', $HTTP_GET_VARS['tID']); ?>

<td><br><table border="0" cellspacing="0" cellpadding="2">

<tr>

<td class="main"><?php echo ''; ?> </td>

<td class="main"><?php echo (isset($tInfo->product1_id)) ? $tInfo->product1_id : tep_draw_products_pull_down('product1_id', 'style="font-size:10px"', $excludes_array); ?></td>

<td class="main"><?php echo (isset($tInfo->product2_id)) ? $tInfo->product2_id : tep_draw_products_pull_down('product2_id', 'style="font-size:10px"', $excludes_array); ?></td>

</tr>

<tr>

<td class="main"><?php echo ''; ?> </td>

<td class="main"><?php echo (isset($tInfo->product1_id)) ? tep_get_products_name($tInfo->product1_id) : ''; ?></td>

<td class="main"><?php echo (isset($tInfo->product2_id)) ? tep_get_products_name($tInfo->product2_id) : ''; ?></td>

</tr>

<tr>

<td class="main"><?php echo ''; ?> </td>

<td class="main"><?php echo (isset($tInfo->product1_id)) ? tep_info_image(tep_get_products_image($tInfo->product1_id)) : ''; ?></td>

<td class="main"><?php echo (isset($tInfo->product2_id)) ? tep_info_image(tep_get_products_image($tInfo->product2_id)) : ''; ?></td>

</tr>

<tr>

<td class="main"><?php echo ''; ?> </td>

<td class="main"><?php echo 'Discount: '; ?> </td>

<td class="main"><?php echo tep_draw_input_field('discount', (isset($tInfo->discount) ? $tInfo->discount : '')); ?></td>

</tr>

<?php

$type_array[] = array('id'=>'p','text'=>'Percentage');

$type_array[] = array('id'=>'m','text'=>'Money');

?>

<tr>

<td class="main"><?php echo ''; ?> </td>

<td class="main"><?php echo 'Type: '; ?> </td>

<td class="main"><?php echo tep_draw_pull_down_menu('type', $type_array, $tInfo->type); ?></td>

</tr>

<?php

if ($form_action == 'update') {

$price1 = tep_get_products_price($tInfo->product1_id);

$price2 = tep_get_products_price($tInfo->product2_id);

 

if ($tInfo->type == 'p') {

$saving = ($price1+$price2)*($tInfo->discount/100);

$together_price = ($price1+$price2)-$saving;

} else {

$saving = $tInfo->discount;

$together_price = $price1+$price2-$saving;

}

?>

<tr>

<td class="main"><?php echo ''; ?> </td>

<td class="main"><?php echo 'Together:'; ?> </td>

<td class="main"><?php echo $currencies->format($together_price); ?> </td>

</tr>

<tr>

<td class="main"><?php echo ''; ?> </td>

<td class="main"><?php echo 'You Save:'; ?> </td>

<td class="main"><?php echo $currencies->format($saving); ?> </td>

</tr>

<?php

}

?>

</table></td>

</tr>

<tr>

<td>

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

<tr>

<td class="main" align="right" valign="top"><br><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '   <a href="' . tep_href_link(FILENAME_2GETHER, 'page=' . $HTTP_GET_VARS['page'] . (isset($HTTP_GET_VARS['tID']) ? '&tID=' . $HTTP_GET_VARS['tID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>

</tr>

</table>

</td>

</form>

</tr>

<?php

} else {

?>

<tr>

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

<tr>

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

<tr class="dataTableHeadingRow">

<td class="dataTableHeadingContent"><?php echo 'Product 1'; ?></td>

<td class="dataTableHeadingContent"><?php echo 'Product 2'; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo 'Discount'; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo 'Type'; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>

<td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>

</tr>

<?php

$together_query_raw = "select tid,

product_1_id as product1_id,

product_2_id as product2_id,

discount,

type,

status

from " . TABLE_2GETHER;

$together_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_SEARCH_RESULTS, $together_query_raw, $together_query_numrows);

$together_query = tep_db_query($together_query_raw);

while ($together = tep_db_fetch_array($together_query)) {

if ((!isset($HTTP_GET_VARS['tID']) || (isset($HTTP_GET_VARS['tID']) && ($HTTP_GET_VARS['tID'] == $together['tid']))) && !isset($tInfo)) {

$tInfo = new objectInfo($together);

}

 

if (isset($tInfo) && is_object($tInfo) && ($together['tid'] == $tInfo->tid)) {

echo ' <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_2GETHER, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tInfo->tid . '&action=edit') . '\'">' . "\n";

} else {

echo ' <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_2GETHER, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $together['tid']) . '\'">' . "\n";

}

?>

<td class="dataTableContent"><?php echo $together['product1_id'].'-'.tep_get_products_name($together['product1_id']); ?></td>

<td class="dataTableContent"><?php echo $together['product2_id'].'-'.tep_get_products_name($together['product2_id']); ?></td>

<?php if ($together['type'] == 'p') { ?>

<td class="dataTableContent" align="right"><?php echo $together['discount'].'%'; ?></td>

<?php } else { ?>

<td class="dataTableContent" align="right"><?php echo $currencies->format($together['discount']); ?></td>

<?php } ?>

<td class="dataTableContent" align="right"><?php echo $together['type']; ?></td>

<td class="dataTableContent" align="right">

<?php

if ($together['status'] == '1') {

echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10) . '  <a href="' . tep_href_link(FILENAME_2GETHER, 'action=setflag&flag=0&tid=' . $together['tid'].'&page=' . $HTTP_GET_VARS['page'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_red_light.gif', IMAGE_ICON_STATUS_RED_LIGHT, 10, 10) . '</a>';

} else {

echo '<a href="' . tep_href_link(FILENAME_2GETHER, 'action=setflag&flag=1&tid=' . $together['tid'].'&page=' . $HTTP_GET_VARS['page'], 'NONSSL') . '">' . tep_image(DIR_WS_IMAGES . 'icon_status_green_light.gif', IMAGE_ICON_STATUS_GREEN_LIGHT, 10, 10) . '</a>  ' . tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_RED, 10, 10);

}

?></td>

<td class="dataTableContent" align="right"><?php if (isset($tInfo) && is_object($tInfo) && ($together['tid'] == $tInfo->tid)) { echo tep_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . tep_href_link(FILENAME_2GETHER, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $together['tid']) . '">' . tep_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?> </td>

</tr>

<?php

}

?>

<tr>

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

<tr>

<td class="smallText" valign="top"><?php echo $together_split->display_count($together_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_SPECIALS); ?></td>

<td class="smallText" align="right"><?php echo $together_split->display_links($together_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page']); ?></td>

</tr>

<?php

if (empty($action)) {

?>

<tr>

<td colspan="6" align="right"><?php echo '<a href="' . tep_href_link(FILENAME_2GETHER, 'page=' . $HTTP_GET_VARS['page'] . '&action=new') . '">' . tep_image_button('button_new_product.gif', IMAGE_NEW_PRODUCT) . '</a>'; ?></td>

</tr>

<?php

}

?>

</table></td>

</tr>

</table></td>

<?php

$heading = array();

$contents = array();

 

switch ($action) {

case 'delete':

$heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_SPECIALS . '</b>');

 

$contents = array('form' => tep_draw_form('together', FILENAME_2GETHER, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tInfo->tid . '&action=deleteconfirm'));

$contents[] = array('text' => TEXT_INFO_DELETE_INTRO);

$contents[] = array('text' => '<br><b>' . $tInfo->products1_id . '</b>');

$contents[] = array('align' => 'center', 'text' => '<br>' . tep_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . tep_href_link(FILENAME_2GETHER, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tInfo->tid) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');

break;

default:

if (is_object($tInfo)) {

$price1 = tep_get_products_price($tInfo->product1_id);

$price2 = tep_get_products_price($tInfo->product2_id);

 

$heading[] = array('text' => '<b>' . $tInfo->product1_id . '</b>');

$contents[] = array('text' => '' . tep_info_image(tep_get_products_image($tInfo->product1_id)));

$contents[] = array('text' => tep_get_products_name($tInfo->product1_id));

$contents[] = array('text' => $currencies->format($price1));

 

$contents[] = array('text' => '' . tep_info_image(tep_get_products_image($tInfo->product2_id)));

$contents[] = array('text' => tep_get_products_name($tInfo->product2_id));

$contents[] = array('text' => $currencies->format($price2));

 

if ($tInfo->type == 'p') {

$saving = ($price1+$price2)*($tInfo->discount/100);

$together_price = ($price1+$price2)-$saving;

$contents[] = array('text' => 'Discount: <b>' . $tInfo->discount . '%</b>');

$contents[] = array('text' => 'Type: <b>Percentage</b>');

} else {

$saving = $tInfo->discount;

$together_price = $price1+$price2-$saving;

$contents[] = array('text' => 'Discount: <b>' . $currencies->format($tInfo->discount) . '%</b>');

$contents[] = array('text' => 'Type: <b>Money</b>');

}

if ($tInfo->status == 1) {

$contents[] = array('text' => 'Status: <b>Active</b>');

} else {

$contents[] = array('text' => 'Status: <b>InActive</b>');

}

$contents[] = array('text' => 'Together: ' .$currencies->format($together_price));

$contents[] = array('text' => 'You Save: ' .$currencies->format($saving));

 

 

 

$contents[] = array('align' => 'center', 'text' => '<a href="' . tep_href_link(FILENAME_2GETHER, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tInfo->tid . '&action=edit') . '">' . tep_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . tep_href_link(FILENAME_2GETHER, 'page=' . $HTTP_GET_VARS['page'] . '&tID=' . $tInfo->tid . '&action=delete') . '">' . tep_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');

}

break;

}

if ( (tep_not_null($heading)) && (tep_not_null($contents)) ) {

echo ' <td width="25%" valign="top">' . "\n";

 

$box = new box;

echo $box->infoBox($heading, $contents);

 

echo ' </td>' . "\n";

}

}

?>

</tr>

</table></td>

</tr>

</table></td>

</tr>

</table>

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

</body>

</html>

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

 

 

thanks

If it was easy, anyone could do it!

Link to comment
Share on other sites

think I figured out part of the probelm.

 

I think I may have been editing the wrong product_info.php file. I happened to stumble across the one on the languages/english file. that may be what has caused a lot fo the problem. The contrib is acutally been removed, now I just have to get the wishlist fully funtional the way I want it and then move on to this 2gether contrib.

 

let me know what ya'll think

If it was easy, anyone could do it!

Link to comment
Share on other sites

ok, that solved one problem but created another. I also added the 2 lines to the /includes/filenames.php and database_tables.php files. It says to just add them in the admin/includes, however when it is only there, it gives me a 404 errror when I try to use it in Admin.

 

I have included me product_info.php code as well as the error. this is on the website side, not the admin. there is also an error on the admin side, which I'll put down at the bottom.

 

Parse error: parse error, unexpected '}' in /home/lotions2/public_html/osCommerce1/catalog/product_info.php on line 104

<?php

thanks

It hasn't created another, it just gets to the next one. Can you please show the 104 line, it is a bit difficult to pick that one from the list :-)

 

I suspect it is this one which is related to another contrib (WishList I guess):

?>

//DISPLAY PRODUCT WAS ADDED TO WISHLIST IF WISHLIST REDIRECT IS ENABLED

if(tep_session_is_registered('wishlist_id')) {
?>

which on quick look should read

?>

//DISPLAY PRODUCT WAS ADDED TO WISHLIST IF WISHLIST REDIRECT IS ENABLED
<?php
if(tep_session_is_registered('wishlist_id')) {
?>

or, better,

//DISPLAY PRODUCT WAS ADDED TO WISHLIST IF WISHLIST REDIRECT IS ENABLED

if(tep_session_is_registered('wishlist_id')) {
?>

 

Your admin error clearly says that you are missing a function

Fatal error: Call to undefined function: tep_get_products_image() in /home/lotions2/public_html/osCommerce1/catalog/admin/2gether.php on line 272

which mostly means you have forgotten to add a required function for this contrib to the admin/includes/functions/general.php. Carefully look through the installation instructions, install.txt, and you should read (assuming you picked the latest version)

4) in ADMIN/includes/functions/general.php you add :

 

function tep_set_together_status($tid, $status) {

if ($status == '1') {

return tep_db_query("update " . TABLE_2GETHER . " set status = '1' where tid = '" . (int)$tid . "'");

} elseif ($status == '0') {

return tep_db_query("update " . TABLE_2GETHER . " set status = '0' where tid = '" . (int)$tid . "'");

} else {

return -1;

}

}

 

function tep_get_products_price($product_id) {

$product_query = tep_db_query("select products_price from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");

$product = tep_db_fetch_array($product_query);

return $product['products_price'];

}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...