Ak používate OpenCart verzie 2.0 až 2.1 (vo verzii 2.2 je chyba opravená), tak ste si možno všimli, že v pokladni pri kroku 5, ak nezačiarknete odsúhlasenie obchodných podmienok pred kliknutím na tlačidlo Pokračovať, tak ani po následnom začiarknutí odsúhlasenia obchodných podmienok nie je možné pokračovať.
Jedná sa o chybu v OpenCarte, ktorú zákazník nemusí byť schopný vyriešiť (nutné znovunačítanie stránky a odsúhlasenie obchodných podmienok pred kliknutím na tlačidlo Pokračovať). Riešenie som našiel na fóre OpenCartu: https://forum.opencart.com/viewtopic.php?f=191&t=154351 .
- V správcovskom rozhraní v časti Systém > Nastavenie > Upraviť > Šablóna nastavte predvolený vzhľad (default).
- Upravte súbor catalog/view/theme/default/template/checkout/checkout.tpl .
- Vyhľadajte nasledujúcu časť (vo verzii 2.1.0.2 sú to riadky 752-794):
Kód: Vybrať všetko
$(document).delegate('#button-payment-method', 'click', function() { $.ajax({ url: 'index.php?route=checkout/payment_method/save', type: 'post', data: $('#collapse-payment-method input[type=\'radio\']:checked, #collapse-payment-method input[type=\'checkbox\']:checked, #collapse-payment-method textarea'), dataType: 'json', beforeSend: function() { $('#button-payment-method').button('loading'); }, success: function(json) { $('.alert, .text-danger').remove(); if (json['redirect']) { location = json['redirect']; } else if (json['error']) { if (json['error']['warning']) { $('#collapse-payment-method .panel-body').prepend('<div class="alert alert-warning">' + json['error']['warning'] + '<button type="button" class="close" data-dismiss="alert">×</button></div>'); } } else { $.ajax({ url: 'index.php?route=checkout/confirm', dataType: 'html', complete: function() { $('#button-payment-method').button('reset'); }, success: function(html) { $('#collapse-checkout-confirm .panel-body').html(html); $('#collapse-checkout-confirm').parent().find('.panel-heading .panel-title').html('<a href="#collapse-checkout-confirm" data-toggle="collapse" data-parent="#accordion" class="accordion-toggle"><?php echo $text_checkout_confirm; ?> <i class="fa fa-caret-down"></i></a>'); $('a[href=\'#collapse-checkout-confirm\']').trigger('click'); }, error: function(xhr, ajaxOptions, thrownError) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } }); } }, error: function(xhr, ajaxOptions, thrownError) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } }); });
- Zmeňte ju nasledovne:
Kód: Vybrať všetko
$(document).delegate('#button-payment-method', 'click', function() { $.ajax({ url: 'index.php?route=checkout/payment_method/save', type: 'post', data: $('#collapse-payment-method input[type=\'radio\']:checked, #collapse-payment-method input[type=\'checkbox\']:checked, #collapse-payment-method textarea'), dataType: 'json', beforeSend: function() { $('#button-payment-method').button('loading'); }, success: function(json) { $('.alert, .text-danger').remove(); if (json['redirect']) { location = json['redirect']; } else if (json['error']) { $('#button-payment-method').button('reset'); if (json['error']['warning']) { $('#collapse-payment-method .panel-body').prepend('<div class="alert alert-warning">' + json['error']['warning'] + '<button type="button" class="close" data-dismiss="alert">×</button></div>'); } } else { $.ajax({ url: 'index.php?route=checkout/confirm', dataType: 'html', complete: function() { $('#button-payment-method').button('reset'); }, success: function(html) { $('#collapse-checkout-confirm .panel-body').html(html); $('#collapse-checkout-confirm').parent().find('.panel-heading .panel-title').html('<a href="#collapse-checkout-confirm" data-toggle="collapse" data-parent="#accordion" class="accordion-toggle"><?php echo $text_checkout_confirm; ?> <i class="fa fa-caret-down"></i></a>'); $('a[href=\'#collapse-checkout-confirm\']').trigger('click'); }, error: function(xhr, ajaxOptions, thrownError) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } }); } }, error: function(xhr, ajaxOptions, thrownError) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } }); });
- Pridaný riadok (vo verzii 2.1.0.2 medzi riadkami 766 a 767):
Kód: Vybrať všetko
$('#button-payment-method').button('reset');
Ak používate vQmod, doporučujem urobiť zmeny cez toto rozšírenie, pretože je lepšie ponechať systémové súbory nedotknuté.