Post by sordak » Mon Jun 01, 2020 6:35 pm

Hello all.
I have a problem with order checkout.
I am filling fields up to 3rd step, accepting agreements and clicking "Continue" button. Then I get alert:
----------------
error
undefined
----------------
Screenshot: http://ibb.co/G7PZrnG
There is no any error in web-server logs. All requests are OK (status 200).
What is wrong?

-------------------
Alert is from file:
/catalog/view/theme/default/template/checkout/checkout.tpl

Fragment of code:

Code: Select all

$(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-danger">' + json['error']['warning'] + '<button type="button" class="close" data-dismiss="alert">&times;</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
                    }
                });
            }
        },  
        error: function(xhr, ajaxOptions, thrownError) {
            alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
        }
    });
});


Image

Newbie

Posts

Joined
Wed May 27, 2020 11:33 pm

Post by rjcalifornia » Wed Jun 03, 2020 5:44 am

sordak wrote:
Mon Jun 01, 2020 6:35 pm
Hello all.
I have a problem with order checkout.
I am filling fields up to 3rd step, accepting agreements and clicking "Continue" button. Then I get alert:
----------------
error
undefined
----------------

Image
Hang on, what's with the code on the "Bank Transfer" text input? Did you paste it there or is it appearing by itself?

Image


Active Member

Posts

Joined
Fri Sep 02, 2011 1:19 pm
Location - Worldwide

Post by sordak » Wed Jun 03, 2020 9:46 pm

rjcalifornia wrote:
Wed Jun 03, 2020 5:44 am
Hang on, what's with the code on the "Bank Transfer" text input? Did you paste it there or is it appearing by itself?
Yes, I pasted that code in text field to make it more clear which alert within file is invoked.
You see in that field difference between file after and before my 'debug changes'.
And yes, I'm talking about file /catalog/view/theme/default/template/checkout/checkout.tpl

Newbie

Posts

Joined
Wed May 27, 2020 11:33 pm

Post by rjcalifornia » Wed Jun 03, 2020 10:48 pm

sordak wrote:
Wed Jun 03, 2020 9:46 pm
rjcalifornia wrote:
Wed Jun 03, 2020 5:44 am
Hang on, what's with the code on the "Bank Transfer" text input? Did you paste it there or is it appearing by itself?
Yes, I pasted that code in text field to make it more clear which alert within file is invoked.
You see in that field difference between file after and before my 'debug changes'.
And yes, I'm talking about file /catalog/view/theme/default/template/checkout/checkout.tpl
Oh ok, that was confusing. So this happens right after you select Bank Transfer as a payment option right? Do you write something in that box?
Could you change the payment option to something else instead of Bank transfer?

Image


Active Member

Posts

Joined
Fri Sep 02, 2011 1:19 pm
Location - Worldwide

Post by sordak » Thu Jun 04, 2020 7:22 pm

rjcalifornia wrote:
Wed Jun 03, 2020 10:48 pm
So this happens right after you select Bank Transfer as a payment option right?
Yes

rjcalifornia wrote:
Wed Jun 03, 2020 10:48 pm
Do you write something in that box?
What box are you talking about?

rjcalifornia wrote:
Wed Jun 03, 2020 10:48 pm
Could you change the payment option to something else instead of Bank transfer?
I could not change the payment option (only Bank transfer here).
But I have at least 3 available (enabled) payment options in:
Admin Panel -> Extenstions -> Extensions -> Payments
Last edited by sordak on Thu Jun 04, 2020 7:24 pm, edited 1 time in total.

Newbie

Posts

Joined
Wed May 27, 2020 11:33 pm

Post by xxvirusxx » Thu Jun 04, 2020 7:24 pm

Website URL?

OC 2.3.0.2 | OC 3.0.3.6 | Extensions converted by me | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by rjcalifornia » Fri Jun 05, 2020 12:31 am

sordak wrote:
Thu Jun 04, 2020 7:22 pm
What box are you talking about?
The comment box in the bank transfer payment option.
sordak wrote:
Thu Jun 04, 2020 7:22 pm
I could not change the payment option (only Bank transfer here).
But I have at least 3 available (enabled) payment options in:
Admin Panel -> Extenstions -> Extensions -> Payments
I understand. I wanted to check if the error happens only with bank transfers or with all payment options. Do you have a url of your site?

Image


Active Member

Posts

Joined
Fri Sep 02, 2011 1:19 pm
Location - Worldwide

Post by xxvirusxx » Fri Jun 05, 2020 3:16 am

This should be ignored...
He use ocStore....

OC 2.3.0.2 | OC 3.0.3.6 | Extensions converted by me | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România
Who is online

Users browsing this forum: phuong9 and 6 guests