Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding info to customers order Receipt.


Guest

Recommended Posts

I need to add another entry from the customres account, and I need to display the category for each item purchased (I have items named the same, in different categories).

 

Where are these changes made?

 

Thanks in advance.

Link to comment
Share on other sites

  • 3 years later...

I don't want to say anywhere,because I ahve not even yet seen the receipt.

 

Perhaps under each item on the receipt.

 

Can I just add the first 2 categores?

 

For example... car parts.

 

My website is basically categorized as follow:

Acura > Integra 94-01 > Engine Parts

Honda > Civic 92-95 > Suspension

 

The first 2 top categories I want to be shown ont eh receipt. Just the car make and model/year.

 

Thanks! Also, is there away I can add fileds in checkout so customer can note their car year make model, etc?

Link to comment
Share on other sites

This is not so difficult.

 

In /includes/classes/order.php change:

 

	  $products = $cart->get_products();
  for ($i=0, $n=sizeof($products); $i<$n; $i++) {
	$this->products[$index] = array('qty' => $products[$i]['quantity'],
									'name' => $products[$i]['name'],

 

to:

 

 

	  $products = $cart->get_products();
  for ($i=0, $n=sizeof($products); $i<$n; $i++) {
	  $cat_query = tep_db_query("select c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " pc where c.categories_id = pc.categories_id and pc.products_id = '" . $products[$i]['id'] . "' limit 1");
	  while ($cat_result = tep_db_fetch_array($cat_query)) {
	$parent_query = tep_db_query("select cd.categories_name, c.parent_id from " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_CATEGORIES . " c where cd.categories_id = c.categories_id and c.categories_id = '" . $cat_result['parent_id'] . "' limit 1");
	  if (tep_db_num_rows($parent_query) > 0) {
	  while ($parent_result = tep_db_fetch_array($parent_query)) {
	  $parent = $parent_result['categories_name'] . ' - ';
	  $top_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $parent_result['parent_id'] . "' limit 1");
	if (tep_db_num_rows($top_query) > 0) {
	  $top_result = tep_db_fetch_array($top_query);
	  $top = $top_result['categories_name'] . ' - '; 
	} else {
	$top = '';
	}
	  }
	} else {
	$top = '';
	  $parent = '';
	  }
	  }
	$this->products[$index] = array('qty' => $products[$i]['quantity'],
									'name' => $top . $parent . $products[$i]['name'],

 

 

 

Now instead of showing just the products name in orders, it will show:

 

top category>parent category>products name :)

 

It will however only work for two or three category levels

Link to comment
Share on other sites

YOU ARE GOD.

 

Thank you so much!

 

If you have AIM,please IM me: zoomzoomspd6 or pracinginc

 

Love to chat, share ideas... Thanks so much.

 

One more thing. Can I show the model number/part# field as well?

 

Thanks again,

Pathik

Link to comment
Share on other sites

As part of the name?

 

Change:

 

'name' => $top . $parent . $products[$i]['name'],

 

to:

 

 

'name' => $top . $parent . $products[$i]['name'] . ' - ' . $products[$i]['model'],

 

 

Sonia

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...