Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Error when looking at a product


charmed-imsure

Recommended Posts

Hi,

 

Back again! I've finally managed to resolve most of my issues now after a server move. I have an error that displays though & I don't really understand why this comes up or how to remove it. When you click on a product in the shop, this comes up:

 

Parse error: syntax error, unexpected $end, expecting ')' in E:\domains\j\just-keyrings.co.uk\user\htdocs\includes\modules\also_purchased_products.php on line 31

 

I'm guessing it means/should say.... customers who bought this item also bought blah blah.

 

I've looked at line 31 & it's just blank, there's nothing there. However, I'd rather not have this come up at all if it is supposed to say what I assume it's supposed to say.. Any ideas?

Link to comment
Share on other sites

Just to expand on that, post lines 25 through to line 35 of also_purchased_products.php.

 

A blank line would be of no use :-)

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

<?php

/*

$Id: also_purchased_products.php 1739 2007-12-20 00:52:16Z hpdl $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

if (isset($HTTP_GET_VARS['products_id'])) {

$orders_query = tep_db_query("select p.products_id, p.products_image from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED);

$num_products_ordered = tep_db_num_rows($orders_query);

if ($num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED) {

?>

<!-- also_purchased_products //-->

<?php

$info_box_contents = array();

$info_box_contents[] = array('text' => TEXT_ALSO_PURCHASED_PRODUCTS);

 

new contentBoxHeading($info_box_contents);

 

$row = 0;

$col = 0;

$info_box_contents = array();

while ($orders = tep_db_fetch_array($orders_query)) {

$orders['products_name'] = tep_get_products_name($orders['products_id']);

$info_box_contents[$row][$col] = array('align' => 'center',

Link to comment
Share on other sites

Here is the file you need All of it !

 

<?php
/*
 $Id: also_purchased_products.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 if (isset($HTTP_GET_VARS['products_id'])) {
$orders_query = tep_db_query("select p.products_id, p.products_image from " . TABLE_ORDERS_PRODUCTS . " opa, " . TABLE_ORDERS_PRODUCTS . " opb, " . TABLE_ORDERS . " o, " . TABLE_PRODUCTS . " p where opa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and opa.orders_id = opb.orders_id and opb.products_id != '" . (int)$HTTP_GET_VARS['products_id'] . "' and opb.products_id = p.products_id and opb.orders_id = o.orders_id and p.products_status = '1' group by p.products_id order by o.date_purchased desc limit " . MAX_DISPLAY_ALSO_PURCHASED);
$num_products_ordered = tep_db_num_rows($orders_query);
if ($num_products_ordered >= MIN_DISPLAY_ALSO_PURCHASED) {
?>
<!-- also_purchased_products //-->
<?php
  $info_box_contents = array();
  $info_box_contents[] = array('text' => TEXT_ALSO_PURCHASED_PRODUCTS);

  new contentBoxHeading($info_box_contents);

  $row = 0;
  $col = 0;
  $info_box_contents = array();
  while ($orders = tep_db_fetch_array($orders_query)) {
	$orders['products_name'] = tep_get_products_name($orders['products_id']);
	$info_box_contents[$row][$col] = array('align' => 'center',
										   'params' => 'class="smallText" width="33%" valign="top"',
										   'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $orders['products_image'], $orders['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $orders['products_id']) . '">' . $orders['products_name'] . '</a>');

	$col ++;
	if ($col > 2) {
	  $col = 0;
	  $row ++;
	}
  }

  new contentBox($info_box_contents);
?>
<!-- also_purchased_products_eof //-->
<?php
}
 }
?>

Sometimes you're the dog and sometimes the lamp post

[/url]

My Contributions

Link to comment
Share on other sites

(that was the whole file - is something missing?)

 

 

RESOLVED!

I just realised there must've been something missing off that file so I've just taken the original one that comes with oscommerce & overwritten the one I had, error has now gone...

 

Sorry 'bout that but I suppose it is good to try to learn for yourself too!!! :blush:

 

I don't know why some of my files are like this, I certainly hadn't changed this one myself, I'm guessing it must have been the person I ashamedly paid to make a hash of my site that did this!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...