Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Contribution "Add comment to order"?


arames

Recommended Posts

If you have the latest 2.2 you HAVE comments. Go through the COMPLETE checkout process... on the last page there will be a box saying

 

'enter any comments you might have on this order here'

 

or something...

 

Try it :D

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

I've seen this confusion before.

 

If I as a customer had some concern or special instructions to give I would most likely choose to do so before entering any payment information, not afterwards. If I saw no field before I was asked for payment I would cancel my sale.

 

Was this discussed already? Was it moved for aesthetic or functional reasons when the new checkout process was implemented?

 

Thanks.

Link to comment
Share on other sites

That's a good point as it used to be right below the payment options.

From a sales point of view it would indeed be a lot better if it was moved back into the actual checkout process...

 

Mattice

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

I agree with Mattice and others that customers are more comfortable being able to enter the comments earlier in the checkout process, and a few customers have gone to the trouble of mentioning it to us.

 

My review of the pre-11/1 code shows that the comment was entered in checkout_payment.php, passed as a post variable to checkout_confirmation.php, which registered it as a session variable, then it was saved with the other fields when the order record was created. Now, it is just added as an update to the existing order record if entered in checkout_success.

 

So, we could move the comment entry back to an earlier point and register it as a session variable. Then it could be displayed in checkout_success, with a final opportunity for the customer to revise it before it is saved in the order record. Who wants to propose the coding?

Link to comment
Share on other sites

Was this discussed already?  Was it moved for aesthetic or functional reasons when the new checkout process was implemented?

 

When Ian's Credit Class work is integrated into the project, there would have been too much information shown to the customer on this one page.

 

Originally the textarea box was moved to the Checkout Confirmation page however due to the flexibility of the modules, depending on which module is installed and used the information could have been lost if the form on the confirmation page was sent to the payment processor server.

 

It is possible to have the textarea box on the Confirmation page however the modules requiring to make a request to another server via HTTPS POST would need to be done via Curl or using native SSL features in the upcoming PHP 4.3 release - something which would have broken compatibility between servers.

 

This is why it was moved to the Checkout Success page.

 

By using Curl, the form method on the confirmation page would be taken to the processing page (checkout_process.php) where the request to the payment processor would be done in the before_process() payment class method.

:heart:, osCommerce

Link to comment
Share on other sites

Well in that case the solution would be to only show it in confirmation if the client isn't taken to another site which is easy:

 

Change

<?php

 if (isset($$payment->form_action_url)) {

   $form_action_url = $$payment->form_action_url;

 } else {

   $form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');

 }



 echo tep_draw_form('checkout_confirmation', $form_action_url, 'post');



 if (is_array($payment_modules->modules)) {

   echo $payment_modules->process_button();

 }



 echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . '</form>' . "n";

?>

 

to this:

<?php

 if (isset($$payment->form_action_url)) {

   $form_action_url = $$payment->form_action_url;

 } else {

   $form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');

// flag it baby..

$flag = 1;

 }



 echo tep_draw_form('checkout_confirmation', $form_action_url, 'post');



/* 

if we're not connecting to an external server add comment box

*/

if ($flag) {

echo "n" . '<!-- comment box -->' . "n";

?>    

     </td></tr>

      <tr>

       <td><table border="0" width="100%" cellspacing="1" cellpadding="6" class="infoBox">

         <tr class="infoBoxContents">

           <td class="main"><?php echo tep_draw_textarea_field('comment', 'virtual', '60', '5'); ?></td>

         </tr>

       </table></td>

     </tr>

       <td align="right" class="main">



<?php

echo "n" . '<!-- comment box EOF //-->' . "n";



 // transport our flag

  echo tep_draw_hidden_field('flag', '1');

}

/*

end of optional comment box add

*/

 



 if (is_array($payment_modules->modules)) {

   echo $payment_modules->process_button();

 }



 echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . '</form>' . "n";

?>

 

then in checkout_process.php change:

'comments' => $order->info['comments'],

to

'comments' => stripslashes($HTTP_POST_VARS['comments']),

 

Then in catalog/checkout_success.php change:

       <td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

     </tr>

     <tr>

       <td><table border="0" width="100%" cellspacing="1" cellpadding="6" class="infoBox">

         <tr class="infoBoxContents">

           <td class="main"><?php echo tep_draw_textarea_field('comment', 'virtual', '60', '5'); ?></td>

         </tr>

       </table></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

     </tr>

     <tr>

       <td align="right" class="main"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

     </tr>

 

to this

 

<?php

// check flag

if ($HTTP_POST_VARS['flag'] == '1') {

?>

       <td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

     </tr>

     <tr>

       <td><table border="0" width="100%" cellspacing="1" cellpadding="6" class="infoBox">

         <tr class="infoBoxContents">

           <td class="main"><?php echo tep_draw_textarea_field('comment', 'virtual', '60', '5'); ?></td>

         </tr>

       </table></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

     </tr>

     <tr>

       <td align="right" class="main"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>

     </tr>

     <tr>

       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

     </tr>

<?php

// end flag check



}



?>

 

Let me know what you think. Are there any drawbacks I have missed?

(I don't use any external payment processors so I don't know what effects they might have)

 

Regards,

Mattice

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

works here... are you using anything payment-wise that connects to a site outside your own domain ie PayPal / authorize.net etc?

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

just looked at my post again but I can not see any differences with the actual code in my files... (although it is getting late :shock: )

 

Did you change the comments bit in checkout_process.php?

That stores the comments in the database. It should be the long big list of all the things that get inserted... can't really miss it.

 

HTH

Mattice

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

Got it now, for some reason that last line needed to be

'comments' => stripslashes($HTTP_POST_VARS['comment']),

even though it is 'comments' in the original checkout_process.php

It now works but what would be even be better would be if the "add comments" box could be on the checkout_payment.php page, is that possible? it does not matter for me about testing if an external payment proccessor is used because we only use the credit card module.

Best wishes

Steve

Link to comment
Share on other sites

Oh shoot.. yeah... one little 'S'. Sorry about that :oops:

 

The problem with moving it up one level (payment page) is that depending

on the action the user chooses there the page gets reloaded / external info (for giftvouchers for instance) gets pulled. Meanwhile you'll have to keep transporting the comments with the URL. So it will be trickier. And the way it is now it will remain compatible with ALL payment modules AFAIK.

 

Seeing the problems vs 'gain' of having the comments 1 page earlier I'd go for a 'Enter any comments on the next page' message instead.

 

HTH

Mattice

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

 

I'd go for a 'Enter any comments on the next page' message instead.  

 

Good idea and thanks for the code (even though your missing "s" gave my brain a good workout this weekend :) )

I have just made a small improvement to your code below

Changed

if ($flag) { 

echo "n" . '<!-- comment box -->' . "n"; 

?>    

     </td></tr> 

      <tr> 

       <td><table border="0" width="100%" cellspacing="1" cellpadding="6" class="infoBox"> 

         <tr class="infoBoxContents"> 

           <td class="main"><?php echo tep_draw_textarea_field('comment', 'virtual', '60', '5'); ?></td> 

         </tr> 

       </table></td> 

     </tr> 

       <td align="right" class="main"> 



<?php 

echo "n" . '<!-- comment box EOF //-->' . "n";

 

 

to

 

if ($flag) {

echo "n" . '<!-- comment box -->' . "n";

?>

     </td></tr>

      <tr>



      <td class="main"><b><?php echo TABLE_HEADING_COMMENTS; ?></b></td>

           </tr>

           <tr>

             <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

           </tr>

       <tr>



       <td><table border="0" width="100%" cellspacing="1" cellpadding="6" class="infoBox">

         <tr class="infoBoxContents">

           <td class="main"><?php echo tep_draw_textarea_field('comment', 'virtual', '60', '5'); ?></td>

         </tr>

       </table></td>

     </tr>

       <td align="right" class="main">



<?php

echo "n" . '<!-- comment box EOF //-->' . "n";

and added

 

define('TABLE_HEADING_COMMENTS', 'Enter below any additional comments you may have for this order');

to catalogincludeslanguagesenglishcheckout_confirmation.php

Best wishes

Steve

Link to comment
Share on other sites

Oh yeah.. the define. I never copied that bit. Thnx.

But it seems to work nicely. I'd like to know if someone that actually uses an external payment processor has experienced any problems with it.

Although it is a simple change I feel it is a big improvement for the client...

 

And are there any modules that give back a comment field?

After all the original line 'comments' => $order->info['comments'],

suggests there might be... or was that left in by accident?

 

Thnx,

Mattice

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

Well in that case the solution would be to only show it in confirmation if the client isn't taken to another site which is easy:

 

So if I am using 2checkout , will there be a problem adding the comments BEFORE the processing ?

 

 

Will these changes work for me ? :oops:

Link to comment
Share on other sites

Not if the customer selects 2checkout. But if they select 'moneyorder' or 'cod' as a payment these changes will show the box earlier for THOSE clients WITHOUT affecting the 2checkout ones.

 

The problem is whenever the client leaves to another site you can not send the comments along and get them returned by the external sites.

Solution COULD be to write the comments to the database BEFORE leaving your site but I guess that would have to be done in the actual payment module... which makes it a poor solution as all payment modules for osCommerce would have to be adapted to do so.

 

So in short: you can use these changes as it will move the comments to the confirmation page whenever someone chooses a 'non-external' payment method. If they do go external things remain the same.

 

I'd suggest you alter the code slightly to display a message saying 'You can add comments about your order after you've complete the 2checkout process' whenever someone 'goes external'...

 

HTH

Mattice

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

This is untested as I don't use 2checkout and didn't feel like signing up just to test ;) ....

Do msg thing by changing (my altered code from page 2 in this thread)

 

<?php 

 if (isset($$payment->form_action_url)) { 

   $form_action_url = $$payment->form_action_url; 

 } else { 

   $form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'); 

// flag it baby.. 

$flag = 1; 

 }

 

to:

<?php 

 if (isset($$payment->form_action_url)) { 

   $form_action_url = $$payment->form_action_url; 

   $comment_msg = 'Your witty comment about comments';

 } else { 

   $form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL'); 

// flag it baby.. 

$flag = 1; 

 }

 

 

and then do a

 

echo $comment_msg;

whereever you'd like to see it. (It will show up empty on people that select 'local' payment modules...)

"Politics is the art of preventing people from taking part in affairs which properly concern them"

Link to comment
Share on other sites

  • 3 weeks later...

Hi,

 

I am using authorize.net with snapshot 12.31.02. Although the comments are included in the admin section they are not appearing in the extra order email or the customer email. In the pre-November versions the comments appeared in all three cases.

 

Any idea why this is happening or how I can fix it?

 

My client uses the extra order email to process orders so it's very important that I find a way to get the comments inserted. I appreciate any and all help.

 

Thank you!

Link to comment
Share on other sites

Responsive to the last post, alas, the email confirmation of the order is generated by checkout_process.php and although it DOES have code to copy the comment into the email, the comment has not yet been entered by the customer. We really must move the comment entry to the confirmation screen or earlier ...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...