Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Guest

RMA Returns error for 2.2 MS2

Recommended Posts

Guest

got the basic operation going.

but have some problems

first,, with RMA Tracker.

it brings up the page to put the RMA number in,, when clicked it goes to a login screen,, <even though was logged in to begin with> put in login information, click,, and it goes back to the login screen, put in login info, and then it goes on but gives an error msg saying details do not match records.

 

then,, when requesting a RMA number.

the page with the info comes up, but has a $0 amount.

when u put in the details, and click to continue, it goes to a login page,

<even though they were logged in to begin with>

then procedes on to give a RMA number.

 

then,, the last problem,, is on the admin side,,,

when you open a RMA request,, there are like 4 preset message buttons, when clicked, they do not show the correct msg,,

 

Any thoughts on any of this.

 

I did find where someone else had said to replace two lines to fix the tracker login issue, but when I tried this, I got a parse error,

 

Anyone have a fix for these issues please

 

 

Thanks in advance

Regards

Tom

Share this post


Link to post
Share on other sites

Hi all,

 

Where is this file:

 

Admin and Catalog/return_confirm.php file?

 

The file is listed in the Admin and Catalog/includes/application_top_refund.php file, but it did not come with the .zip file I downloaded. :blink:

 

Also,

 

In admin/returns.php

 

find:

 

returtns_id

 

change to:

 

returns_id

 

 

Thanks in advance!


Running osC - 2.2MS2. P.S. Please don't ask for a link to my site, it is on a production server and not available for the general public, yet!

Share this post


Link to post
Share on other sites

I noticed most of this issues also but some were corrected with all your fixes. The only problem that i'm having, which is similar to the undefined funtion error stated earlier, is that i get that message for all the return php pages under my admin area. If i try to view the return reasons area i get an undefined funtions:tep_get_return_reason_name. This happens with the method, and status pages also, but of course. What could that be and were can i define these functions?

Share this post


Link to post
Share on other sites

The return_confirm.php is not called in ANY of the admin files so its safe to say that the line can be deleted. The contrib maker may have had a purpose for it and then built the function into another page.

Share this post


Link to post
Share on other sites

Hi defender39,

 

Thanks for the reply.

 

I'll give the mod a try then. :)


Running osC - 2.2MS2. P.S. Please don't ask for a link to my site, it is on a production server and not available for the general public, yet!

Share this post


Link to post
Share on other sites

After weeks of tampering it is finally working for my standards. Thanks to the forums the majority of the issued were corrected and others were fixed from just searching all variables.

Share this post


Link to post
Share on other sites

Hi,

 

I'm seeing this code in my admin section:

 

TEXT_DISPLAY_NUMBER_OF_TICKET_STATUS

 

Does anyone know what is causing this?

 

I could not find any define statement for this in the language files. :huh:


Running osC - 2.2MS2. P.S. Please don't ask for a link to my site, it is on a production server and not available for the general public, yet!

Share this post


Link to post
Share on other sites

I ran into the same problem. If you look in return_product.php under catalog/includes/languages/english/ there is a define statement which is similar to the one being dipsplayed on the admin pages.

 

It read:

define('TEXT_DISPLAY_NUMBER_OF_TICKETS_STATUS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> tickets)');

 

So i changed it to

define('TEXT_DISPLAY_NUMBER_OF_TICKETS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> tickets)');

 

It doesn't display the variables but it removed the comment from my admin pages, until i decided to just remove it from my admins pages because i had no real use for it.

Share this post


Link to post
Share on other sites
Guest

Hello

 

with regards to the following code:

 

define('TEXT_DISPLAY_NUMBER_OF_TICKETS_STATUS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> tickets)');

 

you need to ADD that define into your catalog/admin/includes/languages/english.php file:

 

Find:

 

define('TEXT_DISPLAY_NUMBER_OF_ZONES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> zones)');

 

add below:

 

define('TEXT_DISPLAY_NUMBER_OF_TICKETS_STATUS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> tickets)');

 

That just basically displays the item or menu number you are on.

 

Has anyone actually got RMA working "fully" on MS2. I have got it functioning on admin side. However, on customer side I can get the request RMA (basically from account_history_info.php) to work. However, I cannot get the track a return to work at all. It just displays "no record found." I did give up but I now have a new will to sort it out. If anyone wants to help please let me know!

 

Regards

 

Jiten

Share this post


Link to post
Share on other sites

The problem i had was that the contribution would not generate an RMA at random for the customer. It would give and an error on line 39 on the return_product.php page. Looks like the code is suppose to generate an RMA random number with characters and digits. I tried everything possible and the only way i was able to do this was by commenting out the desired output an adding the following code to return_product.php. I just defined a different value for $rma_value. It will create a random digit without characters.

 

$minumum = '0';
$maximum = '999999';
$randnum = rand($minimum,$maximum);
$rma_value = tep_db_prepare_input($randnum);

 

This will generate a random number from 0-999999. Add this code in return_product.php in catalog/, right under where is says

// carry out a query on all the existing orders tables, to get the required information

 

Comment out:

$rma_create = tep_create_rma_value(11);

Since you will be using the $rma_value from above.

 

Then about line 52 comment out

 

$rma_value = tep_db_prepare_input($rma_create);

 

This worked for me, maybe it will work for you. Good luck.

Share this post


Link to post
Share on other sites
Guest

Hello Dmarre

 

I do not have a problem with the RMA number generation - though thank you for the fix!

 

My errors are on the customer side:

 

1. On return_product.php - when a customer returns a product and enters a greater quantitiy that he ordered nothing happens! HOWEVER, there should be an error message at the top of the screen stating that a greater quantity was entered (I know this because I have a fully working version on MS1).

 

2. When requesting or checking the status of a return I get redirected to the login page. HOWEVER I have managed to sort this error out in the following way - if anyone can forsee any problems with this (particularly with regards to security please let me know!):

 

catalog/account_history_info.php

 

change:

 

$return_link = '<font color=blue><b>Return # <a href="returns_track.php?action=returns_show&rma=' . $rma_result['rma_value'] . '">' . $rma_result['rma_value'] . '</a>';

 

to:

 

$return_link = '<font color=blue><b>Return # <a href="' . tep_href_link('returns_track.php', 'action=returns_show&rma=' . $rma_result['rma_value'], 'SSL') . '">' . $rma_result['rma_value'] . '</a>';

 

THEN in catalog/return_product.php change:

 

 if (!tep_session_is_registered('customer_id')) {
    $navigation->set_snapshot();
    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 

to:

 

/*  
   if (!tep_session_is_registered('customer_id')) {
    $navigation->set_snapshot();
    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }
*/

 

Basically you are just commenting out the redirect to the login page. This may have security issues - maybe?!

 

3. I cannot track a return at all! When you enter a number and click on "Find return" , first I get redirected to the login page - which I tried to eliminate by the same commenting out process above - next I get told that the return cannot be found!

 

I have tried the method suggested by Max Gabrowski:

 

on around line 138 I changed

 

$returns  = '<form action="' . $PHP_SELF . '?action=returns_show" method=post>';

 

to this

 

$returns  = tep_draw_form('rma_find', tep_href_link(BOX_RMA_SEARCH_RESULTS, '', 'NONSSL', false), 'get');

$returns .= tep_hide_session_id();

 

and at around line 31 I changed

 

tep_redirect(tep_href_link('returns_track.php?error=yes'));

 

to this

 

tep_redirect(tep_href_link('returns_track.php', '', 'SSL').'&error=yes');

 

But that just gives a parse error because the rest of the form cannot be generated as it does not fall into the ' (appostrophe).

 

It is definately the following line that needs to be changed:

 

$returns = '<form action="' . $PHP_SELF . '?action=returns_show" method=post>

 

Maybe it can be changed to use the tep_href_link function? But my php skills are crap and everything I try gives errors.

 

Anyone got any ideas? Or good PHP skills! :blink:

 

We're close to get it fully working - let's just hope we can pool something together!

 

Regards,

 

Jiten

Share this post


Link to post
Share on other sites

Hi Unified and dmarre,

 

Thanks for the replies and the "missing" code. The code you provided Unified, was not in the install package I downloaded 2.1.

 

I'm running MS2, so if I encounter anything strange or get the mod to work properly I'll post what I find here.

 

Good luck to us all. :D


Running osC - 2.2MS2. P.S. Please don't ask for a link to my site, it is on a production server and not available for the general public, yet!

Share this post


Link to post
Share on other sites

Well, that didn't help either, so I've commented out this line: :rolleyes:

 

<td class="smallText" valign="top"><?php /*echo $orders_status_split->display_count($orders_status_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_TICKET_STATUS);*/ ?></td>

 

In:

 

admin/

 

returns_reasons.php

refund_methods.php

returns_status.php

 

Quarks within the admin side gone so far.

 

On to the catalog side to see what awaits! ;)


Running osC - 2.2MS2. P.S. Please don't ask for a link to my site, it is on a production server and not available for the general public, yet!

Share this post


Link to post
Share on other sites
Guest

Sorry GD

 

You need to add the following to admin/includes/languages/english.php. It should be:

 

define('TEXT_DISPLAY_NUMBER_OF_TICKET_STATUS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> tickets)');

 

NOT:

 

define('TEXT_DISPLAY_NUMBER_OF_TICKETS_STATUS', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> tickets)');

 

I accidently put TICKETS instead of TICKET!

 

Sorry mate!

 

Regards Jiten

Share this post


Link to post
Share on other sites

Unified,

 

That fixed it.

 

Thanks!


Running osC - 2.2MS2. P.S. Please don't ask for a link to my site, it is on a production server and not available for the general public, yet!

Share this post


Link to post
Share on other sites

I can't get the customers email address. When you click to return a product the name, address, product to return, etc. is listed but where it has Customer email address there is just a blank space.Try it Create an account and place an order then go to my account and return the product.


Keith

 

 

What the hell was I thinkin'?

Share this post


Link to post
Share on other sites
Guest

hi wvmlt

 

I cannot see the error! you cannot see the email?!

 

could you post your return_product.php or PM it to me so I can compare?

 

I really want to get this contribution working. All I need to do now is sort out this error message - I have given up on the returns track... just tell customer to look through their account history.

 

BTW you may also want to eliminate log in issues during the RMA number request etc in the following way:

 

catalog/account_history_info.php

 

change:

 

 

CODE 

 

$return_link = '<font color=blue><b>Return # <a href="returns_track.php?action=returns_show&rma=' . $rma_result['rma_value'] . '">' . $rma_result['rma_value'] . '</a>';

 

 

 

 

to:

 

 

CODE 

 

$return_link = '<font color=blue><b>Return # <a href="' . tep_href_link('returns_track.php', 'action=returns_show&rma=' . $rma_result['rma_value'], 'SSL') . '">' . $rma_result['rma_value'] . '</a>';

 

 

 

 

THEN in catalog/return_product.php change:

 

 

CODE 

 

if (!tep_session_is_registered('customer_id')) {

    $navigation->set_snapshot();

    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

 

 

 

 

to:

 

 

CODE 

 

/* 

  if (!tep_session_is_registered('customer_id')) {

    $navigation->set_snapshot();

    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

}

*/

 

 

 

 

Basically you are just commenting out the redirect to the login page. This may have security issues - maybe?!

 

Regards

 

Jiten

Share this post


Link to post
Share on other sites

Hi Jiten,

 

On the return a product screen the email address isn't there and also in admin the email address isnt showing up. Then when I try to notifie customer the email is returned cos the To: address is blank. Here's a screen shot of my return a product page

screenshot.GIF

 

Per your request here is a copy of my return_product.php

<?php
/*
 $id author Puddled Internet - http://www.puddled.co.uk
 email support@puddled.co.uk
  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 ($osC_Customer->isLoggedOn() == false) {
         $navigation->set_snapshot();
    tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }
*/
 require(DIR_WS_CLASSES . 'order.php');
 $order = new order($HTTP_GET_VARS['order_id']);
// check to find out what thedefault reason for returning a product is
$default_priority_query = tep_db_query("SELECT configuration_value FROM " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_RETURN_REASON'");
$default_priority = tep_db_fetch_array($default_priority_query);
$default_refund_query = tep_db_query("SELECT configuration_value FROM " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_REFUND_METHOD'");
$default_refund = tep_db_fetch_array($default_refund_query);


 if (!$HTTP_GET_VARS['action']){
     $HTTP_GET_VARS['action'] = 'new';
 }

 if ($HTTP_GET_VARS['action']) {
   switch ($HTTP_GET_VARS['action']) {
     case 'insert':
     case 'update':
        // carry out a query on all the existing orders tables, to get the required information
        $rma_create = tep_create_rma_value(11);
        $returns_status_query = tep_db_query("SELECT configuration_value FROM " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_RETURNS_STATUS_ID'");
        $default_return = tep_db_fetch_array($returns_status_query);
        $order_returns_query = tep_db_query("SELECT * FROM " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op where o.orders_id = op.orders_id and o.orders_id = '" . $HTTP_GET_VARS['oID'] . " ' and op.products_id = '" . $HTTP_GET_VARS['products_id'] . "'");
        $orders_return = tep_db_fetch_array($order_returns_query);

        if ($HTTP_POST_VARS['returns_quantity'] > $orders_return['products_quantity']) {
            tep_redirect(tep_href_link(FILENAME_RETURN, 'error=yes&order_id=' . $HTTP_GET_VARS['oID'] . '&products_id=' . $HTTP_GET_VARS['products_id']));
        }

        $customers_id = $orders_return['customers_id'];
        $rma_value = tep_db_prepare_input($rma_create);
        $order_id = $HTTP_GET_VARS['oID'];
        $customers_name = $orders_return['customers_name'];
        $customers_acct = $orders_return['customers_acct'];
        $customers_company = $orders_return['customers_company'];
        $customers_street_address = $orders_return['customers_street_address'];
        $customers_suburb = $orders_return['customers_suburb'];
        $customers_city = $orders_return['customers_city'];
        $customers_postcode = $orders_return['customers_postcode'];
        $customers_state = $orders_return['customers_state'];
        $customers_country = $orders_return['customers_country'];
        $customers_telephone = $orders_return['customers_telephone'];
        $customers_fax = $orders_return['customers_fax'];
        $customers_email = $HTTP_POST_VARS['support_user_email'];
        $customers_address_format_id = $orders_return['customers_address_format_id'];
        $delivery_name = $orders_return['delivery_name'];
        $delivery_company = $orders_return['delivery_company'];
        $delivery_street_address = $orders_return['delivery_street_address'];
        $delivery_suburb = $orders_return['delivery_suburb'];
        $delivery_city = $orders_return['delivery_city'];
        $delivery_postcode = $orders_return['delivery_postcode'];
        $delivery_state = $orders_return['delivery_state'];
        $delivery_country = $orders_return['delivery_country'];
        $delivery_address_format_id = $orders_return['delivery_address_format_id'];
        $billing_name = $orders_return['billing_name'];
        $billing_acct = $orders_return['billing_acct'];
        $billing_company = $orders_return['billing_company'];
        $billing_street_address = $orders_return['billing_street_address'];
        $billing_suburb = $orders_return['billing_suburb'];
        $billing_city = $orders_return['billing_city'];
        $billing_postcode = $orders_return['billing_postcode'];
        $billing_state = $orders_return['billing_state'];
        $billing_country = $orders_return['billing_country'];
        $billing_address_format_id = $orders_return['billing_address_format_id'];
        $comments = tep_db_prepare_input($HTTP_POST_VARS['support_text']);
        $returns_status =  $default_return['configuration_value'];
        $returns_reason = tep_db_prepare_input($HTTP_POST_VARS['support_priority']);
        $products_model = $orders_return['products_model'];
        $products_name = $orders_return['products_name'];
        $products_price = $orders_return['products_price'];
        $discount_made = $orders_return['products_discount_made'];

        // work out price with tax
        $price_inc_tax = tep_add_tax($orders_return['products_price'], $orders_return['products_tax']);
        $price_inc_quantity = $price_inc_tax * $HTTP_POST_VARS['returns_quantity'];
        $final_price =  $price_inc_quantity;
        $products_tax = $orders_return['products_tax'];
        $products_quantity = $HTTP_POST_VARS['returns_quantity'];// $orders_return['products_quantity'];
        $serial_number = $orders_return['products_serial_number'];
        $currency = $orders_return['currency'];
        $currency_value = $orders_return['currency_value'];
        $refund_method = $HTTP_POST_VARS['refund_method'];
        $support_error = false;
// error checking goes in here
// not present at moment
  $support_error = false;

  if (!$support_error) {
         $sql_data_array = array('customers_id' => $customers_id,
                                 'rma_value' => $rma_value,
                                 'order_id' => $order_id,
                                 'customers_name' => $customers_name,
                                 'customers_acct' => $customers_acct,
                                 'customers_company' => $customers_company,
                                 'customers_street_address' => $customers_street_address,
                                 'customers_suburb' => $customers_suburb,
                                 'customers_city' => $customers_city,
                                 'customers_postcode' => $customers_postcode,
                                 'customers_state' => $customers_state,
                                 'customers_country' => $customers_country,
                                 'customers_telephone' => $customers_telephone,
                                 'customers_fax' => $customers_fax,
                                 'customers_email_address' => $customers_email,
                                 'customers_address_format_id' => $customers_address_format_id,
                                 'delivery_name' => $delivery_name,
                                 'delivery_company' => $delivery_company,
                                 'delivery_street_address' => $delivery_street_address,
                                 'delivery_suburb' => $delivery_suburb,
                                 'delivery_city' => $delivery_city,
                                 'delivery_postcode' => $delivery_postcode,
                                 'delivery_state' => $delivery_state,
                                 'delivery_country' => $delivery_country,
                                 'delivery_address_format_id' => $delivery_address_format_id,
                                 'billing_name' => $billing_name,
                                 'billing_acct' => $billing_acct,
                                 'billing_company' => $billing_company,
                                 'billing_street_address' => $billing_street_address,
                                 'billing_suburb' => $billing_suburb,
                                 'billing_city' => $billing_city,
                                 'billing_postcode' => $billing_postcode,
                                 'billing_state' => $billing_state,
                                 'billing_country' => $billing_country,
                                 'billing_address_format_id' => $billing_address_format_id,
                                 'comments' => $comments,
                                 'returns_status' => $returns_status,
                                 'returns_reason' => $returns_reason,
                                 'currency' => $currency,
                                 'currency_value' =>$currency_value,
                                );
         if ($HTTP_GET_VARS['action'] == 'insert') {
           $insert_sql_data = array('date_purchased' => 'now()',
                                    );

           // returns information table updated,
           tep_db_perform(TABLE_RETURNS, $sql_data_array);
           $ticket_id = tep_db_insert_id();


          // tep_db_query("insert into " . TABLE_RETURN_PAYMENTS . " values ('', '" . $ticket_id . "', '', '', '', '', '0.00')");

           tep_db_perform(TABLE_RETURNS, $insert_sql_data, 'update', 'returns_id = \'' . $ticket_id . '\'');
             // now update returns products, and history tables
            $data_insert_sql = array('returns_id' => $ticket_id,
                                     'order_id' => $order_id,
                                     'products_id' => $HTTP_GET_VARS['products_id'],
                                     'products_model' =>$products_model,
                                     'products_name' => $products_name,
                                     'products_price' => $products_price,
                                     'products_discount_made' => $discount_made,
                                     'final_price' => $final_price,
                                     'products_tax' => $products_tax,
                                     'products_quantity' => $products_quantity,
                                     'products_serial_number' => $serial_number,
                                     );
         $returns_payment_sql = array('returns_id' => $ticket_id,
                                      'refund_payment_name' => $refund_method,
                                      'refund_payment_value' => $final_price,
                                      );

           tep_db_perform(TABLE_RETURN_PAYMENTS, $returns_payment_sql);
           tep_db_perform(TABLE_RETURNS_PRODUCTS_DATA, $data_insert_sql);
           tep_db_query("UPDATE " . TABLE_ORDERS_PRODUCTS . " set products_returned = 1 where orders_id = '" . $HTTP_GET_VARS['oID'] . "' and products_id = '" . $HTTP_GET_VARS['products_id'] . "'");

         }


         // now send email to customer

          require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_RETURN_EMAILS);
          $email_text = EMAIL_TEXT_TICKET_OPEN;
          $email_text .= EMAIL_THANKS_OPEN . EMAIL_TEXT_OPEN . EMAIL_CONTACT_OPEN . EMAIL_WARNING_OPEN;
          tep_mail($support_user_name, $support_user_email, EMAIL_SUBJECT_OPEN . ' #' . $rma_value, nl2br($email_text), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
         // send email to alternate address
          if (strlen($support_alternate_email) > 0) {
               $email_text = EMAIL_TEXT_TICKET_OPEN;
               $email_text .= EMAIL_THANKS_OPEN . EMAIL_TEXT_OPEN . EMAIL_CONTACT_OPEN . EMAIL_WARNING_OPEN;
               tep_mail($support_user_name, $support_alternate_email, EMAIL_SUBJECT_OPEN . ' #' . $rma_value, nl2br($email_text), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
            }
            
         // now send an email to the default administrator to let them know of new ticket
          //  $default_admin_email = tep_db_query("SELECT admin_id FROM " . TABLE_SUPPORT_TICKETS . " where ticket_id = '" . $HTTP_GET_VARS['ticket_id'] . "' and customers_id = '" . $customer_id . "'");
          //  $default_email = tep_db_fetch_array($default_admin_email);
         //   $admin_email_query = tep_db_query("SELECT support_assign_email, support_assign_name FROM " . TABLE_SUPPORT_ASSIGN . " where support_assign_id = '" . $default_email['admin_id'] . "' and language_id = '" . $languages_id . "'");
         //   $admin_email = tep_db_fetch_array($admin_email_query);
            $email_text_admin = EMAIL_TEXT_TICKET_ADMIN;
            $email_text_admin .= EMAIL_THANKS_ADMIN . EMAIL_TEXT_ADMIN . EMAIL_CONTACT_ADMIN . EMAIL_WARNING_ADMIN;
            tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS , EMAIL_SUBJECT_ADMIN .' #' . $rma_value, nl2br($email_text), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

         // redirect to confirmation
           tep_redirect(tep_href_link(FILENAME_RETURN . '?action=sent&rma_value='. $rma_value . '&return_id=' . $ticket_id));
       } else {
         $HTTP_GET_VARS['action'] = 'new';
       }
       break;
      case 'default':
      tep_redirect(tep_href_link(FILEANME_DEFAULT));
      break;
   }
 }
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_RETURN);
 $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">

<script language="javascript"><!--
function popupWindow(url) {
 window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re
sizable=yes,copyhistory=no,width=450,height=280,screenX=150,screenY=150,top=150,l
eft=150')
}
//--></script>
</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">
<?php echo tep_image(DIR_WS_IMAGES . 'table_background_specials.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?>
</td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>
	 <td><?php echo tep_draw_separator('pixel_trans.gif', '15', '15'); ?></td>
</tr>
<?php
if ($HTTP_GET_VARS['action'] == 'sent'){
          $text_query = tep_db_query("SELECT * FROM " . TABLE_RETURNS_TEXT . " where return_text_id = '1' and language_id = '" . $languages_id . "'");
          $text = tep_db_fetch_array($text_query);

       //   tep_db_query("INSERT into " . TABLE_RETURN_PAYMENTS . " values ('', '" . $HTTP_GET_VARS['id'] . "', '', '', '', '', '')");
            ?>
         <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main"><?php new infoBox(array(array('text' => '<center><font color=blue size=4px><b>Your RMA number :- '. $HTTP_GET_VARS['rma_value'] . '</b></font></center>'))); ?></td>
         </tr>
          <tr>
	 <td><?php echo tep_draw_separator('pixel_trans.gif', '20', '20'); ?></td>
         </tr>
         <tr>
           <td class="main"><?php new infoBox(array(array('text' => nl2br($text['return_text_one'])))); ?></td>
         </tr>

        <tr>
           <td align="right" vlaign=bottom><br><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
        </tr>
       </table></td>
     </tr>


         <?
} else// if ($HTTP_GET_VARS['action'] == 'new')
{
        $account_query = tep_db_query("SELECT customers_firstname, customers_lastname, customers_email_address FROM " . TABLE_CUSTOMERS . " where customers_id = '" . $customer_id . "'");
        $account = tep_db_fetch_array($account_query);
        // query the order table, to get all the product details
        $returned_products_query = tep_db_query("SELECT * FROM " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS . " o where o.orders_id = op.orders_id and op.orders_id = '" . $HTTP_GET_VARS['order_id'] . "' and products_id = '" . $HTTP_GET_VARS['products_id'] . "'");
        $returned_products = tep_db_fetch_array($returned_products_query);
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
     </tr>
     <tr><form action="return_product.php?action=insert&oID=<? echo $HTTP_GET_VARS['order_id'] . '&products_id=' . $HTTP_GET_VARS['products_id']; ?>" method=post>
       <td><table border="0" cellspacing="0" cellpadding="2" width=100%>
            <?
                 if (isset($error)=='yes') {
                  ?> <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td width="40%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"><b>ERROR</b></td>
             </tr>

          </table></td>
           <td width="60%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
        <?
   echo '              <tr>' . "\n" .
        '                <td class="main" align="left" width="100%">The quantity you entered is greater than the original ordered quantity</td>' . "\n" .

        '              </tr>' . "\n";

          ?>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '15'); ?></td>
         </tr>
             <?
             }
           ?>

           <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td class="main" colspan="2"><b><?php echo TEXT_SUPPORT_RETURN_HEADING; ?></small></b></td>
         </tr>

       </table></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td width="30%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"><b><?php echo TEXT_SUPPORT_PRODUCT_RETURN; ?></b><BR></td>
             </tr>



           </table></td>
           <td width="70%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
             <tr>
               <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<?php
 if (sizeof($order->info['tax_groups']) > 1) {
?>
                 <tr>
                   <td class="main" colspan="2"><b>Qty</b></td>

                   <td class="smallText" align="right"><b><?php echo HEADING_PRODUCTS; ?></b></td>
                   <td class="smallText" align="right"><b><?php echo HEADING_TOTAL; ?></b></td>
                 </tr>
<?php
 } else {
?>
                 <tr>
                   <td class="main" colspan="3"><b><?php echo HEADING_PRODUCTS; ?></b></td>
                 </tr>
<?php
 }

//  $ordered_product_query = tep_db_query("SELECT * FROM " . TABLE_ORDERS_PRODUCTS . " where order_id = '" . $HTTP_GET_VARS


   echo '          <tr>' . "\n" .
        '            <td class="main" align="right" valign="top" width="30">' . tep_draw_input_field('returns_quantity', $returned_products['products_quantity'], 'size=5') . '  x</td>' . "\n" .
        '            <td class="main" valign="top">    ' . $returned_products['products_name'];


echo '</td>' . "\n";
echo '            <td class="main" align="right" valign="top">' . (($returned_products['final_price']) * ($returned_products['products_quantity'])) . '</td>' . "\n" .
        '          </tr>' . "\n";

?>
               </table></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>


       <tr>
           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '15'); ?></td>
         </tr>
             <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td width="40%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"><b><?php echo TEXT_SUPPORT_BILLING_ADDRESS; ?></b></td>
             </tr>
             <tr>
               <td class="main"> </td>
             </tr>
          </table></td>
           <td width="60%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
        <?
   echo '              <tr>' . "\n" .
        '                <td class="main" align="left" width="5%"> </td>' . "\n" .
        '                <td class="main" align="left" width=95%>' . tep_address_format($order->billing['format_id'], $order->billing, 1, ' ', '<br>') . '</td>' . "\n" .
        '              </tr>' . "\n";
          ?>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
         </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td width="40%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"><b><?php echo TEXT_SUPPORT_DELIVERY_ADDRESS; ?></b></td>
             </tr>
             <tr>
               <td class="main"> </td>
             </tr>
          </table></td>
           <td width="60%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
        <?
   echo '              <tr>' . "\n" .
        '                <td class="main" align="left" width="5%"> </td>' . "\n" .
        '                <td class="main" align="left" width=95%>' . tep_address_format($order->delivery['format_id'], $order->delivery, 1, ' ', '<br>') . '</td>' . "\n" .
        '              </tr>' . "\n";
          ?>
           </table></td>
         </tr>
       </table></td>
     </tr>

     <tr>
           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
         </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td width="40%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"><b><?php echo TEXT_SUPPORT_USER_EMAIL; ?></b></td>
             </tr>

          </table></td>
           <td width="60%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
        <?
   echo '              <tr>' . "\n" .
        '                <td class="main" align="left" width="5%"> </td>' . "\n" .
        '                <td class="main" align="left" width=95%>' . $account['customers_email_address'] . tep_draw_hidden_field('support_user_email', $account['customers_email_address']) . '</td>' . "\n" .
        '              </tr>' . "\n";

          ?>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td width="40%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"><b><?php echo TEXT_WHY_RETURN; ?></b></td>
             </tr>
             <tr>
               <td class="main"> </td>
             </tr>
          </table></td>
           <td width="60%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
               <tr>
           <td class=main width=5%> </td>
           <td class="main" width=95%><?php //echo tep_draw_input_field('link_url'); ?>
         <?
           $priority_query = tep_db_query("select return_reason_id, return_reason_name from ". TABLE_RETURN_REASONS . " where language_id = '" . $languages_id . "' order by return_reason_id desc");
           $select_box = '<select name="support_priority"  size="' . MAX_MANUFACTURERS_LIST . '">';
            if (MAX_MANUFACTURERS_LIST < 2) {
                    }
              while ($priority_values = tep_db_fetch_array($priority_query)) {
                $select_box .= '<option value="' . $priority_values['return_reason_id'] . '"';
                if ($default_priority['configuration_value'] ==  $priority_values['return_reason_id']) $select_box .= ' SELECTED';
                $select_box .= '>' . substr($priority_values['return_reason_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '</option>';
             }
            $select_box .= "</select>";
            $select_box .= tep_hide_session_id();
            echo $select_box;
         ?>
         <br><br>
         <?
        $charge_query = tep_db_query("SELECT configuration_value FROM " . TABLE_CONFIGURATION . " where configuration_key = 'DEFAULT_RESTOCK_VALUE'");
        $charge = tep_db_fetch_array($charge_query);
         echo TEXT_SUPPORT_SURCHARGE . $charge['configuration_value'] .'%' . TEXT_SUPPORT_SURCHARGE_TWO; ?>
           </td>
         </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
               <td class="main"> </td>
             </tr>
      <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td width="40%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"><b>Preferred refund method</b></td>
             </tr>
             <tr>
               <td class="main"> </td>
             </tr>
          </table></td>
           <td width="60%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
               <tr>
           <td class=main width=5%> </td>
           <td class="main" width=95%><?php //echo tep_draw_input_field('link_url'); ?>
         <?
           $refund_query = tep_db_query("select refund_method_id, refund_method_name from ". TABLE_REFUND_METHOD . " where language_id = '" . $languages_id . "' order by refund_method_id desc");
           $select_box = '<select name="refund_method"  size="' . MAX_MANUFACTURERS_LIST . '">';
            if (MAX_MANUFACTURERS_LIST < 2) {
                    }
              while ($refund_values = tep_db_fetch_array($refund_query)) {
                $select_box .= '<option value="' . $refund_values['refund_method_name'] . '"';
                if ($default_refund['configuration_value'] ==  $refund_values['refund_method_id']) $select_box .= ' SELECTED';
                $select_box .= '>' . substr($refund_values['refund_method_name'], 0, MAX_DISPLAY_MANUFACTURER_NAME_LEN) . '</option>';
             }
            $select_box .= "</select>";
            $select_box .= tep_hide_session_id();
            echo $select_box;
         ?>

           </td>
         </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
               <tr>
           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
         </tr>
      <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td width="40%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td class="main"><b><?php echo TEXT_SUPPORT_TEXT; ?></b></td>
             </tr>
             <tr>
               <td class="main"> </td>
             </tr>
          </table></td>
           <td width="60%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
        <?
   echo '              <tr>' . "\n" .
        '                <td class="main" align="left" width="5%"> </td>' . "\n" .
        '                <td class="main" align="left" width=95%>' . tep_draw_textarea_field('support_text', 'soft', '40', '7') . '</td>' . "\n" .
        '              </tr>' . "\n";

          ?>
           </table></td>
         </tr>
       </table></td>
     </tr>
               <tr>
           <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
         </tr>

      </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
         <tr>
           <td colspan="2" class="main" valign="top" nowrap align="center">



           <input type=submit value="Request Return's Number"></td>
         </tr>
       </table></td>
     </form></tr>
<?php
}
?>


            
            
            <!--
            
            -->

           </td>
         </tr>
       </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'); ?>

 

I'm looking forward to getting this to work. I think it's an excellent addition to any online store.


Keith

 

 

What the hell was I thinkin'?

Share this post


Link to post
Share on other sites
Guest

Hi WVMLT

 

what version of the returns system are you using?

 

there are several differences... try using RMA v2.1

 

See if that helps

 

Regards

 

Jiten

Share this post


Link to post
Share on other sites
Guest

Hi keith

 

Sorry mate - but did you modify the code? You seem to have a few changes from the stock version of RMA?

 

However, in saying that, the code requesting ( and showing) the email is the same!

 

I am trying to figure out where else the email may be called from at the moment. Will let you know if I find anything out.

 

Regards

 

Jiten

Share this post


Link to post
Share on other sites

OK I got the email to show up by changing

tep_draw_hidden_field('support_user_email', $account['customers_email_address']) . '</td>' . "\n" .

to

tep_draw_field('support_user_email', $account['customers_email_address']) . '</td>' . "\n" .

But it doesnt send email address to admin <_<


Keith

 

 

What the hell was I thinkin'?

Share this post


Link to post
Share on other sites

Madding!

 

Does anyone have this mod working 100% after all the fixes and suggestions posted here?

 

I do not receive any kind of error message from either the admin or catalog sides. When I try to Request a RMA#, after clicking on the submit button, I'm redirected to the account_info.php page, no RMA#, no e-mail is sent to either the customer or admin. :blink:

 

I can't figure out what it needs to work! :(

 

Also:

 

On the returns_track.php form page, I've typed a (made up) number to test the error system, but nothing happens after clicking on the submit button, only the link in the browsers search bar changes to something like:

 

https://www.mydomain.com/catalog/returns_tr...amp;submit.y=13

 

Thanks!


Running osC - 2.2MS2. P.S. Please don't ask for a link to my site, it is on a production server and not available for the general public, yet!

Share this post


Link to post
Share on other sites

Hi All,

 

I have been wanting to get the RMA returns system to work, and finally i have got the tracking system working, which has been a problem for alot of people.

 

You need to change this code in "return_track.php":

 

                    $returns = '<form action="' . $PHP_SELF . '?action=returns_show" method=post>
                            <tr>
                            <td colspan=3 class=main>Please enter the RMA number you recieved when you placed you item for return.</td>
                            </tr>
                            <tr>
                            <td width=100& colspan=3 class=main> </td>
                            </tr>
                            <tr>
                            <td width="25%" height="30" align="left" class="main">Your <b><i>RMA</i></b> Number</td>
                            <td width="5%" height="30" align="center" class="main"> </td>
                            <td width="75%" height="30" align="left" class="main"><font color=red><input type=text name="rma" value="" size=20></font></td>
                            </tr>
                            <tr>
                            <td width=100& colspan=3 class=main> </td>
                            </tr>
                            <tr>
                            <td width=100% colspan=3 align=right><input type=submit name="submit" value="Find Return ->">   </td>
                            </tr>
                            </form>
                            ';

 

To This Code:

 

                    $returns  = tep_draw_form('rma_find', tep_href_link('returns_track.php', '', 'NONSSL'), 'post');
  	 $returns .= tep_draw_hidden_field('action', 'returns_show');
  	 $returns .= tep_hide_session_id();
                   $returns .= '<tr>
                            <td colspan=3 class=main>Please enter the RMA number you recieved when you placed you item for return.</td>
                            </tr>
                            <tr>
                            <td width=100& colspan=3 class=main> </td>
                            </tr>
                            <tr>
                            <td width="25%" height="30" align="left" class="main">Your <b><i>RMA</i></b> Number</td>
                            <td width="5%" height="30" align="center" class="main"> </td>
                            <td width="75%" height="30" align="left" class="main"><font color=red><input type=text name="rma" value="" size=20></font></td>
                            </tr>
                            <tr>
                            <td width=100& colspan=3 class=main> </td>
                            </tr>
                            <tr>
                            <td width=100% colspan=3 align=right><input type=submit name="submit" value="Find Return ->">   </td>
                            </tr>
                            ';

 

I know this has annoying me and alot of other people, i will be working on the other error that there currently is left and post the fixes upto here. I have the contribution about 95% working on both admin and catalog, hopefully 100% by the weekend. I Will try and post all the fixes i used to get it 100% work when i have got that far.

 

Let me know if you need any help to get this working on your site.

 

Mark Dwyer

North Essex Websites

Share this post


Link to post
Share on other sites

Just one mistake on that code, the "post" at the end of the first line should be "get".

 

I need to change a few other bits in the page to increase the security of this, but for now it is working on the 'get' method.

 

Sorry i missed this.

 

Mark Dwyer

North Essex Websites

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×