Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

I'm having trouble installing RMA returns 2.6

 

In particular, the edit to account_history_info.php.

(I also have an attibutes contrib installed)

 

If anyone can share the contents of their file, I'd be very grateful. Or at least the area of the file with the merged code.

 

The instructions are as follows:

 

Find this text: 
<?php

 }



 for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {


Further below is another line (if you haven't customised your install!, otherwise, the first if statement, then the else!)... Note also, that appears more then once in the file:

if (sizeof($order->info['tax_groups']) > 1) {

Replace the text, looking for the corresponding } to the above statement, insert the following, comparing the text below with any other customisations. This is the tricky bit, look carefully at the changes, you'll be able to match the echos somewhere in the file.

// Begin RMA Returns
if ($order->products[$i]['return'] == '1') {
$rma_query_one = tep_db_query("SELECT returns_id FROM " . TABLE_RETURNS_PRODUCTS_DATA . " where products_id = '" . $order->products[$i]['id'] . "' and order_id = '" . $HTTP_GET_VARS['order_id'] . "'");
$rma_query = tep_db_fetch_array($rma_query_one);
$rma_number_query = tep_db_query("SELECT rma_value FROM " . TABLE_RETURNS . " where returns_id = '" . $rma_query['returns_id'] . "'");
$rma_result = tep_db_fetch_array($rma_number_query);

$return_link = '<b>' . TEXT_RMA . ' # <u><a href="' . tep_href_link(FILENAME_RETURNS_TRACK, 'action=returns_show&rma=' . $rma_result['rma_value'], 'NONSSL') . '">' . $rma_result['rma_value'] . '</a></u></b>';
} else {
$return_link = '<a href="' . tep_href_link(FILENAME_RETURN, 'order_id=' . $HTTP_GET_VARS['order_id'] . '&products_id=' . ($order->products[$i]['id']), 'NONSSL') . '"><b><u>' . TEXT_RETURN_PRODUCT .'</a></u></b>';
}
// Don't show Return link if order is still pending or processing
// You can change this or comment it out as best fits your store configuration
// My first contribution to anything open source, a bug fix to a long running RMA system. These were the changes I had to make to get it to work with a 2.2MS2 install.

if (($orders_status == '1') OR ($orders_status == '2') ) {
$return_link = '';
}
echo '		  <tr>' . "\n" .
	 '			<td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
	 '			<td class="main" valign="top">' . $order->products[$i]['name'];
if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
  for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
	echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
  }
}
echo $return_link;
// JLM: End RMA Returns

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

 

 

The relevant area in my file is:

 

<?php 
 }

 for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
echo '		  <tr>' . "\n" .
	 '			<td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" .
	 '			<td class="main" valign="top">' . $order->products[$i]['name'];

if ( (isset($order->products[$i]['attributes'])) && (sizeof($order->products[$i]['attributes']) > 0) ) {
  for ($j=0, $n2=sizeof($order->products[$i]['attributes']); $j<$n2; $j++) {
	echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
  }
}

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

if (sizeof($order->info['tax_groups']) > 1) {
  echo '			<td class="main" valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n";
}

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

Read the forum rules...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...