The best place for this is to start on Shipping so that the comments are done with, in theory, as the payment info will get tossed if the comments are missing there ...
Edit the file:
/includes/modules/pages/checkout_shipping/header_php.php
Around lines 119 ... change the code to read:
// process the selected shipping method
if ( isset($_POST['action']) && ($_POST['action'] == 'process') ) {
if (zen_not_null($_POST['comments'])) {
$_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
}
$comments = $_SESSION['comments'];
if (empty($comments)) {
$messageStack->add_session('header', ERROR_MISSING_COMMENT, 'error');
zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
}
This forces the comment to be filled in or throw an error ...
The error message: ERROR_MISSING_COMMENT
Will need to be defined ... usually these extra things are best defined in a file in the directory:
/includes/languages/english/extra_definitions/something.php
These files auto load when english.php loads ...
That test on the comments should then be added to the header_php.php for the checkout_payment as well so that they don't erase everything ...
Linda McGrath
If you have to think ... you haven't been zenned ...
**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!