Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Adding a link to the products in users order history.


Guest

Recommended Posts

Good evening,

 

Right what i am looking for / looking to do is on the user area's page: /account_history_info.php?order_id=#### (the '#' been the order number)

 

we have the product details prices codes etc, looks like:

 

Products Model Unit Total

1 x (TOMY) Starlight Dreamshow 18798 £9.74 £9.74

Sub-Total: £9.74

Royal Mail 1st Class Recorded (Signature On Delivery, takes 1-2 days.): £3.40

Total: £13.14

 

Well the product name is just text '(TOMY) Starlight Dreamshow' i am trying to get that to be a link to the particular product in hand. And the Model code / number to also be a link to the product.

 

Click here to view our store website.

 

 

below code from my file account_history_info.php the part where the above order table is coded in.

 

				<td align="center">
			<table border="0" width="99%" cellspacing="0" cellpadding="2">
     			<tr class="product_infobox_heading_row">
       				<td class="product_infobox_heading" colspan="2"> <font color="#000000"><?php echo HEADING_PRODUCTS; ?></font></td>
       				<td WIDTH="80" class="product_infobox_heading"><font color="#000000"><?php echo HEADING_MODEL; ?></font></td>
       				<td WIDTH="80" class="product_infobox_heading" align="right"><font color="#000000"><?php echo HEADING_UNIT; ?></font></td>
       				<TD WIDTH="80" ALIGN="right" CLASS="product_infobox_heading"><font color="#000000"><?php echo HEADING_TOTAL; ?></font> </TD>
     			</tr>
<?php
   for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
	echo '      <tr class="product_infobox_data_row">' . "\n" .
	     '        <td class="product_infobox_data" valign="top" align="right">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
	     '        <td class="product_infobox_data" valign="top">' . $order->products[$i]['name'];

     if (isset($order->products[$i]['attributes']) && (($k = sizeof($order->products[$i]['attributes'])) > 0)) {
       for ($j = 0; $j < $k; $j++) {
         echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
         if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
         echo '</i></small></nobr>';
       }
     }

     echo '      				</td>' . "\n" .
          '      				<td WIDTH="80" class="product_infobox_data" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n";
     echo '      				<td WIDTH="80" class="product_infobox_data" align="right" valign="top">' . $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" .
          '      				<td WIDTH="80" class="product_infobox_data" align="right" valign="top"><b>' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ' </b></td>' . "\n";
     echo '      			</tr>' . "\n";
   }
?>

 

 

Thanks all the help!

Regards

Link to comment
Share on other sites

In account_history_info.php try replacing this:

 

' <td class="product_infobox_data" valign="top">' . $order->products[$i]['name'];

 

With this:

 

' <td class="main" valign="top">' . '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . ($order->products[$i]['id']), 'NONSSL') . '">' . $order->products[$i]['name'] . '</a>';

Link to comment
Share on other sites

Fantastic that one worked, i adapterid the code for the model number too:

 

account_history_info.php

 

This:

 

<td WIDTH="80" class="product_infobox_data" valign="top">' . $order->products[$i]['model'] . '</td>' . "\n";

 

Replaced with:

 

<td WIDTH="80" class="product_infobox_data" valign="top">' .' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . ($order->products[$i]['id']), 'NONSSL') . '">' . $order->products[$i]['model'] . '</td>' . "\n" . '</a>';

 

just for the use of others.

 

Cheers for the help dave!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...