Zen Cart Logo
Forums / All Other Contributions/Addons / Return Authorization Module (RMA)

Return Authorization Module (RMA)

Views: 109,994

Results 561 to 580 of 644
19 Apr 2013, 8:18 PM
#561
xspresso avatar

xspresso

New Zenner

Join Date:
Sep 2008
Posts:
22
Plugin Contributions:
0

Return Authorization Module (RMA)

steveyork136:

Hi clydejones

I add a link from the customers account page, so on page tpl_account_default.php where a customer can view their orders, next to the view button there is a "return request button", clicking this button sends the customer (with the order_id in the url) to the return request page.

This is the code for the tpl_account_default.php page

The extra code is <th scope="col"><?php echo TABLE_HEADING_RMA; ?></th> which adds the column header

and

<td width="120px"><?php echo '<a href="' . zen_href_link(FILENAME_RETURNS, 'order_id=' . $orders['orders_id'], 'SSL') . '"> ' . zen_image_button(BUTTON_IMAGE_RMA_SMALL, BUTTON_RMA_SMALL_ALT) . '</a>'; ?></td>

which builds the link using the zen button scheme

<table width="100%" border="0" cellpadding="0" cellspacing="0" id="prevOrders"> <caption><h2><?php echo OVERVIEW_PREVIOUS_ORDERS; ?></h2></caption> <tr class="tableHeading"> <th scope="col"><?php echo TABLE_HEADING_DATE; ?></th> <th scope="col"><?php echo TABLE_HEADING_ORDER_NUMBER; ?></th> <th scope="col"><?php echo TABLE_HEADING_SHIPPED_TO; ?></th> <th scope="col"><?php echo TABLE_HEADING_STATUS; ?></th> <th scope="col"><?php echo TABLE_HEADING_TOTAL; ?></th> <th scope="col"><?php echo TABLE_HEADING_VIEW; ?></th> <th scope="col"><?php echo TABLE_HEADING_RMA; ?></th> </tr> <?php foreach($ordersArray as $orders) { ?> <tr> <td width="80px"><?php echo zen_date_short($orders['date_purchased']); ?></td> <td width="40px"><?php echo TEXT_NUMBER_SYMBOL . $orders['orders_id']; ?></td> <td align="center"><address><?php echo zen_output_string_protected($orders['order_name']) . '<br />' . $orders['order_country']; ?></address></td> <td width="80px"><?php echo $orders['orders_status_name']; ?></td> <td width="80px" align="right"><?php echo $orders['order_total']; ?></td> <td align="center"><?php echo '<a href="' . zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $orders['orders_id'], 'SSL') . '"> ' . zen_image_button(BUTTON_IMAGE_VIEW_SMALL, BUTTON_VIEW_SMALL_ALT) . '</a>'; ?></td> <td width="120px"><?php echo '<a href="' . zen_href_link(FILENAME_RETURNS, 'order_id=' . $orders['orders_id'], 'SSL') . '"> ' . zen_image_button(BUTTON_IMAGE_RMA_SMALL, BUTTON_RMA_SMALL_ALT) . '</a>'; ?></td> </tr> <?php } ?> </table> ```

Hello

Can anyone tell me why this code does NOT return the Order ID to the RMA form?

20 Apr 2013, 3:01 AM
#562
xspresso avatar

xspresso

New Zenner

Join Date:
Sep 2008
Posts:
22
Plugin Contributions:
0

Re: Return Authorization Module (RMA)

I separated the submit rma page from the success page.
I added a generated RMA number.
I would really like the invoice number included in that rma generation.
When the customer is logged in, they can click a button next to their "view" order button
in "View Account".
This should immediately forward you to the rma form with all your personal info fields populated.

Including your invoice order number.
It does carry in the url:
/index.php?main_page=returns&order_id=105308
But does not fill the order number field.

I will post all my upgrades once this is solved. Can anyone help solve this?
Attachment 12375Attachment 12376

20 Apr 2013, 3:43 AM
#563
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Return Authorization Module (RMA)

  1. look at the returns page header_php.php file to see how it auto generates name, email, phone, ect.

  2. look at the code for account > history info

just a suggestion and may lead you in the right direction

22 Apr 2013, 7:23 AM
#564
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Return Authorization Module (RMA)

So this was pretty easy and it's a great function.

1.) lets create a button
1.A) /includes/languages/english/YOUR_TEMPLATE_NAME/button_names.php

add:

define('BUTTON_RMA_REQUEST', 'button_rma_request.png'); <-- Name of your button
define('BUTTON_RMA_REQUEST_ALT', 'Request an RMA'); <-- You buttons ALT (alternative text)

1.b) upload your button
/includes/templates/YOUR_TEMPLATE_NAME/buttons/english

  1. lets add the button to the My Account > History > Order Info page
    2.A) /includes/templates/YOUR_TEMPLATE_NAME/templates/tpl_account_history_info_default.php

I added my button at the end of the file right after the <br class="clearBoth" /> and closing </div>

<div class="rmaRequestButton"><?php echo '<a href="' . zen_href_link(FILENAME_RETURNS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'order_id=' . $_GET['order_id'], 'SSL') . '">' . zen_image_button(BUTTON_RMA_REQUEST) . '</a>'; ?></div>

3.) /includes/modules/pages/returns/header_php.php

find:

if (REGISTERED_RETURN == 'true'){
  if (!$_SESSION['customer_id']) {
    $_SESSION['navigation']->set_snapshot();
    zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL'));
  }
}

right below that add:

if (!isset($_GET['order_id']) || (isset($_GET['order_id']) && !is_numeric($_GET['order_id']))) {
  zen_redirect(zen_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL'));
}

towards the bottom find:

  $city = $check_customer->fields['entry_city'];

right below that add:

$customer_info_query = "SELECT customers_id
                        FROM   " . TABLE_ORDERS . "
                        WHERE  orders_id = :ordersID";

$customer_info_query = $db->bindVars($customer_info_query, ':ordersID', $_GET['order_id'], 'integer');
$customer_info = $db->Execute($customer_info_query);

$order_number = $_GET['order_id'];

Thats it, now your customers "Order Number" text field on the returns page will be pre-populated by the order_id from within the My Account > History > Order Info page

Enjoy!

22 Apr 2013, 4:16 PM
#565
xspresso avatar

xspresso

New Zenner

Join Date:
Sep 2008
Posts:
22
Plugin Contributions:
0

Re: Return Authorization Module (RMA)

Hi everyone,

rbarbour thank you very much. I will add that once I figure out why my page goes blank.

I hate to say it but it happened again, my "index.php?main_page=returns" page comes back blank.

Now I know I made a lot of changes but as before I rolled back my changes... nothing.
I deleted the entire script, removed all mysql entries.

Re-installed DivaVocals update (3.1) the database installed, double checked the database, all there...but still nothing just a blank page

The strange part is when I delete "returns.php" my "index.php?main_page=returns" page returns (no longer blank, just like 2.33 did).
But it is not reading the english file, the php is what is showing ie; ENTRY_REASON_TEXT etc

the only mod is fast and easy checkout 1.10.0

Thanks

22 Apr 2013, 4:39 PM
#566
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Return Authorization Module (RMA)

xspresso:

Hi everyone,

rbarbour thank you very much. I will add that once I figure out why my page goes blank.

I hate to say it but it happened again, my "index.php?main_page=returns" page comes back blank.

Now I know I made a lot of changes but as before I rolled back my changes... nothing.
I deleted the entire script, removed all mysql entries.

Re-installed DivaVocals update (3.1) the database installed, double checked the database, all there...but still nothing just a blank page

The strange part is when I delete "returns.php" my "index.php?main_page=returns" page returns (no longer blank, just like 2.33 did).
But it is not reading the english file, the php is what is showing ie; ENTRY_REASON_TEXT etc

the only mod is fast and easy checkout 1.10.0

Thanks

Blank page = error log.. can't GUESS why you are getting a blank page.. post the results of the error log..

22 Apr 2013, 9:54 PM
#567
xspresso avatar

xspresso

New Zenner

Join Date:
Sep 2008
Posts:
22
Plugin Contributions:
0

Re: Return Authorization Module (RMA)

Hello and thank you for your efforts.

There are a few items that I would like to change, the page returns to the view history in my account,
can we add an if else or something to the code below to send it to "success" after submission.

if (!isset($_GET['order_id']) || (isset($_GET['order_id']) && !is_numeric($_GET['order_id']))) {
zen_redirect(zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, '', 'SSL'));
}
** if (isset($_GET['action']) && ($_GET['action'] == 'success')) {**

Also:
Since the code you wrote is not used during success, the order_number will not show in success (i guess) without calling it from the database from within success?

P.S. my page was blank because I guess I have fat fingers and added an extra ' to the returns.php

22 Apr 2013, 10:09 PM
#568
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Return Authorization Module (RMA)

xspresso:

Hello and thank you for your efforts.

There are a few items that I would like to change, the page returns to the view history in my account,
can we add an if else or something to the code below to send it to "success" after submission.

if (!isset($_GET['order_id']) || (isset($_GET['order_id']) && !is_numeric($_GET['order_id']))) {
zen_redirect(zen_href_link(FILENAME_ACCOUNT_HISTORY_INFO, '', 'SSL'));
}
** if (isset($_GET['action']) && ($_GET['action'] == 'success')) {**

If you remove that code all together, it will produce the success page after the form is submitted.

22 Apr 2013, 11:04 PM
#569
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Return Authorization Module (RMA)

1.) Disregard my previous posts for I did not test thoroughly with @DivaVocals updated version.

2.) I actually installed the new version but did not test it (jumped the gun), but when I did (without any alterations), I am getting the send button on the success page (I am getting the success page) and no email being sent.

22 Apr 2013, 11:31 PM
#570
xspresso avatar

xspresso

New Zenner

Join Date:
Sep 2008
Posts:
22
Plugin Contributions:
0

Re: Return Authorization Module (RMA)

Thank you that works great.

I hate to be a pain... but I'm sure it's too late!
Can you see any way to get the order_number to the success page?

22 Apr 2013, 11:35 PM
#571
xspresso avatar

xspresso

New Zenner

Join Date:
Sep 2008
Posts:
22
Plugin Contributions:
0

Re: Return Authorization Module (RMA)

I removed that code and it send me back to success.

The success page I thought always had the send button, I was going to look at that next.

I get the email just fine.

22 Apr 2013, 11:46 PM
#572
xspresso avatar

xspresso

New Zenner

Join Date:
Sep 2008
Posts:
22
Plugin Contributions:
0

Re: Return Authorization Module (RMA)

The button was to low I moved it up a few lines.

<fieldset> <legend class="write"><?php echo ENTRY_REASON; ?></legend> <label class="inputLabel" for="reason"><?php echo (($error == true && $entry_reason_error == true) ? ENTRY_REASON_TEXT . zen_image($template->get_template_dir(RETURN_WARNING_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . RETURN_WARNING_IMAGE, RETURN_WARNING_IMAGE_ALT, RETURN_WARNING_IMAGE_WIDTH, RETURN_WARNING_IMAGE_HEIGHT) : ENTRY_REASON_TEXT . zen_image($template->get_template_dir(RETURN_REQUIRED_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . RETURN_REQUIRED_IMAGE, RETURN_REQUIRED_IMAGE_ALT, RETURN_REQUIRED_IMAGE_WIDTH, RETURN_REQUIRED_IMAGE_HEIGHT)); ?></label> <?php echo (($error == true && $entry_reason_error == true) ? zen_draw_textarea_field('reason', '30', '7', $reason, 'id="reason"') . ENTRY_REASON_TEXT_ERROR : zen_draw_textarea_field('reason', '30', '7', $reason, 'id="reason"')); ?> </fieldset> </div> **<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SEND, BUTTON_SEND_ALT); ?></div>** <?php } ?> </form> <br class="clearBoth" /> </div> <div class="buttonRow back"><?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACK, BUTTON_BACK_ALT) . '</a>'; ?></div>
22 Apr 2013, 11:53 PM
#573
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Return Authorization Module (RMA)

xspresso:

I removed that code and it send me back to success.

The success page I thought always had the send button, I was going to look at that next.

I get the email just fine.

Never paid attention to that, but YES the send button has always been on the success form.. It SHOULD NOT be there.. Somehow in scrubbing the code and fixing the form I missed that.. Will update my version and submit it to the downloads section..

23 Apr 2013, 12:39 AM
#574
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Return Authorization Module (RMA)

UPDATED

So this was pretty easy and it's a great function.

1.) lets create a button
1.A) /includes/languages/english/YOUR_TEMPLATE_NAME/button_names.php

add:

define('BUTTON_RMA_REQUEST', 'button_rma_request.png'); <-- Name of your button
define('BUTTON_RMA_REQUEST_ALT', 'Request an RMA'); <-- You buttons ALT (alternative text)

1.b) upload your button
/includes/templates/YOUR_TEMPLATE_NAME/buttons/english

  1. lets add the button to the My Account > History > Order Info page
    2.A) /includes/templates/YOUR_TEMPLATE_NAME/templates/tpl_account_history_info_default.php

I added my button at the end of the file right after the <br class="clearBoth" /> and closing </div>

<div class="rmaRequestButton"><?php echo '<a href="' . zen_href_link(FILENAME_RETURNS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'order_id=' . $_GET['order_id'], 'SSL') . '">' . zen_image_button(BUTTON_RMA_REQUEST) . '</a>'; ?></div>

3.) /includes/modules/pages/returns/header_php.php

in the middle of the file find:

 zen_redirect(zen_href_link(FILENAME_RETURNS, 'action=success'));

change to:

zen_redirect(zen_href_link(FILENAME_RETURNS, 'action=success' . '&order_id=' . $order_number));

towards the bottom find:

  $postcode = $check_customer->fields['entry_postcode'];
}

right below that add:

$customer_info_query = "SELECT customers_id
                        FROM   " . TABLE_ORDERS . "
                        WHERE  orders_id = :ordersID";

$customer_info_query = $db->bindVars($customer_info_query, ':ordersID', $_GET['order_id'], 'integer');
$customer_info = $db->Execute($customer_info_query);

$order_number = $_GET['order_id'];

Now in /includes/templates/YOUR_TEMPLATE_NAME/templates/tpl_returns_default.php

find:

<div class="mainContent success"><?php echo TEXT_SUCCESS; ?></div>

change to:

<div class="mainContent success"><?php echo TEXT_SUCCESS; ?><?php echo 'Your RMA# is: '; $order_number = $_GET['order_id']; echo $order_number;?></div>

Thats it, now your customers "Order Number" text field on the returns page will be pre-populated by the order_id from within the My Account > History > Order Info page & sent to the success page

Enjoy!

23 Apr 2013, 1:02 AM
#575
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Return Authorization Module (RMA)

DivaVocals:

Never paid attention to that, but YES the send button has always been on the success form.. It SHOULD NOT be there.. Somehow in scrubbing the code and fixing the form I missed that.. Will update my version and submit it to the downloads section..

How could you miss that? JUST KIDDING :P

Awesome job on the update, I am positive the zen community is grateful for all your hard work in updating Clyde's mods.

23 Apr 2013, 1:42 AM
#576
xspresso avatar

xspresso

New Zenner

Join Date:
Sep 2008
Posts:
22
Plugin Contributions:
0

Re: Return Authorization Module (RMA)

THANK YOU THANK YOU
rbarbour

The code below (mostly html) I placed in my tpl_returns_default.php
it brings back an rma# like below after the submission of the form.
Your RMA# is: 105309-31-5232013
(invoice no)-(random)-(date)

<!-- HERE-->
<?php
  if (isset($_GET['action']) && ($_GET['action'] == 'success')) {
?>
<br class="clearBoth" />

<div class="mainContent success"><!--HERE--><?php echo 'Your Invoice Order No.# is: '; $order_number = $_GET['order_id']; echo $order_number;?><h1> 
<BR><font size="4"><BR>Your RMA number is listed below.
<BR><BR>Please include the RMA No. on the outside of the box  to prevent delays in your RMA request. 
<BR><BR>Please read the 
<a target="_blank" href="/index.php?main_page=shippinginfo#returns">RMA Return Policy</a>.
</font>
<div align="center"></H1><BR><BR><BR><BR>
<table border="0" width="60%" bgcolor="#FFFFCC">
<tr>
<td>
<i>
<h3 align="center"><font color="#008000">Return the package to this address:</font><br>
 Healthy Symptoms, inc.
<br>
789 Any Street Unit 129 <br>
Port, Florida 34688
<br>
800-220-3130</h3>
<p align="center"><a target="_blank" href="/index.php?main_page=shippinginfo#returns">RMA RETURN POLICY</font></a> listed here.<br>
 </H3>
</font>
</i>
</p>
</td>
</tr>
</table>
</div>
</i>
<BR><BR><BR>
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="prevOrders">
<caption><h2><?php echo 'Your RMA# is: '; $order_number = $_GET['order_id']; echo $order_number;?>-<?php
srand(5);
echo(rand(1, 10));
echo(rand(1, 10));
?>-<script language="javascript">
<!--  
today = new Date().add({days: 31});  
document.write("", today.getMonth()+1,"",today.getDate(),"",today.getFullYear());  
//document.write("", today.getMonth()+1,"/",today.getDate(),"/",today.getFullYear());  //-->
</script> 

</h2></caption>
    <tr class="tableHeading">
    <th scope="col">Please read the RMA return policy before mailing package.</th>
  </tr>
</table> 
<!--HERE--></div>

<?php
  } else {
?>

<?php if (DEFINE_RETURNS_STATUS >= '1' and DEFINE_RETURNS_STATUS <= '2') { ?>
<div id="pageThreeMainContent">
<?php  
/**
 * require html_define for the Returns page
 */
require($define_page);
?>
</div>
<br class="clearBoth" />
<?php } ?>

<?php if ($messageStack->size('returns') > 0) echo $messageStack->output('returns'); ?>
<div class="content">
<h1> 
<BR>
<BR><BR>Please complete ALL information below to prevent delays in your RMA request. 
<BR><BR>Please read the RMA Return Policy.
<div align="center"></H1><BR><BR><BR><BR>
<table border="0" width="60%" bgcolor="#FFFFCC">
<tr>
<td>
<i>
<h3 align="center">To obtain an RMA No.<br>complete this form.</h3>
<p align="center"><a target="_blank" href="/index.php?main_page=shippinginfo#returns">RMA RETURN POLICY</font></a> listed here.</H3>
</font>
</i>
</p>
<p> </td>
</tr>
</table>
</div>
</i>
<table width="100%" border="0" cellpadding="0" cellspacing="0" id="prevOrders">
<caption><h2> </h2></caption>
    <tr class="tableHeading">
    <th scope="col">Submit this form to receive your RMA number.</th>
  </tr>
</table>
<!--HERE-->


<fieldset id="personal">
<legend><?php echo CONTACT_INFORMATION; ?></legend>

I kept getting errors when I included the address code in the success section so I removed it:

<?php if (RETURN_STORE_NAME_ADDRESS == 'true') { ?>
<address><?php echo nl2br(STORE_NAME_ADDRESS); ?></address>
<?php } ?>
23 Apr 2013, 2:11 AM
#577
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Return Authorization Module (RMA)

Your very welcome,

As far as the address code, you shouldn't have to display it within the success statement, it should automatically be there as long as your admin value = true

23 Apr 2013, 2:27 AM
#578
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Return Authorization Module (RMA)

I see why you want the address there

get rid of the javascript, replace with:

<?php echo date('mdY'); ?>
23 Apr 2013, 2:35 AM
#579
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Return Authorization Module (RMA)

rbarbour:

How could you miss that? JUST KIDDING :P

Awesome job on the update, I am positive the zen community is grateful for all your hard work in updating Clyde's mods.

hahahahaha!!!:laugh:

Thanks..:blush: To be honest I felt weird updating it.. Clyde was such a big contributor to the community.. So I was hesitant step my little feet into his BIG shoes..

23 Apr 2013, 2:42 AM
#580
rbarbour avatar

rbarbour

Totally Zenned

Join Date:
Feb 2010
Posts:
2,159
Plugin Contributions:
10

Re: Return Authorization Module (RMA)

DivaVocals:

hahahahaha!!!:laugh:

Thanks..:blush: To be honest I felt weird updating it.. Clyde was such a big contributor to the community.. So I was hesitant step my little feet into his BIG shoes..

Big shoes indeed, as the original author, his contributions will continue to serve and evolve with the community!