Ecommerce software home
Shopping Cart Software Forum for Ecommerce Templates
 
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

Find us on Facebook Follow us on Twitter View our YouTube channel
Search our site
 All Forums
 Technical
 PHP (Unix / Linux / Apache) versions
 Message -You must select a state before continuing
Author « Topic »  

EllenD
Advanced Member

United Kingdom
419 Posts

Posted - 11/06/2020 :  08:34:56  
Hi, I have noticed an issue with PayPal Express checkout. After logging in with Paypal, it returns to the cart page with all the address details filled in, including the state (UK county) but the message at the top says 'You must select a state before continuing' even though the state is selected. See screenshot below. On latest version, PHP 7.2.4. This was done on a tablet if that makes a difference. You can actually continue and check out, even though the message suggests otherwise. Any ideas please?

Thank you
Ellen

[url=https://ibb.co/cTt8Cwy][/url]

Vince
Administrator

42428 Posts

Posted - 11/06/2020 :  09:22:28  
Hi Ellen
I'll have to investigate this on Monday as I'm just heading out, but could you let me know if this always happens, or just with South Yorkshire?

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

EllenD
Advanced Member

United Kingdom
419 Posts

Posted - 11/09/2020 :  02:00:47  
Hi Vince,

I'm sorry I don't know about other counties, as I don't have a Paypal account with another county set up to test with. I did check though and South Yorkshire is definitely set up and enabled as a 'state' in the store admin.

I noticed this first on ECT 7.2.2, then updated to 7.2.4 and tried again, but still the same issue.

Ellen

EllenD
Advanced Member

United Kingdom
419 Posts

Posted - 11/19/2020 :  07:34:03  
Hi Vince

Did you get chance to look at this at all please?

Thanks
Ellen

Vince
Administrator

42428 Posts

Posted - 11/20/2020 :  02:11:32  
Hi Ellen
Sorry for the delay in looking into this but I've been going over it this morning and haven't been able to reproduce the problem, even with South Yorkshire set up as an address.
Could you check in the states admin page that South Yorkshire isn't disabled or anything like that?
If that doesn't help I guess the next step is to try your website and see if I can reproduce it there so could you let me know the URL. Please send by email if you don't want to share here.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

EllenD
Advanced Member

United Kingdom
419 Posts

Posted - 11/25/2020 :  04:28:52  
Hi Vince,

I have done a bit more testing with this, and found a few things that might help.

We have the shipping estimator on the cart page. If I select my state 'South Yorkshire' in that then go to PayPal Express, I get the effect as in my screenshot in original post - where the country is selected but the message 'you must select a state before proceeding' is shown.

If I do not use the shipping estimator before going to PayPal Express, then when I return to the cart page after PayPal, the state (county) is NOT selected, and the message understandably appears.

The county 'South Yorkshire' is definitely set up and enable in the store admin. However, in my PayPal account the county is held in capitals as SOUTH YORKSHIRE. Could this be the reason that it does not match up with the dropdown item?

I would at least like to change the message from 'you must select a state' to something friendlier and also mentioning 'County' instead of state, but there isn't anything in the lang file for this, it seems to be hard coded in inccart.php.

Here is a link to the store but I think the issue is more likely with the way the state is held in my Paypal, rather than my store setup.
[link removed]

Thank you

Edited by - EllenD on 11/26/2020 05:24:42

Vince
Administrator

42428 Posts

Posted - 11/26/2020 :  01:37:02  
Hi Ellen
That's a great bit of sleuthing and helps a lot in tracking down the problem here. I've made some changes now so that when the state is not recognized returning from PayPal the cart doesn't try to help by selecting the state that was used in the shipping estimator, and this is why the cart both raised the error about a state not being selected and selected a valid state, and I can imagine would be quite confusing.
However, I've tried all kinds of tests here with different addresses and SOUTH YORKSHIRE in capitals but don't get the same problem. It is possible that your database isn't using a collation that is Case Insensitive and we can check that by going to the ECT admin -> Store Admin -> Database Utility and click on "Set database collation". Then can you let me know what you have there?
But it is also possible that for some reason the state isn't matching and we can check what we are getting back from PayPal by adding this parameter to your includes.php file...
$debugxmlemails=TRUE;
Then run through your test and you should get a bunch of debug emails with the XML transactions. Then make sure you take that parameter out again and can you send the emails to me.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

EllenD
Advanced Member

United Kingdom
419 Posts

Posted - 11/26/2020 :  05:17:14  
Hi Vince,

Thanks for your reply. I had a look in the DB Collation, most tables are set to utf8_general_ci and some are latin1_swedish_ci

I also did the debug thing and will send you the emails. It does look like PayPal is not sending the county back to ECT for some reason. I will leave the debug set for a bit to see how it goes with some other customer orders.

Thanks
Ellen

Vince
Administrator

42428 Posts

Posted - 11/27/2020 :  02:39:31  
Hi Ellen
Sorry I missed your message yesterday but my email is vince AT ecommercetemplates DOT com. But it seems that not "pre-filling" the state and zip when returning from PayPal is going to be a necessary fix anyway and so I've already added this to the inccart.php script in the updater.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

EllenD
Advanced Member

United Kingdom
419 Posts

Posted - 11/27/2020 :  05:23:42  
Thanks Vince. I have forwarded you the debug emails and will run latest updater too.
Ellen

EllenD
Advanced Member

United Kingdom
419 Posts

Posted - 11/27/2020 :  06:30:48  
Hi Vince,

I ran the updater and tested again. County is not populated on return from PayPal, whether or not shipping estimator is used first.

This brings up a slightly different question I think. Is it possible to force the use of shipping estimator? I ask this because we have different postage rates depending on the shipping county. If the customer uses the estimator before going to PayPal, the total amount of product + shipping is shown in PayPal. If they don't use the estimator, the cost of shipping is not shown in PayPal, it shows the product cost only.

Thanks for your help
Ellen

Vince
Administrator

42428 Posts

Posted - 11/27/2020 :  14:42:55  
Hi Ellen
I looked through the XML you sent and it does seem that PayPal is not sending anything for the state or province. As for the shipping method you have the county is required I think the cart is doing what it should and requiring that it be entered and the fix so that the county is not prefilled in a confusing way is, I think, the fix for this.
I see what you are saying about the shipping estimator but as this is PayPal Express all it is doing really is making the estimate more accurate. But in the end the total they pay is not displayed until the last cart page anyway and by forcing the customer to enter address details, which with PP Express they would otherwise get from their PP account, is starting to defeat the idea of PP Express . . . if you see what I mean. A step more and you have PayPal Standard where they have entered all address details and get the full shipping cost before entering their PP account.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

EllenD
Advanced Member

United Kingdom
419 Posts

Posted - 11/30/2020 :  03:41:28  
Hi Vince,

Thanks for this. I agree that the most confusing part is fixed, however would it be possible for the error message to be editable please? As in my example, the message is 'You must select a state before proceeding' but since we are using County not State, that is somewhat confusing.

I also left the debug on while a few customer orders came in and it seems that the results are variable, perhaps depending on how customer's Paypal addresses are set up. Sometimes it was blank, sometimes correct, one time it said 'England' which is not a state/county. As long as the cart can cope when a match is not found, I think that's OK.

Thank you
Ellen

Vince
Administrator

42428 Posts

Posted - 11/30/2020 :  13:09:33  
Hi Ellen
I've made the changes now so that the state / county / province text changes according to the country automatically. I'll add this to the updater but can't release just yet as there are a few more changes going on.

Vince

Click Here for Shopping Cart Software
Click Here to sign up for our newsletter
Click Here for the latest updater

EllenD
Advanced Member

United Kingdom
419 Posts

Posted - 12/01/2020 :  04:29:52  
OK thanks very much Vince, much appreciated your help with this
  « Topic »  
Jump To:
Shopping Cart Software Forum for Ecommerce Templates © 2002-2022 ecommercetemplates.com
This page was generated in 0.03 seconds. Snitz Forums 2000