Jump to content

Doesn't Load Payment, Shipping and Order Summary Fields in Supercheckout Module: Technical Error-Request Failed


aysenur

Recommended Posts

Hello,

I have a problem in PrestaShop 1.7.7.8 and I use supercheckout module.

If I override classes/Validate.php file to the override folder, and edit some regex epressions I get the error: "Technical Error-Request Failed"(Picture 1). If I revert the epression back the problem goes away. And the other point is this error seems just for guest users. If I log in and go to the supercheckout page, I won't see any error and it will work fine. So I want to edit Regex expressions.

I tried to find the solution. I found that the error is defined inside that file: \modules\supercheckout\views\templates\front\supercheckout.tpl.

I got it in the comment line. (Picture 2). And I got the error in the third picture (Picture 3).

So the problem is in the Ajax request, but I cannot find it: 

function loadCarriers() {
    var requestParam = getCounrtryAndIdDelivery();
    var id_country = requestParam[0];
    var id_state = 0;
    if (checkStateVisibility(id_country, 'select[name="shipping_address[id_state]"]')) {
        id_state = $('select[name="shipping_address[id_state]"]').val();
    }
    var postcode = $('input[name="shipping_address[postcode]"]').val();
    var id_address_delivery = requestParam[1];
    var vat_code = '';
    if ($('input[name="shipping_address[vat_number]"]').val() != 'undefined' && $('input[name="shipping_address[vat_number]"]').val() != '' && $('input[name="shipping_address[vat_number]"]').val() != null) {
        vat_code = $('input[name="shipping_address[vat_number]"]').val();
    }
    shipping_error_found_on_load = false;
    $.ajax({
        type: 'POST',
        headers: {
            "cache-control": "no-cache"
        },
        url: getURLwithTime($('#module_url').val()),
        async: true,
        cache: false,
        dataType: "json",
        data: 'ajax=true' + '&id_country=' + id_country + '&id_state=' + id_state + '&postcode=' + postcode + '&vat_number=' + vat_code + '&id_address_delivery=' + id_address_delivery + '&method=loadCarriers&token=' + prestashop.static_token,
        beforeSend: function() {
            alert(8541);
            $('.kb_velsof_sc_overlay').show();$('.pay-loader').show();
            $('#shippingMethodLoader').show();
            $('#shipping_method_update_warning .permanent-warning').remove();
            alert(8888);
        },
        complete: function() {
            alert(77777);
            $('.kb_velsof_sc_overlay').hide();$('.pay-loader').hide();
            $('#shippingMethodLoader').hide();
        },
        success: function(jsonData) {
            if (jsonData['hasError']) {
                $('#shipping-method').html('');
                $('#shipping_method_update_warning').html('<div class="permanent-warning">' + jsonData['shipping_error'][0] + '</div>');
            } else {
                $('#shipping-method').html(jsonData['html']);
            }
            $('.delivery_option_radio:checked').closest('li').addClass('alert-info');
            set_column_inside_height();
            //loadCart();
            /* Start Code Added By Priyanshu on 11-Feb-2021 for the packetery ( Zasilkovna ) compatibility */
            if (typeof onShippingLoadedCallback !== 'undefined') {
                onShippingLoadedCallback();
            }
            /* End Code Added By Priyanshu on 11-Feb-2021 for the packetery ( Zasilkovna ) compatibility */
            updateCarrierOnDeliveryChange()
        },
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            var errors = sprintf(ajaxRequestFailedMsg, XMLHttpRequest, textStatus);
            $('#shipping_method_update_warning').html('<div class="permanent-warning">' + errors + '</div>');
            $('.kb_velsof_sc_overlay').hide();$('.pay-loader').hide();
        }
    });
}

function getCounrtryAndIdDelivery() {
    var id_country = 0;
    var id_address_delivery = '';
    if ($('input[name="shipping_address_value"]').length) {
        if ($('input[name="shipping_address_value"]:checked').val() == 1) {
            id_country = $('select[name="shipping_address[id_country]"] option:selected').val();
        } else if ($('input[name="shipping_address_value"]:checked').val() == 0) {
            id_address_delivery = $('select[name="shipping_address_id"] option:selected').val();
        }
    } else {
        id_country = $('select[name="shipping_address[id_country]"] option:selected').val();
    }

    var arr = [];
    arr.push(id_country);
    arr.push(id_address_delivery);
    return arr;
}

The id_address_delivery variable is empty. If I set a value 1 to this variable, it works fine the first time, but if I go to the page to purchase products again, I encounter the error in the fourth picture (Picture 4). Finally that is my Regex expressions (Picture 5😞

Anyone help me, please?

Thank you,

Best regards

 

 

 

 

 

 

image.png

----------------------------------------------------------------------------------------------------------------------------------------------

image (3).png

----------------------------------------------------------------------------------------------------------------------------------------------

image (2).png

 

----------------------------------------------------------------------------------------------------------------------------------------------

Adsız.png

----------------------------------------------------------------------------------------------------------------------------------------------

image (1).png

Edited by aysenur
for image sorts (see edit history)
Link to comment
Share on other sites

  • 3 months later...

I had the same problem - TECHNICAL ERROR Request failed

I have: PrestaShop v.1.7.8.2, Supercheckout v7.0.2, PHP v.7.4.27.

The error on web server log was: 

==> /var/www/vhosts/mydomain.com/logs/proxy_error_log <==
2022/01/24 04:14:23 [error] 111014#0: *244524 upstream sent too big header while reading response header from upstream, client: 119.166.233.199, server: mydomain.com, request: "POST /index.php?fc=module&module=supercheckout&controller=supercheckout&rand=1642990460128&ajax=true HTTP/2.0", upstream: "https://10.10.0.16:7081/index.php?fc=module&module=supercheckout&controller=supercheckout&rand=1642990460128&ajax=true", host: "mydomain.com", referrer: "https://mydomain.com/en/module/supercheckout/supercheckout"

Cause: The request cannot be processed by the proxy server because of insufficient buffer size.

Resolution:

  1. Connect to the server using SSH.
  2. Open the file /etc/nginx/nginx.conf for editing.
  3. Increase the following parameters in the section http {:
proxy_buffers 8 16k;
proxy_buffer_size 32k; 
fastcgi_buffers 8 16k; 
fastcgi_buffer_size 32k;

      4. Restart nginx to apply changes:

# service nginx restart

Increase values of these parameters if it is needed.

 

Source: https://www.plesk.com/kb/support/websites-hosted-on-plesk-server-are-unavailable-with-502-bad-gateway-upstream-sent-too-big-header-while-reading-response-header/

 

Link to comment
Share on other sites

  • 1 year later...

Interesting where my post dissapeared, just posted it few days ago.

I'll post it again. My PS is 1.7.8.10 and Supercheckout is 6.0.9

I have same kind of issue "TECHNICAL ERROR Request failed" and it appeared when I removed from Superscheckout 'Last name' field as required. When I checked that field back error message disapeared.

I turned directly to Knowband also, but they doesn't offer more sulution than to buy the module again. I brought it around 2 years ago and that is strange attitude when no updates offered to the module and no support as well, but just buy again?!?

So any of you have better solution, where to start solving it, as there is no need to ask too many fields from clients.

 

_______________________

koduvalve

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...