Hopefully this isn't considered a cross post since it APPLIES THE SAME CONTRIBUTION (MODS)
I've added the osCommerce Credit Class and Gift Voucher "Easier to Understand" Payment Addon v1.2
Everything works as far as can be seen, but this is the error........i've tried searching for the function on line 84 with this part of the function flagging the error
Warning: Missing argument 1 for javascript_validation() in /homepages/2/XXXXXXXXXXX/htdocs/GForce/shopping/includes/classes/payment.php on line 84..........Line 84 is where the function javascript_validation($coversAll) { begins
// #################### Begin Added CGV JONYO ######################
// function javascript_validation() {
function javascript_validation($coversAll) {
//added the $coversAll to be able to pass whether or not the voucher will cover the whole
//price or not. If it does, then let checkout proceed when just it is passed.
$js = '';
if (is_array($this->modules)) {
if ($coversAll) {
$addThis='if (document.checkout_payment.cot_gv.checked) {
payment_value=cot_gv; alert (\'hey yo\');
} else ';
} else {
$addThis='';
}
$js = '<script language="javascript"><!-- ' . "\n" .
'function check_form() {' . "\n" .
' var error = 0;' . "\n" .
' var error_message = "' . JS_ERROR . '";' . "\n" .
' var payment_value = null;' . "\n" .$addThis . //added by jonyo, yo
' if (document.checkout_payment.payment.length) {' . "\n" .
' for (var i=0; i<document.checkout_payment.payment.length; i++) {' . "\n" .
' if (document.checkout_payment.payment[i].checked) {' . "\n" .
' payment_value = document.checkout_payment.payment[i].value;' . "\n" .
' }' . "\n" .
' }' . "\n" .
' } else if (document.checkout_payment.payment.checked) {' . "\n" .
' payment_value = document.checkout_payment.payment.value;' . "\n" .
' } else if (document.checkout_payment.payment.value) {' . "\n" .
' payment_value = document.checkout_payment.payment.value;' . "\n" .
' }' . "\n\n";
reset($this->modules);
while (list(, $value) = each($this->modules)) {
$class = substr($value, 0, strrpos($value, '.'));
if ($GLOBALS[$class]->enabled) {
$js .= $GLOBALS[$class]->javascript_validation();
}
}
// ############ Added CCGV Contribution ##########
// $js .= "\n" . ' if (payment_value == null) {' . "\n" .
$js .= "\n" . ' if (payment_value == null && submitter != 1) {' . "\n" . // CCGV Contribution
// ############ End Added CCGV Contribution ##########
' error_message = error_message + "' . JS_ERROR_NO_PAYMENT_MODULE_SELECTED . '";' . "\n" .
' error = 1;' . "\n" .
' }' . "\n\n" .
// ############ Added CCGV Contribution ##########
// ICW CREDIT CLASS Gift Voucher System Line below amended
// ' if (error == 1) {' . "\n" .
' if (error == 1 && submitter != 1) {' . "\n" .
// ############ End Added CCGV Contribution ##########
' alert(error_message);' . "\n" .
' return false;' . "\n" .
' } else {' . "\n" .
' return true;' . "\n" .
' }' . "\n" .
'}' . "\n" .
'//--></script>' . "\n";
}
return $js;
}
// #################### End Added CGV JONYO ######################