Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

RMA 2.5e & Customer's Order History


tedmcdonald

Recommended Posts

Firstly, thanks for an excellent, and very necessary contribution. :thumbsup:

 

Question:

 

I am testing this contribution and about to release it to my live store.

 

My test involves a customer clicking on Need to return product? in their Order History page.

 

One thing I notice is that the customer's Order History page does not reflect the fact that an item has been requested returned, nor does it show when a return is completed. Is this correct?

 

It seems that the requested return should display in the customer's Order History, right?

 

Am I missing something? :P

 

Best Regards, Ted

Link to comment
Share on other sites

  • 6 months later...

You are correct. You should have a 'Return Item' Link for each product listed in the customer's order history.

 

Once a customer clicks on a 'Return Item' Link and completes a return product process the link should dissapear from the order history .. so that they cannot return a product more than once and confuse the admin.

 

This is a very complicated mod .. and most of the releases have some bugs or another. Took me a long time to modfy it and clean it up .. but it is working good now. The code is sloppy but works.

 

I have modified the code in my account_history_info.php which may not work for you ... but may give you an idea of what the code should look like. I also added my order statuses for which not to show a 'return link'. See Below.

 

 

<?php

}

 

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

 

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 = '" . (int)$_GET['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 . '<a href="' . tep_href_link(FILENAME_RETURNS_TRACK, 'action=returns_show&rma=' . $rma_result['rma_value'], 'SSL') . '">' . $rma_result['rma_value'] . '</a>';

 

} else {

$return_link = '<img src="images/icons/dot_arrow.gif"> <a href="' . tep_href_link(FILENAME_RETURN, 'order_id=' . (int)$_GET['order_id'] . '&products_id=' . ($order->products[$i]['id']), 'SSL') . '"><b>' . TEXT_RETURN_PRODUCT . '</a></b></font>.';

}

 

// BEGIN LOGIC FOR RETURN LINK MODIFICATION

// You can change this or comment it out as best fits your store configuration

 

// Do not show Product Return Link for the following order statuses ... until orders status is either or Delivered or Complete. All other statuses will show the Return Link, thus allowing them to return products before they have even been Shipped or Payed for. We do not want that to happen.

if ( ($orders_status == '1') OR ($orders_status == '2') OR ($orders_status == '3') OR ($orders_status == '9') OR ($orders_status == '11') OR ($orders_status == '12') OR ($orders_status == '14') OR ($orders_status == '14') OR ($orders_status == '15') ) {

 

$return_link = '';

}

// END LOGIC FOR RETURN LINK MODIFICATION

 

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>';

}

}

 

// BEGIN Product Serial Numbers

if (tep_not_null($order->products[$i]['serial_number'])) echo '<br><small><font color="0000FF">Serial Number</font>: ' . $order->products[$i]['serial_number'] . '<br>';

// END Product Serial Numbers

 

// BEGIN Product Software Numbers

if (tep_not_null($order->products[$i]['software_key'])) echo '<small><font color="0000FF">Software Key</font>: ' . $order->products[$i]['software_key'] . '</i></small><br><small>' . $return_link . '<i>' . $desc['products_description'] . '</i></small><br>';

// END Product Software Numbers

 

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

 

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

echo ' <td class="main" valign="top" align="right" width="20%">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n";

}

 

echo ' <td class="main" align="left" width="23%" 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";

}

?>

 

 

Here are my RMA language defines:

 

define('TEXT_RETURN_PRODUCT','<font color="FF0000">Return Item(s) Page</font>');

define('TEXT_RMA', '<font color="FF0000">Return RMA #</font> ');

 

Hope that gives you an idea.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...