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:
PHP Code:
// 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 ...
Bookmarks