Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need help with this custom code!


Platinum Games

Recommended Posts

hello all i have come accross a little problem while trying to set this up.

 

i need to be able to show a list of items in the customers account, so i created a file called MY_ITEMS

now i need to display the items in a list as what you would in the index as if you were browsing the site.

 

now i have customised the admin to assign products to a customer ID or rather a customer ID to a product now i can't get the items to show on the customised page i created (MY_ITEMS).

 

the page is here:

http://game-shop.platinumgames.com.au/my_items.php

 

USERNAME: [email protected]

PASSWORD:testtest

 

please login and have a look at the page.

 

SITE IS ACTIVE DO NOT BUY ITEMS PLEASE!!!

------------------------------------------------------------------------

 

The problem i am getting is

 

- the page will not show the first item (I HAVE ATTACHED 2 ITEMS BUT ONLY SHOWS 1)

- the page will only echo the image name

- i need to show (Image, Product Name, etc in order to what is on the "MY_ITEMS.php page"

 

<?php


 require('includes/application_top.php');

 if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_MY_ITEMS);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_MY_ITEMS, '', 'SSL'));

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

</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="<?php echo PAGE_WIDTH; ?>" align="center" 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"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
	<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
	  <tr>
		<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
		<td class="pageHeading" align="right"></td>
	  </tr>
	</table></td>
  </tr>
  <tr>
	<td>
	  <table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
	 </tr>
	  </table>
<?php
$products_listed_query = tep_db_query ("select products_id, customers_id, products_image, Products_price, products_date_added, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where customers_id = '" . (int)$customer_id . "' order by products_date_added ASC");
$products_listed = tep_db_fetch_array($products_listed_query, $products_listed);

  if($products_listed) 
	 {
	while ($TempArray = tep_db_fetch_array($products_listed_query, $products_listed))
		 {
		 $listed_image = stripslashes($TempArray['products_image']);
		 $listed_name = stripslashes($TempArray['products_name']);
		 $listed_price = stripslashes($TempArray['products_price']);
		 $listed_date = stripcslashes($TempArray['product_date_added']);
		  $DisplayStr .= $listed_image . ' ' . $listed_name . ' ' . $listed_price . ' ' . $listed_date . '<br />';
		  }
	  echo '<div class=\'members\'>' . $DisplayStr . '</div>';
	//echo $DisplayStr;		

	  }


?>
	  <table border="0" width="100%" cellspacing="1" cellpadding="2" class="productListing-heading">
		<tr class="productListing-heading">
		  <td class="productListing-heading"width="13%"><?php echo HEADING_IMAGE; ?></td>
		  <td class="productListing-heading"width="25%"><?php echo HEADING_NAME; ?></td>
		  <td class="productListing-heading" width="35%"><?php echo HEADING_PRICE; ?></td>
		  <td class="productListing-heading"><?php echo HEADING_DATE; ?></td>
		  <td class="productListing-heading" align="right"></td>
		</tr>
	  </table>
	  <table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
		<tr class="infoBoxContents">
		  <td><table border="0" width="100%" cellspacing="1" cellpadding="2">
								<tr>
							</table></td>
		</tr>
	  </table>
	  <table border="0" width="100%" cellspacing="0" cellpadding="2">
		<tr>
		  <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
		</tr>
	  </table>
	</td>
  </tr>
  <tr>
			<td></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><a href="java script:history.go(-1)"><?php echo tep_image_button('button_back.gif', IMAGE_BUTTON_BACK); ?></a></td>
			<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
		  </tr>
		</table></td>
	  </tr>
	</table></td>
		</tr>
</table></td>
<!-- body_text_eof //-->
<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDT; ?>" 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 //-->
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

running MS2.2

 

any help would be great.

Thanks in advance!

 

Ben

Link to comment
Share on other sites

display items by customer ID?

what about if you have 20000 products?

 

I know that your project is possible, simply I can't see the point...

Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Link to comment
Share on other sites

what about if you have 20000 products?

 

I know that your project is possible, simply I can't see the point...

 

 

my site will be based on selling peoples products, so when a customer sends me an item to list on the site i need then to be able to keep track of the items i have in holding for them.

Thanks in advance!

 

Ben

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...