tedmcdonald Posted October 18, 2005 Share Posted October 18, 2005 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 Quote Link to comment Share on other sites More sharing options...
stab Posted May 13, 2006 Share Posted May 13, 2006 I'm actually wondering about this one myself. Quote Link to comment Share on other sites More sharing options...
insomniac2 Posted May 13, 2006 Share Posted May 13, 2006 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. Quote Link to comment Share on other sites More sharing options...
stab Posted May 14, 2006 Share Posted May 14, 2006 Thanks. I'll look in to it to see what mods I might be able to do... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.