EricK Posted September 11, 2002 Posted September 11, 2002 I'm using the Comments field for delivery Date and Time info. How do I make that a required field - v2.2 June02? Many thanks- ocs rocks!
Guest Posted September 14, 2002 Posted September 14, 2002 Do you mean you want to use it for them to give you a delivery date and time or for them to give you one? If it is to have them give you a delivery date and time then I think making it required is not really what you need. I would think a way for the box to be checked to see if it is empty and to generate maybe a popup saying "You have not provided a delivery date and time" otherwise, if it is for you to pu the dekuvery info, then I think you could add a box to the orders status called "Delivery Info" and put it there and have it show in the customers account
EricK Posted September 14, 2002 Author Posted September 14, 2002 It is for customers to give me their order delivery date and time ... the cart is for a catering service. A popup would be great, the page checkout_payment.php already has a javascript validation popup for the payment modules, but it does not work for the Comments text field. Should I add another javascript validation script for the Comments field, or will a PHP validate_fields function or error function ($error == "") work ??? This is the text field: <?php echo tep_draw_textarea_field('comments', 'virtual', '60', '5'); ?> Many thanks.
gevans Posted November 22, 2002 Posted November 22, 2002 try adding something like this to catalog/includes/form_check.js.php: if (document.account_edit.elements['comments'].type != "hidden") { if (document.account_edit.comments.value == 0) { error_message = error_message + "<?php echo JS_COMMENTS; ?>"; error = 1; } }
rizrock Posted March 16, 2004 Posted March 16, 2004 did anyone get this to work? working on this right now. please share explanations. thank you
bpmcclure Posted March 12, 2008 Posted March 12, 2008 did anyone get this to work? working on this right now. please share explanations. thank you Anyone ever get an easy solution to this? I would like to use this too. Or even better, can a pull down calendar and pull and pull down time list be added to the checkout page? I am thinking of the kind used by car rental companies. This would allow customers to choose their pick up time and date easily and obviate the need for mandatory comments. Thanks, Bruce
Jack_mcs Posted March 12, 2008 Posted March 12, 2008 Try the ShipDate contribution. Turning the comment field into something else is a bad idea since a customer may really want to enter a comment. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
bpmcclure Posted March 12, 2008 Posted March 12, 2008 Try the ShipDate contribution. Turning the comment field into something else is a bad idea since a customer may really want to enter a comment. Jack Jack, Thanks so much for the tip, I'll check it out and see how it works. Figured someone a lot smarter than me had thought of this already! Bruce
dlewis22 Posted March 27, 2008 Posted March 27, 2008 I am using shipdate for a catering company and it is working great. But I am still looking for a way to make a delivery and pickup time required. Any suggestions?
Jack_mcs Posted March 28, 2008 Posted March 28, 2008 I am using shipdate for a catering company and it is working great. But I am still looking for a way to make a delivery and pickup time required. Any suggestions? I don't use it and not familiar with the code but if there isn't an option to do that in the contribution, then the code would have to be added to check it. Either way, you should ask in the support thread for that contribution since that is where someone that uses it is more likely to see your question. Jack Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons
bpmcclure Posted March 28, 2008 Posted March 28, 2008 try adding something like this to catalog/includes/form_check.js.php: if (document.account_edit.elements['comments'].type != "hidden") { if (document.account_edit.comments.value == 0) { error_message = error_message + "<?php echo JS_COMMENTS; ?>"; error = 1; } } Has anyone tried this and does it work? If so, can you share where exactly this code is placed in form_check.js.php. I would very much like to have this functionality, to require SOME entry in the comments field. I tired shipdate and could not get it to work for me. Thanks, Bruce
soodanim Posted July 22, 2011 Posted July 22, 2011 This worked for me. found it on another forum. in checkout_confirmation.php insert: //-- Check the comments field if (strlen($HTTP_POST_VARS['comments']) < 0) { tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode(ERROR_CHECKOUT_COMMENTS_EMPTY), 'SSL', true, false)); } in includes/languages/english.php insert: define('ERROR_CHECKOUT_COMMENTS_EMPTY', 'please enter your blablabla text here'); If putting the above in the english.php doesn't work put it in the includes/languages/english/checkout_confirmation.php
Recommended Posts
Archived
This topic is now archived and is closed to further replies.