Error: Please choose the right carrier for selected country

Please post your issues and questions about One Page Checkout for Virtuemart 2 to this forum.

Re: Error: Please choose the right carrier for selected country

Postby admin » Mon Dec 17, 2012 8:05 pm

Hello friends,
while working on OPC i found that i should let you know that another reason for the Invalid carier or Invalid country is that AJAX response may return a http code 500 as defined in onepage.js :

Code: Select all
{
     if (xmlhttp2.readyState==4 && xmlhttp2.status==500)
      {
        // here is the response from request
    var resp = xmlhttp2.responseText;
    if (resp != null)
    {
    resp+='<input type="hidden" name="invalid_country" value="invalid_country" />';
    setShippingHtml(resp);

    }
      }
   }


This issue can potentionally happen when your server is way too busy and your host blocks your customer's requests and returns error 500. OPC sets "invalid country" input tag which should get changed on the next address change. Ajax can cause more queries toward the server and threfore if you are experiencing error 500 during the high season on your site, you should be considering either change of hosting or ask for more similtaneous connections (maxrequests, etc..). Error 500 can also occur if your hosting does nore support .htaccess files outside the root and you may remove the .htaccess from the js directory /components/com_onepage/assets/js/.htaccess (used to to stop caching of onepage.js after OPC update)

You can comment the fail safe code above in /components/com_onepage/assets/js/onepage.js
Code: Select all
...
if (xmlhttp2.readyState==4 && xmlhttp2.status==500)
{
// do nothing
}
...
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Error: Please choose the right carrier for selected country

Postby tom@.....net » Fri Jan 18, 2013 2:13 pm

I am getting this problem now and then but not all the time so I am thinking that it might be the busy server problem but the server administrator says that the maxrequests are set very high so he doesn't think this would be the problem.

I have renamed the .htaccess file and blocked the code in the .js file.

Can someone assist me, please.
tom@.....net
 
Posts: 2
Joined: Fri Jan 18, 2013 12:23 pm

Re: Error: Please choose the right carrier for selected country

Postby admin » Tue Jan 22, 2013 1:27 pm

hello, tom, let me check this on your site. The error 500 can be one of these
- php timeout when an api method does not reponse in 30 seconds (a default php timeout)
- a fastcgi timeout sometimes is set lower than the 30 seconds - check with your hosting
- a fatal error in php when error reporting is dislable (can be seen when error reporting is set to maximum or in php/apache logs)
- out of memory which occurs when having too many shipping methods - but it should not be this case
- .htaccess file is denied due to server configuration (please delete it)
404 and 3xx return codes
- a SEF redirect for onepage ajax call - it is a very important to disable SEF for com_onepage

best regards,
Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Error: Please choose the right carrier for selected country

Postby tom@.....net » Thu Feb 28, 2013 10:59 am

I have solved the issue on my dev site anyway.

It was wrong settings in the Shipping Methods. Thanks anyway for your time
tom@.....net
 
Posts: 2
Joined: Fri Jan 18, 2013 12:23 pm

Re: Error: Please choose the right carrier for selected country

Postby admin » Thu Feb 28, 2013 3:40 pm

Hello Tom, it would be very helpfull to all other viewers of this forum if you could specify how you fixed this. The error 500 is mostly caused by a php error and a user inputted configuration should never be able to cause it. Please specify the 3rd party shipping plugin and the change you had to do with it to make it work.

Thank you,
Best Regards,
Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Error: Please choose the right carrier for selected country

Postby ee61ny » Fri Mar 31, 2023 2:59 pm

Hello Stan, occasionally, I get the same error in some orders "Choose the right carrier for the selected country".
Is there a fix on that ?
Thanx in advance
ee61ny
 
Posts: 1
Joined: Wed Mar 09, 2022 4:13 pm

Re: Error: Please choose the right carrier for selected country

Postby admin » Fri Jun 23, 2023 12:31 pm

hello, this is a generic error when the AJAX is being loaded and customer has to wait till the rates are shown. If your site returns a correct http code in case of an error then opc can show "refresh link" so that customer can retry.

i suggest to enable "opc error log" to see if this comes from some slow extension or similar. in worse case it might be blocked by mod_security or similar software per certain content.

also it's known that some antivirus such as kaspersky might by-defualt block all pages which include words "c r e di t card" which breaks checkout's ajax calls and might lead to this error as well (you can find out when using the error log)

best regards, stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Previous

Return to One Page Checkout for Virtuemart 2