Upon further investigation, it appears that the cause is the following section in tpl_checkout_payment_default.php:
Code:
<div class="buttonRow forward" id="paymentSubmit"><?php echo zen_image_submit(BUTTON_IMAGE_CONTINUE_CHECKOUT, BUTTON_CONTINUE_ALT, 'onclick="submitFunction('.zen_user_has_gv_account($_SESSION['customer_id']).','.$order->info['total'].')"'); ?></div>
The submitFunction, present in /includes/modules/pages/checkout_payment/jscript_main.php, looks like (note that the submitter variable is initialized to null earlier in that module):
Code:
function submitFunction($gv,$total) {
if ($gv >=$total) {
submitter = 1;
}
}
Finally, the submitter value is checked by the javascript generated by the javascript_validation function present in /includes/classes/payment.php:
Code:
$js = $js . "\n" . ' if (payment_value == null && submitter != 1) {' . "\n";
$js = $js .' error_message = error_message + "' . JS_ERROR_NO_PAYMENT_MODULE_SELECTED . '";' . "\n";
$js = $js .' error = 1;' . "\n";
$js = $js .' }' . "\n\n";
$js = $js .' if (error == 1 && submitter != 1) {' . "\n";
$js = $js .' alert(error_message);' . "\n";
$js = $js . ' return false;' . "\n";
$js = $js .' } else {' . "\n";
if ($this->doesCollectsCardDataOnsite == true && PADSS_AJAX_CHECKOUT == '1') {
$js .= ' return collectsCardDataOnsite(payment_value);' . "\n";
}
$js = $js .' return true;' . "\n";
The issue is that the submitter value is being set upon the button-click when the customer's GV balance is larger than the order's total ... not when the GV amount-applied is larger than the order's total. That being set results in the error messages issued by the payment-class not being alerted.
I'm at a loss as to what the real purpose of the submitter value is; I'm guessing that it's to distinguish between the coupon/GV forms auto-submittal (with no associated submit button) and the form submittal via the actual button on the bottom of the page.
Bookmarks