How can I make the Special Instructions/Comments field on Order Form a required field ?
I have searched for this information but could not find it.
Thank You
How can I make the Special Instructions/Comments field on Order Form a required field ?
I have searched for this information but could not find it.
Thank You
You'll need to edit some of your files since this feature isn't built in.
Edit your includes/modules/pages/checkout_confirmation/header_php.php
Around line 48, find the following code:
and add AFTER:Code:if (isset($_POST['payment'])) $_SESSION['payment'] = $_POST['payment']; $_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
Next, edit your includes/languages/english.php (OR if you have a template override, it will be includes/languages/english/YOUR_TEMPLATE/english.phpCode:// BOF Comments Required if(!zen_not_null($_SESSION['comments'])) { $messageStack->add_session('checkout_payment', ERROR_COMMENTS_REQUIRED, 'error'); zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL')); } // EOF Comments Required
Find the following:
and add after:Code:define('ERROR_PRIVACY_STATEMENT_NOT_ACCEPTED', 'Please confirm the privacy statement by ticking the box below.');
And that's it. There might be different approaches, but I think this one is the simplest...Code:// BOF Comments Required define('ERROR_COMMENTS_REQUIRED','Comments are required.'); // EOF Comments Required
An approach that might help with upgrades would be to effectively do the same thing through the use of an observer... That way, when the next upgrade is performed, that header file will effectively remain the same (no special merge necessary) and with the good notes taken about the applied "mods" can verify that the proper notifiers remain.
ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...
Yes, you're absolutely right, but I did point out that this was the simplest method. Although observers are not rocket science, it IS slightly more complex...
However, since I always prefer to post a solution if I know it (instead of just talking about it), here's a version with observers.
Please post this question to the One Page Checkout support thread; it will get some attention there.
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Bookmarks