Gift Message or special instructions on checkout

I’m probably missing something simple. Want to add 2 fields to the checkout page (single page checkout) somewhere around where the gift certificate input box is and to have these fields be part of the order. Fields are:


  1. Gift Message - a textbox where someone can enter a gift message (similar to the order comments, but specifically for a gift message).


  2. Future Delivery Date - an input field that allows a customer to specify a desired delivery date of sometime in the future.



    These fields should become part of the order but I’m struggling to see how I can place them near the cart summary and have them included in the order without the user having to click an update button. I.e. these two fields would become part of every order whether blank or not.



    Any hints?

Okay, came up with my own solution…



Use a hook on the checkout summary and add the form fields.



Add a post controller for the checkout.summary page that looks for those $_REQUESTS and then appends them to the ‘notes’ order element.



I learned you can’t add order values without adding them to the DB and/or creating various order variants of differing types and then try to piggy-back on another. It was quick and only requierd adding one hook to the orders/summary.tpl file and one post controller.

Thank you for answering your own post :slight_smile:



If I’m not asking to much, would you be so kind to share the code that you used?



Thanks in advance


[quote name=‘tbirnseth’]Okay, came up with my own solution…



Use a hook on the checkout summary and add the form fields.



Add a post controller for the checkout.summary page that looks for those $_REQUESTS and then appends them to the ‘notes’ order element.



I learned you can’t add order values without adding them to the DB and/or creating various order variants of differing types and then try to piggy-back on another. It was quick and only requierd adding one hook to the orders/summary.tpl file and one post controller.[/QUOTE]

[quote name=‘hmf’]Thank you for answering your own post :slight_smile:



If I’m not asking to much, would you be so kind to share the code that you used?



Thanks in advance[/QUOTE]



All the gory details hare here: [url]http://forum.cs-cart.com/showthread.php?p=76015#post76015[/url]



Should be available today or tomorrow. I will post a link on that thread.

[quote name=‘tbirnseth’]All the gory details hare here: [url]http://forum.cs-cart.com/showthread.php?p=76015#post76015[/url]



Should be available today or tomorrow. I will post a link on that thread.[/QUOTE]



Oops, I’m referencing the wrong change!!! Silly me!



The change for this was pretty simple. Catch the checkout process and add a “pre” hook in the summary area above the ‘notes’ area. Add a couple of elements and name them uniquely like “local_mod[gift_message]” and “local_mod[expected_delivery]”. Then have a “controller” checkout.post.php file that will look for the order being submitted. Then, look for the $_REQUEST variables setup above and append this data to the ‘notes’ field.



It all then saves with the order.



Hope that helps.

If you are able, can you share the full step-by-step instructions on how to implement this? Would be very grateful!

It is described in general above.



I have made this into an addon if you would like to purchase the specific implementation and configuration. You can get the addon here: [url]http://www.ez-ms.com/addonproducts/checkout-summary-fields-addon.html[/url]



Full documentation (I know, this is cs-cart) is available in the attachements area on the product detail page.



Unlike the above, the type, names, etc. are all customizable in the addon and administered through the admin panel. The above is a description of a specific implementation.

Have you tested the add on with version 2.0.15?

It has been used extensively with 2.0.14 and I have clients who are running 2.0.15 and no reports of problems.



Have I done exclusive testing with 2.0.15? No - I try to write addons in a manner that they are not release sensitive (though I do occasionally encounter changes that require an update).



If you encounter any issues, my support for purchased products is free and usually quite responsive.

nice add-on.



Anyone tested or using it with 2.1.x? If we encounter issues with our version, can you fix it?

There have been changes to support 2.1. The current version is 2.1.2.

I was waiting for feedback from a customer who reported the issues but hadn’t heard back.



I have published this new version which should be compatible with both 2.0 and 2.1 versions of the cart.



I don’t remember exactly what the changes were since this was about a month ago. But if the new version has problem, please email me at XXsupportXX@ez-ms.com (take out the XX’s) and I’ll figure it out.

Now I remember the change… They added a hook called checkout:notes that is now used instead of inserting my own for 2.1.1 and beyond. So the new version has the old hook file copied to the new location.



If you want to avoid a reinstall after you get the new version, you can copy:

var/skins_repository/base/customer/addons/co_summary_fields/hooks/checkout/custom_summary.pre.tpl

to

var/skins_repository/base/customer/addons/co_summary_fields/hooks/checkout/notes.post.tpl



and all should be well… Let me know if you have any difficulties.