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

Return Authorization Module (RMA)

Views: 109,993

Results 601 to 620 of 644
29 Apr 2013, 8:25 PM
#601
xspresso avatar

xspresso

New Zenner

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

Return Authorization Module (RMA)

Glad that you were able to use all my rough code and ideas and turn them into useful code for others to use.

I noticed a problem,
when it is set to allow logged-in users only it works fine.
When not logged in it will not show the order_id or customer_id in the email, and no customer_id in the success page.

Now in my case I take phone orders and I don't add that customer to zen cart. But if a phone customer wants to return
an item I send them to the RMA form. Of course they don't have a customer number.

So I changed the following line in tpl_returns_default.php

'<div id="returnRMA">' . TEXT_SUCCESS_RMA_ID . $rma_number . '</div>'

To:

'<div id="returnRMA">' . TEXT_SUCCESS_RMA_ID; $order_number = $_GET['order_id']; echo $order_number . TEXT_SUCCESS_DASH . $cID . TEXT_SUCCESS_DASH . date('mdY') . '</div>'

And added:

<?php  echo '<input type="hidden" name="cID" value="'.$cID.'">'; ?>

Just under this line:

<?php  echo '<input type="hidden" name="rma_number" value="'.$rma_number.'">'; ?> 

In: header_php.php I added

   // Prepare extra-info details
           // Admin email returned after submission
    $extra_info = email_collect_extra_info($name, $email_address, $customer_name, $customer_email, $telephone);
    // Prepare Text-only portion of message
	$text_message = OFFICE_FROM . "\t" . $name . "\n<br />" . 
		    OFFICE_EMAIL . "\t" . $email_address . "\n<br />" .
			"Phone Number:" . "\t" .$telephone . "\n<br />" .
		    "Address:" . "\t" . $address . "\n<br />" .
		    "City:" . "\t" . $city . "\n<br />" .
			"State:" . "\t" . $state . "\n<br />" .
		    "Post Code:" . "\t" . $postcode . "\n<br />" .
			"Country:" . "\t" . $country . "\n<br />" .
		    "Order Number:" . "\t" . $order_number . "\n<br />" .
		    "Customer ID:" . "\t" . $cID . "\n<br />" .
		    "Total Value:" . "\t" . $value . "\n<br />" .
		    "Number of Items:" . "\t" . $item_number . "\n<br />"	.
		    "Item(s) Name:" . "\t" . $item_name . "\n<br />"	.
		    "Action Requested:" . "\t" . $action . "\n\n<br />"	.
[B][I]		     "RMA Number:" . "\t" . $order_number  . "-". $cID . "-". date('mdY') . "\n<br />" . [/I][/B]                  
			'------------------------------------------------------<br />' .
                   "\n\n<br />Reason:".    "\n\n<br />" .
                   "" . $reason .   "\n\n<br />" .

                  '------------------------------------------------------<br />' .  
      "" . "\n<br />" . 
     // Stop admin email
     // Begin customer email returned after submission
      $extra_info['TEXT'];
      $email_text = sprintf(EMAIL_GREET_NONE, $name );
      $email_text .=  "\n <br />";
      $email_text .=  EMAIL_WELCOME;
      $email_text .=  "\n\n" . "Request Date:" . "\t" . date('m/d/Y') . "<br />" ;
      $email_text .=  "\n" . "Customer ID:" . "\t" . $cID . "\n<br />";
      $email_text .=  "\n" . "Invoice Number:" . "\t" . $order_number . "<br />" ;
      $email_text .=  "\n" . "Item(s)You Are Returning:" ."\n (as you entered it)" . "\t" . $item_name . "\n\n<br />";
[B][I]      $email_text .=  "\n" . "RMA Number:" . "\t" . $order_number  . "-". $cID . "-". date('mdY') . "\n<br />";[/I][/B]
      $email_text .= "\n\n" . EMAIL_TEXT . "<br />";
      $email_text .= "\n" . EMAIL_CONTACT . "<br />";
      $email_text .= "\n" . EMAIL_WARNING. "\n<br />";

At the bottom of header_php.php

I removed this line

$rma_number = $order_number . TEXT_SUCCESS_DASH . $cID . TEXT_SUCCESS_DASH . $rma_request_date;

and added this line in it's place

$rma_number = $order_number . TEXT_SUCCESS_DASH . $rma_request_date;

it is just my idea of a work around, maybe you have something better?

Now when not logged in, the rma looks like this (2 dashes in center, missing customer_id)
Your RMA# is: 2425--04292013 and has the order_id in the email.

1 May 2013, 10:35 PM
#602
rbarbour avatar

rbarbour

Totally Zenned

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

Re: Return Authorization Module (RMA)

DivaVocals:

Now we're cookin' with Crisco!!! I'll bundle this up and submit.. BTW.. If I haven't said it... you're awesome. Been stalking..err.. I mean watching all the helpful stuff you've been posting.. good stuff..

Was this ever packaged and submitted?

1 May 2013, 10:38 PM
#603
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:

Was this ever packaged and submitted?

It's on my plan for this Friday when I am working from home.. I actually have three add-ons to update and upload..

1 May 2013, 11:24 PM
#604
rbarbour avatar

rbarbour

Totally Zenned

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

Re: Return Authorization Module (RMA)

DivaVocals:

It's on my plan for this Friday when I am working from home.. I actually have three add-ons to update and upload..

I made a few changes per the "glitch" xspresso found if customer is not logged in. I will try to post it here today, been so busy lately.

1 May 2013, 11:33 PM
#605
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:

I made a few changes per the "glitch" xspresso found if customer is not logged in. I will try to post it here today,** been so busy lately**.Tell me about it.. Cool.. I'll wait for you new code..

7 May 2013, 9:58 AM
#606
rbarbour avatar

rbarbour

Totally Zenned

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

Re: Return Authorization Module (RMA)

DivaVocals:

Tell me about it.. Cool.. I'll wait for you new code..

Sorry, this completely got overlooked over the weekend.

Here is the update.
in /includes/modules/pages/returns/header_php.php

find:

"RMA Number:" . "\t" . $rma_number . "<br />" .   

change to:

"RMA Number:" . "\t" . $order_number . $rma_number . "<br />" .  

then find:

$rma_number = $order_number . TEXT_SUCCESS_DASH . $cID . TEXT_SUCCESS_DASH . $rma_request_date;  

change to:

if($_SESSION['customer_id']) {
$rma_number = TEXT_SUCCESS_DASH . $cID . TEXT_SUCCESS_DASH . $rma_request_date;
} else {
$rma_number = TEXT_SUCCESS_DASH . $rma_request_date;
}

now in */includes/templates/YOUR_TEMPLATE/templates/tpl_returns_default.php *

find:

<div class="mainContent success">
<?php echo '<div id="returnSuccess">' . TEXT_SUCCESS . '</div>' . '<div id="returnRequired">'. TEXT_SUCCESS_RMA_REQUIRED . '</div>' . '<div id="returnPolicy">'. TEXT_SUCCESS_RMA_POLICY_BOF . '<a href="' . zen_href_link(FILENAME_SHIPPING, '', 'SSL') . '">' . TEXT_SUCCESS_RMA_POLICY_LINK . '</a>' . TEXT_SUCCESS_RMA_POLICY_EOF . '</div>' . '<div id="returnAddressWrapper">' . '<div id="returnRMA">' . TEXT_SUCCESS_RMA_ID . $rma_number . '</div>' . '<div id="returnAddress">' . TEXT_SUCCESS_RMA_RETURN_ADDRESS . '</div>'; if (RETURN_STORE_NAME_ADDRESS == 'true') { echo '<address>' . nl2br(STORE_NAME_ADDRESS) . '</address>'; } echo '<div id="returnPhone">' . TEXT_SUCCESS_RMA_RETURN_PHONE . '</div>' . '</div>'; ?>

change to:

<div class="mainContent success">
<?php 
if($_SESSION['customer_id']) {
$order_number = $_GET['order_id']; 
}
?>

<?php echo '<div id="returnSuccess">' . TEXT_SUCCESS . '</div>' . '<div id="returnRequired">'. TEXT_SUCCESS_RMA_REQUIRED . '</div>' . '<div id="returnPolicy">'. TEXT_SUCCESS_RMA_POLICY_BOF . '<a href="' . zen_href_link(FILENAME_SHIPPING, '', 'SSL') . '">' . TEXT_SUCCESS_RMA_POLICY_LINK . '</a>' . TEXT_SUCCESS_RMA_POLICY_EOF . '</div>' . '<div id="returnAddressWrapper">' . '<div id="returnRMA">' . TEXT_SUCCESS_RMA_ID . $order_number . $rma_number . '</div>' . '<div id="returnAddress">' . TEXT_SUCCESS_RMA_RETURN_ADDRESS . '</div>'; if (RETURN_STORE_NAME_ADDRESS == 'true') { echo '<address>' . nl2br(STORE_NAME_ADDRESS) . '</address>'; } echo '<div id="returnPhone">' . TEXT_SUCCESS_RMA_RETURN_PHONE . '</div>' . '</div>'; ?>

Changes above are for the code in post #600

if a customer is logged in

RMA = order_number-customer_id-date on success page and email

if a return is requested without being logged in

RMA - order_number-date on success page and email

7 May 2013, 1:03 PM
#607
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)

Cool beans.. I'll package this all up and get it submitted this week..:smile:

rbarbour:

Sorry, this completely got overlooked over the weekend.

Here is the update.
in /includes/modules/pages/returns/header_php.php

find:

"RMA Number:" . "\t" . $rma_number . "<br />" .

> 
> change to:
> ```php
"RMA Number:" . "\t" . $order_number . $rma_number . "<br />" .  

then find:

$rma_number = $order_number . TEXT_SUCCESS_DASH . $cID . TEXT_SUCCESS_DASH . $rma_request_date;

> 
> change to:
> ```php
if($_SESSION['customer_id']) {
$rma_number = TEXT_SUCCESS_DASH . $cID . TEXT_SUCCESS_DASH . $rma_request_date;
} else {
$rma_number = TEXT_SUCCESS_DASH . $rma_request_date;
}

now in */includes/templates/YOUR_TEMPLATE/templates/tpl_returns_default.php *

find:

<div class="mainContent success"> <?php echo '<div id="returnSuccess">' . TEXT_SUCCESS . '</div>' . '<div id="returnRequired">'. TEXT_SUCCESS_RMA_REQUIRED . '</div>' . '<div id="returnPolicy">'. TEXT_SUCCESS_RMA_POLICY_BOF . '<a href="' . zen_href_link(FILENAME_SHIPPING, '', 'SSL') . '">' . TEXT_SUCCESS_RMA_POLICY_LINK . '</a>' . TEXT_SUCCESS_RMA_POLICY_EOF . '</div>' . '<div id="returnAddressWrapper">' . '<div id="returnRMA">' . TEXT_SUCCESS_RMA_ID . $rma_number . '</div>' . '<div id="returnAddress">' . TEXT_SUCCESS_RMA_RETURN_ADDRESS . '</div>'; if (RETURN_STORE_NAME_ADDRESS == 'true') { echo '<address>' . nl2br(STORE_NAME_ADDRESS) . '</address>'; } echo '<div id="returnPhone">' . TEXT_SUCCESS_RMA_RETURN_PHONE . '</div>' . '</div>'; ?> ``` > > change to: > ```php <div class="mainContent success"> <?php if($_SESSION['customer_id']) { $order_number = $_GET['order_id']; } ?> <?php echo '<div id="returnSuccess">' . TEXT_SUCCESS . '</div>' . '<div id="returnRequired">'. TEXT_SUCCESS_RMA_REQUIRED . '</div>' . '<div id="returnPolicy">'. TEXT_SUCCESS_RMA_POLICY_BOF . '<a href="' . zen_href_link(FILENAME_SHIPPING, '', 'SSL') . '">' . TEXT_SUCCESS_RMA_POLICY_LINK . '</a>' . TEXT_SUCCESS_RMA_POLICY_EOF . '</div>' . '<div id="returnAddressWrapper">' . '<div id="returnRMA">' . TEXT_SUCCESS_RMA_ID . $order_number . $rma_number . '</div>' . '<div id="returnAddress">' . TEXT_SUCCESS_RMA_RETURN_ADDRESS . '</div>'; if (RETURN_STORE_NAME_ADDRESS == 'true') { echo '<address>' . nl2br(STORE_NAME_ADDRESS) . '</address>'; } echo '<div id="returnPhone">' . TEXT_SUCCESS_RMA_RETURN_PHONE . '</div>' . '</div>'; ?>
> 
> Changes above are for the code in post #600
> 
> if a customer is logged in
> 
> RMA = order_number-customer_id-date on success page and email
> 
> if a return is requested without being logged in
> 
> RMA - order_number-date on success page and email
7 May 2013, 4:18 PM
#608
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

Re: Return Authorization Module (RMA)

For ease of reference, I also append the order number to the email subject by adding the following to includes\modules\pages\returns\header_php.php

// adds order number to email subject
	$email_subject = EMAIL_SUBJECT . ' #' . $order_number;


// Send message
	zen_mail($name, $email_address, $email_subject, $email_text, $send_to_name, $send_to_email, $html_msg, 'returns');
    $html_msg['EMAIL_MESSAGE_HTML'] = $text_message;
    $html_msg['EMAIL_GREETING'] = '';
	$html_msg['EMAIL_WELCOME'] = '';
    $html_msg['CONTACT_US_OFFICE_FROM'] = OFFICE_FROM . ' ' . $name . '<br />' . OFFICE_EMAIL . '(' . $email_address . ')';
    $html_msg['EXTRA_INFO'] = '';
	  
	zen_mail($send_to_name, $send_to_email, $email_subject, $text_message, $name, $email_address, $html_msg, 'returns');

One could also append an RMA number to the email subject as per the following:

$email_subject = EMAIL_SUBJECT . ' #' . $order_number  . ' - ' . $rma_number;

which would appear as:

Subject: RMA #1234 - 1

Cheers

7 May 2013, 7:20 PM
#609
rbarbour avatar

rbarbour

Totally Zenned

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

Re: Return Authorization Module (RMA)

dw08gm:

For ease of reference, I also append the order number to the email subject by adding the following to includes\modules\pages\returns\header_php.php

That's a great idea, I have been playing with this mod for awhile, mainly the admin & catalog side of it.

I have managed to per the post - update the order_status within the admin with help from @DivaVocals.

I have added additional features that I haven't posted such as:

1.) posting the "reasons text" back to admin>customers>orders>customers_comments
2.) posting the "RMA#" back to admin>customers>orders
3.) re-wrote the code for the entire "email sent" to both admin & customer to better display form fields

Curious if these functions would be useful to anyone else?

7 May 2013, 7:27 PM
#610
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:

That's a great idea, I have been playing with this mod for awhile, mainly the admin & catalog side of it.

I have managed to per the post - update the order_status within the admin with help from @DivaVocals.

I have added additional features that I haven't posted such as:

1.) posting the "reasons text" back to admin>customers>orders>customers_comments
2.) posting the "RMA#" back to admin>customers>orders
3.) re-wrote the code for the entire "email sent" to both admin & customer to better display form fields

Curious if these functions would be useful to anyone else?

Ummm HELLS yeah!!! Share.. Let's make Clyde proud and take this module to the next level!!!

8 May 2013, 3:50 PM
#611
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

Re: Return Authorization Module (RMA)

A few more suggestions

  1. Return Button
    Actually, the need for a button, and hence edits to button_names.php, can be dispensed with by replacing the following line in includes\templates\YourTemplate\templates\tpl_account_history_info_default.php
<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>

with something similar to:

<!-- bof RMA Button #600 -->
<p><?php echo '<strong>Returns</strong><br />If you wish to return any of the above items to us, please do not send any items before <a href="' . zen_href_link(FILENAME_RETURNS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'order_id=' . $_GET['order_id'], 'SSL') . '">obtaining our authorisation</a>.'; ?></p>
<!-- bof RMA Button #600 -->

Of course, the text component could be turned into a define placed in \includes\languages\english\YourTemplate\account_history_info.php (override file).

  1. In includes\templates\YourTemplate\templates\tpl_returns_default.php,
    a)the "required" options can be dispensed with in favour of the more simple approach (ie input is either required or not)

Compare this

<label class="inputLabel" for="contactname"><?php echo (($error == true && $entry_name_error == true) ?  ENTRY_NAME . 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_NAME . 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_name_error == true) ? zen_draw_input_field('contactname', $name, ' size="20" id="contactname"') . ENTRY_NAME_ERROR : zen_draw_input_field('contactname', $name, ' size="20" id="contactname"')); ?>

to this

<label class="inputLabel" for="contactname"><?php echo ENTRY_NAME . '<span class="reqd">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?></label>
<?php echo zen_draw_input_field('contactname', zen_output_string_protected($name), ' size="46" id="contactname" onchange="capitalize(this,1);"'); ?>

The latter even includes code from the Capitalize_Signup_Fields mod, although IIRC Plugins mispells capitalize.

b) the send button can be replaced by the submit button as per the following:

<div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SUBMIT, BUTTON_SUBMIT_ALT); ?></div>

c) the following success message was way too much work for me

<div class="mainContent success">
<?php echo '<div id="returnSuccess">' . TEXT_SUCCESS . '</div>' . '<div id="returnRequired">'. TEXT_SUCCESS_RMA_REQUIRED . '</div>' . '<div id="returnPolicy">'. TEXT_SUCCESS_RMA_POLICY_BOF . '<a href="' . zen_href_link(FILENAME_SHIPPING, '', 'SSL') . '">' . TEXT_SUCCESS_RMA_POLICY_LINK . '</a>' . TEXT_SUCCESS_RMA_POLICY_EOF . '</div>' . '<div id="returnAddressWrapper">' . '<div id="returnRMA">' . TEXT_SUCCESS_RMA_ID . $rma_number . '</div>' . '<div id="returnAddress">' . TEXT_SUCCESS_RMA_RETURN_ADDRESS . '</div>'; if (RETURN_STORE_NAME_ADDRESS == 'true') { echo '<address>' . nl2br(STORE_NAME_ADDRESS) . '</address>'; } echo '<div id="returnPhone">' . TEXT_SUCCESS_RMA_RETURN_PHONE . '</div>' . '</div>'; ?>

which I simplified to

<?php echo TEXT_SUCCESS . TEXT_SUCCESS_RMA_REFERENCE . '<strong>' . $order_number . $rma_number . '</strong><br /><br /><br />' . TEXT_SUCCESS_RMA_THANKS; ?>

with corresponding defines in \includes\languages\english\YourTeplate\returns.php reduced to:

define('TEXT_SUCCESS', 'Your request was successfully submitted and a confirmation email has been sent to your email address.<br /><br />We will review your request and respond as soon as practicable. If you do not hear from us within seven (7) days, please <a href="index.php?main_page=contact_us">prompt us</a> before re-submitting your request.<br /><br />Our Returns Policy is contained in our <a href="index.php?main_page=terms_of_sale">Terms of Sale</a>.<br /><br />If you have any comments, queries or concerns regarding our Returns Policy, please <a href="index.php?main_page=contact_us">let us know</a>.<br /><br /><br />');

define('TEXT_SUCCESS_RMA_REFERENCE', 'Your reference number for this request is: ');

define('TEXT_SUCCESS_RMA_THANKS', 'Thank you for your feedback.<br /><br />');
  1. In \includes\modules\pages\returns\header_php.php, the date format "mdY" can be changed as commented in the following snippet
$rma_request_date = date('mdY'); // Ymd or even Ymd H:i:s

Cheers

8 May 2013, 4:54 PM
#612
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)

Some of your suggestions removes some of the flexibility Clyde was trying to build in..

  1. Button versus a link on the account histroy page, the inclusion of this code should be a flexible admin configurable choice IMHO. I'll take a look at how to make that so.. Anfd the text should DEFINITELY not be hard coded in.. It should be in a proper language definition file.
  2. Regarding item #2 (mods to** includes\templates\YourTemplate\templates\tpl_returns_default.php**, and \includes\languages\english\YourTeplate\returns.php)
  • The extra code Clyde included is for form error validation. Not sure from a usability POV that this should change. Clyde is not here to confirm this, but from a usability POV, I can only assume he felt that it made more sense to put the field level error messages next to each field versus including them all in the message stack. He opted instead for a simpler single message stack error message with field level error messages.
  • It would be a less than satisfying user experience to present the shopper with only one error message "Errors have occured on your submission! Please correct and re-submit" without indicating WHICH field is in error, and HOPING they will "figure it out" based on a simple "Required" symbol. Clyde's approach eliminates the possiblity of user frustration and lends to a better user experience.
  • I'm not sure that the the code from the **Capitalize_Signup_Fields **mod should be included.. Seems more of a personal choice and as much as possible I'm a BIG proponent that modules should be flexible. Not sure it's practical to make this an admin configurable option either, but I will take a look.. Honestly if folks want this feature they really should just install the **Capitalize_Signup_Fields **mod themselves
  • Replacing the send button with the submit button.. I'll have to look at this and see how the contact form is configure.. at the very LEAST the RMA form and the contact form should use the same submit/send button.
  • Will take a look at the returns message.. Again, Clyde is not here to confirm what he did, but given the code, it appears he was leaning towards a more flexible solution by giving the admin more options to control the look and feel.. Your changes are a personal choice, and while I don't think they should be part of the codebase, perhaps I could take a look to see if the current options could allow a shopowner to make similar changes without removing ALL of the current code as you have done or provide the means for shopowners to make similar changes if the current codebase won't accomodate this. there are folks who have been using this module who LIKE the returns message the way it is.. This module should support choices and flexibility with regards to look and feel.
  1. Adding the comment is a good idea.. I will also include this in the readme as not all shopowners (especially the DIYers) are going to KNOW to look for this comment. It might even be a BETTER idea to try and make this an admin configurable option so that DIYer shopowners don't HAVE to mess with the code to make this change..

dw08gm:

A few more suggestions

  1. Return Button
    Actually, the need for a button, and hence edits to button_names.php, can be dispensed with by replacing the following line in includes\templates\YourTemplate\templates\tpl_account_history_info_default.php
<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> ``` > > with something similar to: > > ``` <!-- bof RMA Button #600 --> <p><?php echo '<strong>Returns</strong><br />If you wish to return any of the above items to us, please do not send any items before <a href="' . zen_href_link(FILENAME_RETURNS, (isset($_GET['page']) ? 'page=' . $_GET['page'] . '&' : '') . 'order_id=' . $_GET['order_id'], 'SSL') . '">obtaining our authorisation</a>.'; ?></p> <!-- bof RMA Button #600 --> ``` > > Of course, the text component could be turned into a define placed in \includes\languages\english\YourTemplate\account_history_info.php (override file). > > > > 2) In includes\templates\YourTemplate\templates\tpl_returns_default.php, > a)the "required" options can be dispensed with in favour of the more simple approach (ie input is either required or not) > > Compare this > > ``` <label class="inputLabel" for="contactname"><?php echo (($error == true && $entry_name_error == true) ? ENTRY_NAME . 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_NAME . 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_name_error == true) ? zen_draw_input_field('contactname', $name, ' size="20" id="contactname"') . ENTRY_NAME_ERROR : zen_draw_input_field('contactname', $name, ' size="20" id="contactname"')); ?> ``` > > to this > > ``` <label class="inputLabel" for="contactname"><?php echo ENTRY_NAME . '<span class="reqd">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?></label> <?php echo zen_draw_input_field('contactname', zen_output_string_protected($name), ' size="46" id="contactname" onchange="capitalize(this,1);"'); ?> ``` > > The latter even includes code from the Capitalize_Signup_Fields mod, although IIRC Plugins mispells capitalize. > > > b) the send button can be replaced by the submit button as per the following: > > ``` <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_SUBMIT, BUTTON_SUBMIT_ALT); ?></div> ``` > > > c) the following success message was way too much work for me > > ``` <div class="mainContent success"> <?php echo '<div id="returnSuccess">' . TEXT_SUCCESS . '</div>' . '<div id="returnRequired">'. TEXT_SUCCESS_RMA_REQUIRED . '</div>' . '<div id="returnPolicy">'. TEXT_SUCCESS_RMA_POLICY_BOF . '<a href="' . zen_href_link(FILENAME_SHIPPING, '', 'SSL') . '">' . TEXT_SUCCESS_RMA_POLICY_LINK . '</a>' . TEXT_SUCCESS_RMA_POLICY_EOF . '</div>' . '<div id="returnAddressWrapper">' . '<div id="returnRMA">' . TEXT_SUCCESS_RMA_ID . $rma_number . '</div>' . '<div id="returnAddress">' . TEXT_SUCCESS_RMA_RETURN_ADDRESS . '</div>'; if (RETURN_STORE_NAME_ADDRESS == 'true') { echo '<address>' . nl2br(STORE_NAME_ADDRESS) . '</address>'; } echo '<div id="returnPhone">' . TEXT_SUCCESS_RMA_RETURN_PHONE . '</div>' . '</div>'; ?> ``` > > which I simplified to > > ``` <?php echo TEXT_SUCCESS . TEXT_SUCCESS_RMA_REFERENCE . '<strong>' . $order_number . $rma_number . '</strong><br /><br /><br />' . TEXT_SUCCESS_RMA_THANKS; ?> ``` > > with corresponding defines in \includes\languages\english\YourTeplate\returns.php reduced to: > > ``` define('TEXT_SUCCESS', 'Your request was successfully submitted and a confirmation email has been sent to your email address.<br /><br />We will review your request and respond as soon as practicable. If you do not hear from us within seven (7) days, please <a href="index.php?main_page=contact_us">prompt us</a> before re-submitting your request.<br /><br />Our Returns Policy is contained in our <a href="index.php?main_page=terms_of_sale">Terms of Sale</a>.<br /><br />If you have any comments, queries or concerns regarding our Returns Policy, please <a href="index.php?main_page=contact_us">let us know</a>.<br /><br /><br />');

define('TEXT_SUCCESS_RMA_REFERENCE', 'Your reference number for this request is: ');

define('TEXT_SUCCESS_RMA_THANKS', 'Thank you for your feedback.<br /><br />');

> 
> 
> 
> 3) In \includes\modules\pages\returns\header_php.php, the date format "mdY" can be changed as commented in the following snippet
> 
> ```
$rma_request_date = date('mdY'); // Ymd or even Ymd H:i:s

Cheers

8 May 2013, 5:42 PM
#613
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

Re: Return Authorization Module (RMA)

DivaVocals:

Some of your suggestions removes some of the flexibility Clyde was trying to build in..

  1. Button versus a link on the account histroy page, the inclusion of this code should be a flexible admin configurable choice IMHO. I'll take a look at how to make that so.. Anfd the text should DEFINITELY not be hard coded in.. It should be in a proper language definition file.
  1. Regarding item #2 (mods to** includes\templates\YourTemplate\templates\tpl_returns_default.php**, and \includes\languages\english\YourTeplate\returns.php)
  • The extra code Clyde included is for form error validation. Not sure from a usability POV that this should change. Clyde is not here to confirm this, but from a usability POV, I can only assume he felt that it made more sense to put the field level error messages next to each field versus including them all in the message stack. He opted instead for a simpler single message stack error message with field level error messages.
  • It would be a less than satisfying user experience to present the shopper with only one error message "Errors have occured on your submission! Please correct and re-submit" without indicating WHICH field is in error, and HOPING they will "figure it out" based on a simple "Required" symbol. Clyde's approach eliminates the possiblity of user frustration and lends to a better user experience.
  • I'm not sure that the the code from the **Capitalize_Signup_Fields **mod should be included.. Seems more of a personal choice and as much as possible I'm a BIG proponent that modules should be flexible. Not sure it's practical to make this an admin configurable option either, but I will take a look.. Honestly if folks want this feature they really should just install the **Capitalize_Signup_Fields **mod themselves
  • Replacing the send button with the submit button.. I'll have to look at this and see how the contact form is configure.. at the very LEAST the RMA form and the contact form should use the same submit/send button.
  • Will take a look at the returns message.. Again, Clyde is not here to confirm what he did, but given the code, it appears he was leaning towards a more flexible solution by giving the admin more options to control the look and feel.. Your changes are a personal choice, and while I don't think they should be part of the codebase, perhaps I could take a look to see if the current options could allow a shopowner to make similar changes without removing ALL of the current code as you have done or provide the means for shopowners to make similar changes if the current codebase won't accomodate this. there are folks who have been using this module who LIKE the returns message the way it is.. This module should support choices and flexibility with regards to look and feel.
  1. Adding the comment is a good idea.. I will also include this in the readme as not all shopowners (especially the DIYers) are going to KNOW to look for this comment. It might even be a BETTER idea to try and make this an admin configurable option so that DIYer shopowners don't HAVE to mess with the code to make this change..

Clyde added a whole lot of things more to satisfy requests from individuals rather than as great leaps forwards. The error messaging and required options thingies should also be considered personal choice things, as neither really improved existing functionality. As I am not into change for change sake, and prefer simplicity over bells and whistles, I begrudgingly had to spend a few days restoring the latest offerings of this mod to what I had and liked with RMA 2.3.2/2.3.3.

Yes, Capitalize_Signup_Fields is entirely optional. It was only included in my post because it was already in my code. I tend to fill out and send forms all in lowercase, and find auto-capitalisation helpful in scanning for input errors.

One thing I would like to know, however, is whether the following highlighted code is entirely necessary, as I cannot recall exactly where it came from, except that it was around 139h days.

<label class="inputLabel" for="contactname"><?php echo ENTRY_NAME . '<span class="reqd">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?></label>
<?php echo zen_draw_input_field('contactname', zen_output_string_protected($name), ' size="46" id="contactname" onchange="capitalize(this,1);"'); ?>

Cheers

8 May 2013, 5:52 PM
#614
rbarbour avatar

rbarbour

Totally Zenned

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

Re: Return Authorization Module (RMA)

DivaVocals:

Some of your suggestions removes some of the flexibility Clyde was trying to build in..

  1. Button versus a link on the account histroy page, the inclusion of this code should be a flexible admin configurable choice IMHO. I'll take a look at how to make that so.. Anfd the text should DEFINITELY not be hard coded in.. It should be in a proper language definition file.
  1. Regarding item #2 (mods to** includes\templates\YourTemplate\templates\tpl_returns_default.php**, and \includes\languages\english\YourTeplate\returns.php)
  • The extra code Clyde included is for form error validation. Not sure from a usability POV that this should change. Clyde is not here to confirm this, but from a usability POV, I can only assume he felt that it made more sense to put the field level error messages next to each field versus including them all in the message stack. He opted instead for a simpler single message stack error message with field level error messages.
  • It would be a less than satisfying user experience to present the shopper with only one error message "Errors have occured on your submission! Please correct and re-submit" without indicating WHICH field is in error, and HOPING they will "figure it out" based on a simple "Required" symbol. Clyde's approach eliminates the possiblity of user frustration and lends to a better user experience.
  • I'm not sure that the the code from the Capitalize_Signup_Fields mod should be included.. Seems more of a personal choice and as much as possible I'm a BIG proponent that modules should be flexible. Not sure it's practical to make this an admin configurable option either, but I will take a look.. Honestly if folks want this feature they really should just install the Capitalize_Signup_Fields mod themselves
  • Replacing the send button with the submit button.. I'll have to look at this and see how the contact form is configure.. at the very LEAST the RMA form and the contact form should use the same submit/send button.
  • Will take a look at the returns message.. Again, Clyde is not here to confirm what he did, but given the code, it appears he was leaning towards a more flexible solution by giving the admin more options to control the look and feel.. Your changes are a personal choice, and while I don't think they should be part of the codebase, perhaps I could take a look to see if the current options could allow a shopowner to make similar changes without removing ALL of the current code as you have done or provide the means for shopowners to make similar changes if the current codebase won't accomodate this. there are folks who have been using this module who LIKE the returns message the way it is.. This module should support choices and flexibility with regards to look and feel.
  1. Adding the comment is a good idea.. I will also include this in the readme as not all shopowners (especially the DIYers) are going to KNOW to look for this comment. It might even be a BETTER idea to try and make this an admin configurable option so that DIYer shopowners don't HAVE to mess with the code to make this change..

**Agree - and easily accomplished as an admin setting.

Agree - customer friendly and no "guessing" involved.

****Agree - it is a separate mod, let's keep it that way.

Agree - the send button is "stock code" on the contact us page, shows consistency between form pages.

100% Agree - Every module can be changed to the users personal preference but the "core" should serve the vast majority.

Agree - any text that the module creates whether it be on the order-history, returns or success pages can be easily added as an admin option where it can be changes to the users personal preference.

**This mod in the last week or so has came along way and suggestions and opinions will only make it that much greater.

8 May 2013, 5:56 PM
#615
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:

This mod in the last week or so has came along way and suggestions and opinions will only make it that much greater.I agree..

8 May 2013, 6:02 PM
#616
rbarbour avatar

rbarbour

Totally Zenned

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

Re: Return Authorization Module (RMA)

dw08gm:

Clyde added a whole lot of things more to satisfy requests from individuals rather than as great leaps forwards. The error messaging and required options thingies should also be considered personal choice things, as neither really improved existing functionality. As I am not into change for change sake, and prefer simplicity over bells and whistles, I begrudgingly had to spend a few days restoring the latest offerings of this mod to what I had and liked with RMA 2.3.2/2.3.3.

After looking at a dozen or so RMA Request forms, IMHO, I would say Clyde nailed it with his choices as to which fields needed to be required and which should be optional.

dw08gm:

One thing I would like to know, however, is whether the following highlighted code is entirely necessary, as I cannot recall exactly where it came from, except that it was around 139h days.

<label class="inputLabel" for="contactname"><?php echo ENTRY_NAME . '<span class="reqd">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?></label>

<?php echo zen_draw_input_field('contactname', zen_output_string_protected($name), ' size="46" id="contactname" onchange="capitalize(this,1);"'); ?>

I don't recall ever seeing that code in any version.
8 May 2013, 6:22 PM
#617
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)

dw08gm:

Clyde added a whole lot of things more to satisfy requests from individuals rather than as great leaps forwards. The error messaging and required options thingies should also be considered personal choice things, as neither really improved existing functionality.Respectfully I do disagree with you..

Clyde had had solid knowledge of what makes for good usability. It is reflected in his choice to make the validation errors appear at the field level instead of the message stack.

In form validation it IMPROVES usability if you INFORM users of WHICH fields they missed in filling out a form.. Your proposed changes will REMOVE that functionality leaving them to GUESS which field they missed.. There are 10 required fields on an RMA form.. Adding multiple error messages to the message stack is not a good option from a usability POV. Highlighting the MISSED fields with a clear on-screen message is following good usability practices. I believe this is what Clyde was attempting to achieve. Your suggested code not only removes the usability aspect, but it leaves the customer guessing which field is the offending field. Do not assume that it's OBVIOUS. It's only somewhat obvious which fields are required.. what's not obvious is which field failed the validation.. and without a specific error message guiding the end user, this will lead to a frustrating user experience..

Clearly you do not agree, and that's fine..

dw08gm:

As I am not into change for change sake, and prefer simplicity over bells and whistles, I begrudgingly had to spend a few days restoring the latest offerings of this mod to what I had and liked with RMA 2.3.2/2.3.3.It's your choice of course..

dw08gm:

Yes, Capitalize_Signup_Fields is entirely optional. It was only included in my post because it was already in my code. I tend to fill out and send forms all in lowercase, and find auto-capitalisation helpful in scanning for input errors.Right.. again it's a seperate mod and if someone really wants the feature, they should install the mod..

dw08gm:

One thing I would like to know, however, is whether the following highlighted code is entirely necessary, as I cannot recall exactly where it came from, except that it was around 139h days.

<label class="inputLabel" for="contactname"><?php echo ENTRY_NAME . '<span class="reqd">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?></label>

<?php echo zen_draw_input_field('contactname', zen_output_string_protected($name), ' size="46" id="contactname" onchange="capitalize(this,1);"'); ?>
> 
> CheersAt work.. can't see this.. don't recall this code specifically..
8 May 2013, 11:28 PM
#618
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)

dw08gm:

One thing I would like to know, however, is whether the following highlighted code is entirely necessary, as I cannot recall exactly where it came from, except that it was around 139h days.

<label class="inputLabel" for="contactname"><?php echo ENTRY_NAME . '<span class="reqd">' . ENTRY_REQUIRED_SYMBOL . '</span>'; ?></label>

<?php echo zen_draw_input_field('contactname', zen_output_string_protected($name), ' size="46" id="contactname" onchange="capitalize(this,1);"'); ?>
> 
> Cheers
I've looked at both v2.3.3 and v2.3.3a and v2.3.2. This code doesn't exist in any of these versions.. Given that you cherrypicked out the changes you wanted and customized RMA, it's seems likely that this is possibly code you introduced into your files..
10 May 2013, 6:34 AM
#619
dw08gm avatar

dw08gm

Totally Zenned

Join Date:
Sep 2008
Location:
DownUnder, overlooking South Pole.
Posts:
1,016
Plugin Contributions:
2

Re: Return Authorization Module (RMA)

Re: zen_output_string_protected

The function has to do with averting "sql-injection" and "XSS vulnerability" in Zen Cart.

The function is still widely used in 151 on both admin and catalog sides, including a small number of header_php.php and tpl_whatever_default.php files on catalog side, including tpl_account_history_info_default.php.

However I remain unsure whether it should be applied to the RMA files, or any form-producing files for that matter, but suspect it should where inputs are extracted from or written to the database by the form files, or where other interacting files or mod, such as tpl_account_history or Email_Archive_Manager, are involved. However, its presence does not seem to affect the processing of the forms.

I found this thread dating from 25 October 2008, although it is unclear to me whether the parts highlighted are relevant to RMA.
http://www.zen-cart.com/showthread.php?111519-Attribs-zen_output_string_protected
Post 3 Dr Byte

If the customer has entered text information for an attribute field such as a filename or a text-input field, if that information is to be displayed again for verification/edit, you certainly want that information sanitized before it's displayed.

Would the redisplay of inputs (eg info inserted into RMA form fields from database, eg oID, name), say in going from the account_history_info_default to the RMA page, or proceeding from input to error checking to error correction in the RMA page, constitute a "displayed again for verification/edit" case?

Post 7 Dr Byte

I would think that the output-protected approach should be run anytime the content of user-collected data is being re-displayed, so that if any sql-injection or other attack would be averted.

Would the redisplay of inputs (eg info inserted into RMA form fields from database, eg oID, name), say in going from the account_history_info_default to the RMA page, or proceeding from input to error checking to error correction in the RMA page, constitute an "output-protected approach should be run anytime the content of user-collected data is being re-displayed" case?

Post 9 Dr Byte

Will have to do some further investigation. Here's a related post: http://www.zen-cart.com/forum/showthread.php?t=64115

This last thread dates from 25 April 2007 and specifically refers to XSS vulnerability in and provides fixes for Zen Cart 1.3.7 (and prior versions).

Re: error messaging
I found displaying error messaging within the form, as opposed to displaying same within a message stack, disrupts the layout of the form - with longer error messages causing greater disruption - which can make the overall form difficult to rescan for errors or alterations.

As online forms and associated error message stacks have been around for ages, I am sure the majority of internet users are quite familiar with navigating their way through them. So from my long experience, displaying error messaging within the form is just a change for change sake.

Let us not lose sight of the fact that we are only talking about a Returns form that is applied post-purchase. Sure, it may be convenient for customer relations, but displaying error messaging within a form does not provide for greater sales.

cheers

10 May 2013, 7:13 AM
#620
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)

dw08gm:

As online forms and associated error message stacks have been around for ages, I am sure the majority of internet users are quite familiar with navigating their way through them. So from my long experience, displaying error messaging within the form is just a change for change sake.

Let us not lose sight of the fact that we are only talking about a Returns form that is applied post-purchase. Sure, it may be convenient for customer relations, but displaying error messaging within a form does not provide for greater sales.

cheersIt does provide for BETTER usability.. It's a frustrating user experience to fill out a form only to find out that it's missing data, and to have NO indication what the issue is... You cannot assume that people will just KNOW and figure it out because you assume that they SHOULD know.

Again we'll have to agree to disagree.. A returns form by it's very nature isn't helping sales, so I fail to see how providing the end user some indication that the form is not filled out correctly correlates to sales.. Displaying a generic validation message without ANY indication where the error in fact lies is not a great user experience.. In my long experience working in software development, when a form is submitted without all the required information you do need to display some indication to the end user where that error lies.. You call it change for change sake, but improving user experience is not in my opinion a bad thing..

Again clearly you do not agree with this logic..