Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

RMA Returns error for 2.2 MS2


Guest

Recommended Posts

Cathy - did you come along with my fixes ? I've not been working on the RMA System in therms of recoding because everything is just fine at the moment - I got no error left.

 

As written before - I am on the ccgv v510b to get them cooperating ... and I'm nearly there. You can set up vouchers with the RMA system an send them to your customer using ccgv ...

 

But of course - I've got one issue left to work on ... :(

 

Sebastian

Link to comment
Share on other sites

Can some1 please help!!????

 

When I click on the Track A Return link at the left box..it kept taking me to the login page, even thou I logged in already. I used the code from aobve but its gettin worst...can some 1 please supply the working "returns_track.php". If possible please e-mail to [email protected]....

Link to comment
Share on other sites

I am using "RMA_return_2.2d", everything works fine. The only problem is:

 

When I logged into account_history_info.php, I clicked the red words "return", got a error message file 404 file not found, the url for this error message is:

 

http://XXXXXX/FILENAME_RETURN?order_id=5001&products_id=75

 

 

Did the contribution missed define: FILENAME_RETURN at somewhere or I missed something?

 

Thank you.

Link to comment
Share on other sites

Hi again,

 

I am sorry if my posted returns_track.php is not working on your system. I am using a heavy modified installation and you can't just use my whole file :(

 

But a tried to do my very best an here's the code of the whole file which should work - BACKUP your existing returns_track.php and give this one a try :

 

<?php
/*
 $id author Puddled Internet - http://www.puddled.co.uk
 email [email protected]
 
 modified by sebastian krupp
 [email protected]
 
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');
     if (!tep_session_is_registered('customer_id')) {
   $navigation->set_snapshot();
   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 if (!$HTTP_GET_VARS['action']){
     $HTTP_GET_VARS['action'] = 'returns_track';
 }
 if ($HTTP_GET_VARS['action']) {
   switch ($HTTP_GET_VARS['action']) {
   case 'returns_show':

      // first carry out a query on the database to see if there are any matching tickets
      $database_returns_query = tep_db_query("SELECT returns_id FROM " . TABLE_RETURNS . " where customers_id = '" . $customer_id . "' and rma_value = '" . $HTTP_POST_VARS['rma'] . "' or rma_value = '" . $HTTP_GET_VARS['rma'] . "'");
      if (!tep_db_num_rows($database_returns_query)) {
          tep_redirect(tep_href_link('returns_track.php?error=yes'));
      } else {
         $returns_query = tep_db_fetch_array($database_returns_query);
         $returns_id = $returns_query['returns_id'];
         $returned_products_query = tep_db_query("SELECT * FROM " . TABLE_RETURNS_PRODUCTS_DATA . " op, " . TABLE_RETURNS . " o where o.returns_id = op.returns_id and op.returns_id = '" . $returns_id . "'");
         $returned_products = tep_db_fetch_array($returned_products_query);

             require(DIR_WS_CLASSES . 'order.php');
          $order = new order($returned_products['order_id']);

      }

   break;

}
}

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_RETURN);
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_RETURNS_TRACK);
 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_RETURN, '', 'NONSSL'));
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<base href="<?php echo (getenv('HTTPS') == 'on' ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- body //-->
<table border="0" width="100%" cellspacing="3" cellpadding="3">
 <tr>
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- left_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
<!-- left_navigation_eof //-->
   </table></td>
<!-- body_text //-->
   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
           <td align="right"> </td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>

  <?php
  if ($HTTP_GET_VARS['action'] == 'returns_show') {
  ?>

     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
   <?php include(DIR_WS_MODULES . 'returns_track.php'); ?>   
 </table></td>
  </tr>     

  <?php      
  } else {
  ?>
     <tr>
       <td width="100%" valign="top">
   <table border="0" width="100%" cellspacing="0" cellpadding="2">
	 <form name="track" method="post" action=" <?php echo tep_href_link(FILENAME_RETURNS_TRACK, 'action=returns_show', 'SSL'); ?>">
     <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="5" class="infoBox">
   <?php
     if (isset($error)=='yes') {
   ?>
   <tr class="infoBoxContents">
     <td colspan="3" class="main"><div align="justify"><?php echo TEXT_TRACK_DETAILS_1; ?></div></td>
   <tr>
   <tr>
     <td colspan="3" class="main" width="100%"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
   </tr>
   <?php
     }
   ?>
   <tr class="infoBoxContents" align="left"> 
                 <td colspan="3" class="main"><?php echo TEXT_TRACK_DETAILS_2; ?></td>
               </tr>
   <tr class="infoBoxContents">
     <td width="100%" colspan="3" class="main"> </td>
   </tr>
   <tr class="infoBoxContents">
     <td width="50%" height="30" align="right" class="main"><?php echo TEXT_YOUR_RMA_NUMBER; ?> </td>
     <td width="50%" height="30" align="left" class="main" colspan="2"><font color="CC0000"><input type="text" name="rma" value="" size="20"></font></td>
   </tr>
   <tr class="infoBoxContents">
     <td width="100%" colspan="3" class="main"> </td>
   </tr>
    </table></td>
	 </tr>
	 <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
               <tr>
              <td width="100%" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE, 'SSL'); ?></td>
   </tr>
    </table></td>	
           </tr>
        </form>
      </table></td>
   </tr>
  <?
 }
  ?>
   </table></td>
<!-- body_text_eof //-->
   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
<!-- right_navigation //-->
<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
<!-- right_navigation_eof //-->
   </table></td>
 </tr>
</table>
<!-- body_eof //-->

<!-- footer //-->
<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
<!-- footer_eof //-->
<br>
</body>
</html>
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

It looks fine on a basic osCom installation which I just did ...

 

Sebastian

 

P.S. even this file will bring you back to the login page IF you type in a NOT existing RMA number - but if you log in again (system is counterchecking) you will have the correct message on screen stating that there is NO RMA with this number.

 

IF yout type in a existing RMA number - you will see your RMA on screen. So you should get a RMA number first to test it !

Link to comment
Share on other sites

I have installed the RMA Returns System 2.2d.

 

But I don't understand how it works. I can only see the RMA tracking link for the customer.

 

How does a customer request for an RMA No.?

How do we receive it ?

I installed the same version of RMA.

 

As per my understanding, customer will log into their account, in the history, if they click the red "refund", the system will automatically issue a RMA # to the customer.

 

Once the customer filed a refund, you - as a admin will received in your admin panel. You can not work on RMA untill customer file for refund.

 

I did not get my RMA system works yet. Let me know if I am wrong.

 

By the way, my problem is when customer click the red "refund", it give me an error message said "404 file not found". The URL of the error message shows the FILENAME_REFUND did not been defined? anybody could give me some help on this?

Link to comment
Share on other sites

Did you check if there is a filename like 'FILENAME_REFUND' defined in includes/filenames.php ?

 

I wonder because on my system the refund text a customer can click on in file account_history_info.php is calling FILENAME_RETURN :huh:

 

This is how it is defined:

 

define('FILENAME_RETURN', 'return_product.php');

 

 

Sebastian

Link to comment
Share on other sites

define('FILENAME_RETURN', 'return_product.php');

Thank you for your advise. I have define the FILENAME_RETURN in the filename.php and it works.

 

It display the file but still have some error message.

 

Would you mind open up a PM with me? I will send the related info to you.

Link to comment
Share on other sites

Ok...I found my errors and it has to do with the database being reworked for some reason and other files. When I did the 2.2d version I used the German guys folder, and I'm not sure if that is where the manipulation came in for German use or not.

 

But, what I've done is uploaded a clean osCommerce and used my 2.2b version and all went smoothly. So, now I will do the test corrections "doing" and the others have stated on typo's and such and see how it works out. Corrected the FILEANMES_DEFAULT that was stated previously and nothing bad happened LOL....so, I'll continue on from there.

 

Hopefully, by tomorrow there will be a clean updated version using a clean upload of files with no other contributions added.

 

Now, let me go so I can work on "doings" fixes and the rest!

 

BBS!!!

Link to comment
Share on other sites

doing: Everything went smooth with your fixes except for the part in the returns_track.php where you used the Continue button as the submit. I got a parse error on line 147 on a clean returns_track.php.

 

That line is:

 

td width="100%" align="right"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE, 'SSL'); ?></td>

 

I can't seem to figure out the parse!!!

 

Other than that its ready for an upload, I just put back in the Track Return line instead. Tomorrow I will transfer over the clean files from a clean osCommerce (no other contributions exist), and I'll try to put further instructions on how it operates. Right now...I'm bushed!!!

Edited by only2empires
Link to comment
Share on other sites

Updated 2.2e version with fixes from doing, Steve, IceTheNet and others.

 

For some reason, the 2.2d version was causing errors even when I did them after I updated the contribution. I had used the 2.2c.zip to update and I'm thinking those were German updates. So, I used my last known 2.2b version and did the fixes to that and is back to working smoothly on the English side now.

 

http://www.oscommerce.com/community/contributions,1136

 

doing is probably still working on the Gift Voucher side of this, so not sure if working properly yet. How's it coming doing???

Link to comment
Share on other sites

Hi Cathy,

 

Yipee! I've downloaded the lastest update and now everything is working correctly. The quantity, products description and price is showing up in account_history_info.php. Thanks for all your help!

 

Thank you,

StrictlyPC :D

Link to comment
Share on other sites

I did not have time to go on with die gv part of the RMA system, cathy - but I will post any news as soon as I've got them ;-)

 

I had a quick look into my version of retuns_track.php but I can't reproduce the error you quoted - lines 145 - 147 should read

 

<?php
}
?>

 

if you are using my version of the complete file. On a clean new installation everything works fine with this code.

 

Keep on posting ...

 

Sebastian

 

 

P.S. You are right - version 2.2c IS buggy - all my fixes are based on your 2.2b rollout ! :)

Edited by doing
Link to comment
Share on other sites

I noticed that there is the possibility to send a gift voucher to the customer sending in a return. By checking the 'refunded by gift voucher' box there is a voucher sent to the customer and an entry made in the table gv_tracking which came with the RMA System. But there is no way or admin page to find out what happend to these vouchers sent.

 

If you got RMA 2.2b (with my fixes) or 2.2e (hope so but did not try it) AND ccgv 5.10 working on your System you may try this AFTER backing up your admin/retuns.php file:

 

 

1.) Open up returns.php and search for

 

 ?require(DIR_WS_CLASSES . 'currencies.php');
?$currencies = new currencies();
?include(DIR_WS_LANGUAGES . $language . '/' . 'returns.php');
?$orders_statuses = array();
?$orders_status_array = array();
?$orders_status_query = tep_db_query("select returns_status_id, returns_status_name from " . TABLE_RETURNS_STATUS . " where language_id = '" . $languages_id . "'");
?while ($orders_status = tep_db_fetch_array($orders_status_query)) {
? ?$orders_statuses[] = array('id' => $orders_status['returns_status_id'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'text' => $orders_status['returns_status_name']);
? ?$orders_status_array[$orders_status['returns_status_id']] = $orders_status['returns_status_name'];
?}

 

it's right at the top - after it insert this code :

 

 ?//language query
?$languages = tep_get_languages();
?$languages_array = array();
?$languages_selected = DEFAULT_LANGUAGE;
?for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
? ?$languages_array[] = array('id' => $languages[$i]['code'],
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 'text' => $languages[$i]['name']);
? ?if ($languages[$i]['directory'] == $language) {
? ? ?$languages_selected = $languages[$i]['code'];
? ?}
?}

 

 

2.) search for :

 

 ? ? ? ? ?$payment_method_query = tep_db_query("SELECT refund_method_name FROM " . TABLE_REFUND_METHOD . " where refund_method_id = '" . $HTTP_POST_VARS['department'] . "'");

 

and replace it with :

 

 ? ? ? ? ?$payment_method_query = tep_db_query("SELECT refund_method_name FROM " . TABLE_REFUND_METHOD . " where refund_method_id = '" . $HTTP_POST_VARS['department'] . "' and language_id = '" . $languages_id . "'");

 

 

3.) search for :

 

 ? ? ?if ($HTTP_POST_VARS['gv_refund'] == 'on') {
? ? ? ? ?include('includes/languages/english/gv_mail.php');
? ? ? ? ?$refund_amount_query = tep_db_query("select r.refund_payment_value, m.customers_email_address, m.customers_name FROM " . TABLE_RETURN_PAYMENTS . " r, " . TABLE_RETURNS . " m where m.returns_id = r.returns_id and r.returns_id = '" . $oID . "'");

 

and replace it with :

 

 ? ? ?if ($HTTP_POST_VARS['gv_refund'] == 'on' && $HTTP_POST_VARS['complete'] == 'on') {
include(DIR_WS_LANGUAGES . $language . '/' . 'gv_mail.php');
$refund_amount_query = tep_db_query("select r.refund_payment_value, m.customers_email_address, m.customers_name, m.customers_id FROM " . TABLE_RETURN_PAYMENTS . " r, " . TABLE_RETURNS . " m where m.returns_id = r.returns_id and r.returns_id = '" . $oID . "'");

 

 

4.) search for :

 

 ? ? ?$address = $refund_amount['customers_email_address'];

 

and in the next line, insert this code :

 

 ? ?//additional query for ccGV System
? ? ? $gv_name_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_email_address = '" . $refund_amount['customers_email_address'] . "'");
? ?$gv_name = tep_db_fetch_array($gv_name_query); ? 
? ?$firstname = $gv_name['customers_firstname'];
? ?$lastname = $gv_name['customers_lastname'];
? ?$customer = $refund_amount['customers_id'];

 

 

5.) search for:

 

 ? ? ? ? ?$gv_query=tep_db_query("insert into gv_tracking (gv_number, date_created, customer_id_sent, sent_firstname, sent_surname, emailed_to, gv_amount) values ('".$id1."', NOW(),'0','Sent by','Admin','".$address."','".$refund."')");

 

and replace it with :

 

 ? ?$gv_query=tep_db_query("insert into gv_tracking (gv_number, date_created, customer_id_sent, sent_firstname, sent_surname, emailed_to, gv_amount) values ('".$id1."', NOW(),'" . $customer . "','Sent by','Admin','" . $address . "','" . $refund . "')");

? ?//update the coupon table of ccGV System
?	$gv_insert_query = tep_db_query ("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $id1 . "', 'G', '" . $refund . "', now())");
?	$insert_id = tep_db_insert_id($insert_query);
? ?//update the coupon email track table of the ccgv system
?	$gv_insert_query = tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, sent_lastname, emailed_to, date_sent) values ('" . $insert_id . "','" . $customer . "','" . $firstname . "','" . $lastname . "','" . $address . "', now() )");

 

finished ... :)

 

 

What is happening ?

 

There will be additional entries in ccgv's tables coupon and coupon_email_tack WHEN finishing an RMA (complete this return checkbox enabled) AND doing this refund with a voucher (refunded by gift voucher checkbox enabled).

 

You will have this voucher sent by the RMA System on your CCGV adminscreen if you surf to ccgv's gv_sent.php page and there will be some data about this voucher ... if it was used (and by which ip adress - gv routines) or not ;-)

 

Sebastian

Edited by doing
Link to comment
Share on other sites

Suggestion for the next update- just wondered if it would be possible to have this include product attributes. Im creating a computer store so alot of my products have options to upgrade components which increases the base price of the product depending on what options are selected. At the moment if i return a product it refunds at the base price without the added option prices included. Just an idea ;)

Link to comment
Share on other sites

Sebastian: I'll add your GV fixes to my clean oscommerce tomorrow and let you know what happens. I don't have the GV contribution installed so I can't really test it, but I can see if any errors pop up in the admin or customer side.

 

As for the adding attributes to this.....that's someone else's ballgame. I would have no clue what to do with that.

Link to comment
Share on other sites

Cathy : If you don't have ccGV installed you will have errors because the code now does additional entries to two of ccGV's tables (coupon and coupon_email_tack). So this mod will NOT work without ccGV !!

 

Martin : Since I am operating my shop without any options but with master products (and assigned slaves as options to the master) I don't have any problem in returning a single 'option' (slave) out of the whole order.

 

Sebastian

Link to comment
Share on other sites

Ok, so maybe I can take the 2.2e version, copy it, add those GV fixes in and make it a total separate contribution by leaving out the GV database upload on the regular one for people that don't have GV installed.

 

Does that make sense? And then you can handle the errors on that one if any pop up LOL :D

Edited by only2empires
Link to comment
Share on other sites

What about editing the file for the next release and comment out the ccGV blocks like this:

 

Step 4.)

 

/*
  //additional query for ccGV System
  $gv_name_query = tep_db_query("select customers_firstname, customers_lastname from " . TABLE_CUSTOMERS . " where customers_email_address = '" . $refund_amount['customers_email_address'] . "'");
  $gv_name = tep_db_fetch_array($gv_name_query);   
  $firstname = $gv_name['customers_firstname'];
  $lastname = $gv_name['customers_lastname'];
  $customer = $refund_amount['customers_id'];
*/

 

Step 5.)

 

   $gv_query=tep_db_query("insert into gv_tracking (gv_number, date_created, customer_id_sent, sent_firstname, sent_surname, emailed_to, gv_amount) values ('".$id1."', NOW(),'" . $customer . "','Sent by','Admin','" . $address . "','" . $refund . "')");

/* 
  //update the coupon table of ccGV System
 $gv_insert_query = tep_db_query ("insert into " . TABLE_COUPONS . " (coupon_code, coupon_type, coupon_amount, date_created) values ('" . $id1 . "', 'G', '" . $refund . "', now())");
 $insert_id = tep_db_insert_id($insert_query);
  //update the coupon email track table of the ccgv system
 $gv_insert_query = tep_db_query("insert into " . TABLE_COUPON_EMAIL_TRACK . " (coupon_id, customer_id_sent, sent_firstname, sent_lastname, emailed_to, date_sent) values ('" . $insert_id . "','" . $customer . "','" . $firstname . "','" . $lastname . "','" . $address . "', now() )");
*/

 

 

Then the file should be OK without ccGV installed. All other changes in the code are entries to table gv_tracking of the RMA system.

 

Sebastian

Link to comment
Share on other sites

I was shocked when I had a look at the 'manual' with all 99 steps for a complete installation on a system with modifications in. But it is not that hard to do ...

 

If you've got a backup of your files (your existing setup) and you use a program like WinMerge for doing the changes on your files (or to find out what is different) it should work out fine. Take a closer look at these 99 steps - most of them are just copying NEW files into your system - the rest of them (changes) is documented in a really good way (look for: // ICW CREDIT CLASS Gift Voucher Addition).

 

It took me about 2-3 hours to figure out everything ... and your're welcome with questions ;-)

 

Sebastian

 

 

P.S. I've got RMA2.2e (or f?) and ccGV 5.10 installed and both of them runnig 100% with 'downloads disabled' - the only problem left is if you enable downloads in the admin area. Hope Strider will answer on my posting but this problem may only be present if you've got B2B suite installed too ... :rolleyes:

Link to comment
Share on other sites

Hi Sebastian & Cathy,

 

I have downloaded and installed RMA 2.2e and everything seems to be working on the catalog side. However, when I go into admin and try to edit the Returned Products, It will not give me the option to complete the RMA. I don't know if it has to do with the SQL or the returns.php file itself. Also, it won't even display the comment bar. In fact, all it would show is:

 

Returns Comments:  

Status:  

Customers Preference Gift Vouchers 
Refund Method:  
Refund Ref #:  
Refund Amount: $90.00 
Refund Date:

 

Everything listed above is hard coded and cannot be edited. I have also updated the RMA module with the Gift Voucher function by Sebastian, but I don't think that is the problem. Any idea what the problem would be?

 

Thanks,

David

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