This error occurs on ZC 1.5.8. On version 1.5.7d it is not a problem.
The situtation:
I got two shipping methods. One allows payment by cash on delivery (COD) among other payment methods, the other does not.
I go to checkout, choose the shipping which allows COD, go to payment, choose COD, go to checkout confirmation. Everything is displayed correctly. I do not check out.
Now I changed my mind and click on "Checkout" in the top menu, to start the whole process again. This time I choose the shipping option, which does not allow COD. Next screen is checkout payment. There is no more COD option for payment. The radio button for the other payment option (bank transfer) is not active. On version 1.5.8 I can click on the "Continue" button, even no payment option is chosen and go to the next screen. The next screen shows COD as payment option, which is wrong. There is no COD fee of course.
On version 1.5.7d I get an error when I click the "continue" button without choosing a payment option.
I made the following code modification to disable COD on the flat shipping method:
In file includes/templates/template_default/templates/tpl_checkout_payment_default.php line 124
Code:
<?php
if (sizeof($selection) > 1) {
if (empty($selection[$i]['noradio'])) {
?>
<!-- Start my code -->
<!-- If flat is shipping method, do not display COD option -->
<?php
if($_SESSION['shipping']['id']=='flat_flat' && $selection[$i]['id']=='cod')
continue;
?>
<!-- End my code -->
<?php echo zen_draw_radio_field('payment', $selection[$i]['id'], ($selection[$i]['id'] == ($_SESSION['payment'] ?? '')), 'id="pmt-'.$selection[$i]['id'].'"'); ?>
If anybody got any idea, how I can fix it, I am happy to hear it.
Bookmarks