RMA Returns error for 2.2 MS2
#41
Posted 03 January 2004 - 06:09 AM
What the hell was I thinkin'?
#42
Posted 03 January 2004 - 11:42 AM
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:
Quote
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
#43
Posted 03 January 2004 - 02:48 PM
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
[img]http://www.wvdropshipping.com/screenshot.GIF[/img]
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.
What the hell was I thinkin'?
#44
Posted 03 January 2004 - 03:18 PM
what version of the returns system are you using?
there are several differences... try using RMA v2.1
See if that helps
Regards
Jiten
#45
Posted 03 January 2004 - 03:41 PM
What the hell was I thinkin'?
#46
Posted 03 January 2004 - 07:32 PM
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
#47
Posted 06 January 2004 - 06:03 AM
tep_draw_hidden_field('support_user_email', $account['customers_email_address']) . '</td>' . "\n" .
totep_draw_field('support_user_email', $account['customers_email_address']) . '</td>' . "\n" .
But it doesnt send email address to admin What the hell was I thinkin'?
#48
Posted 12 January 2004 - 07:58 AM
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.
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!
#49
Posted 16 January 2004 - 10:53 AM
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
#50
Posted 16 January 2004 - 11:00 AM
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
#51
Posted 17 January 2004 - 03:42 AM
I've changed the code for the returns_track.php, and then tried the form...
Error 404 - Not Found page with this address in the browser address bar:
https://www.mydomain.com/catalog/returns_tr...p&error=yes
As someone stated before, this is an important mod, but if it doesn't work it's worthless to us. I cannot let this mod hold my site back from opening sometime this year
Thanks!
#52
Posted 17 January 2004 - 06:52 PM
I've been messing around with this mod for some time now, and I have to thank you for the changes to returns track - I tried something similar to your changes and kept getting errors, but it's now working! So big thanks!
However, there are still several issues. The most important is in admin. When looking under returned products, the status shows as the return reason! What I mean is that rather than telling you the status of the return (i.e. pending, completed or rejected) it tells you the return reason (i.e. faulty, warranty etc)! This is clearly wrong! I have changed this so it calls the status... but it is not giving the correct status (i.e. instead of complleted, it shows rejected!)
Any ideas? Also should the status (i.e. accepted rejected etc) not show on the customer side so they know what is happening with the return?
GD - did you change "post" to "get" ? If not try that!
Regards,
Jiten
#53
Posted 18 January 2004 - 11:53 AM
Quote
Yes I did, but no go.
If you have your returns_track.php working, can you post the full source code here, so I can do a diff between yours' and my own, maybe then I could get that part of the mod to work.
Thanks!
#54
Posted 23 January 2004 - 11:54 PM
Sorry been away a couple of days... but here's my returns_track.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 (!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'));
tep_redirect(tep_href_link('returns_track.php', '', 'SSL').'&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);
$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">
<?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 width="100%" valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<?
if ($HTTP_GET_VARS['action'] == 'returns_show') {
include(DIR_WS_MODULES . 'returns_track.php');
// }
?>
<?php
//
?>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '20', '20'); ?><br</td>
</tr>
<?php
//}
?>
<table></td>
<!-- end new insert here --//-->
<?
} else {
?>
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="100%" valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<?
if (isset($error)=='yes') {
$error_message = '<tr>
<td colspan=3 class=main>The details you entered do not match any of our records, please try again, or contact us for further assistance</td>
</tr>
<tr>';
new infoBox(array(array('text' => $error_message)));
// }
echo '<br><BR>';
}
$returns = tep_draw_form('rma_find', tep_href_link('returns_track.php', '', 'NONSSL'), 'get');
$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>
</form>
';
new infoBox(array(array('text' => $returns)));
?>
<!-- </table></td></tr>-->
</table></td></tr>
</table></td></tr>
<?
}
?>
</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 hope that helps!
Regards
Jiten
#55
Posted 27 January 2004 - 08:32 PM
Quote
Thanks, but no change.
PLEASE,
Anyone that has the mod working, PLEASE post a .zip file of their working version of the mod
Thank you!
#56
Posted 01 February 2004 - 02:38 AM
This mod, just does not want to work for me
#57
Posted 04 February 2004 - 01:37 AM
Quote
4, Open catalog/includes/functions/general.php
at the end of the file just before the closing ?> add the following line
include('includes/functions/refund_functions.php');
should this be admin/include/functions/general.php
I have 2.2ms2 and I don't have this folder catalog/includes/functions/
#58
Posted 04 February 2004 - 06:38 AM
this step is in the Admin section. Just ignor it for now.
#59
Posted 09 February 2004 - 11:50 AM
I've benn trying to get the mod to work sense 04/09/2003, so I had to try the mod, just one more time before I gave up on it, so I installed this version:
02/07/2004 - RMA_return2.1b Author: andrew
http://www.oscommerce.com/community/contri...ons,1136/page,7
Oh happy day!
With some very minor tweaks, it is working 100% on my 2.2MS2 install.
Thanks andrew, and a big thank you to ALL the coders on this mod.
#60
Posted 11 February 2004 - 02:44 AM
Don









