Marketpress - Entering full state name causes errors

One of my MarketPress users reports:

People are still having problems with the checkout on our website. We finally figured out that there is a problem with the box where the costumers enter their state. If you type the name of the state, not the initials, an error message appears and the sale is stopped. We need to at least have something temporarily added that tells them to only use an abbreviation. We've been losing quite a few sales.

Can this be changed to a drop-down box with states to remove this issue?

  • nickd32
    • The Incredible Code Injector

    I added a line to /marketpress-includes/template-functions.php -- instructing users to only put in the abbreviation.

    Another idea would be to simply change the width of the box so that it's much narrower and looks like an abbreviation goes there, rather than the full state/province name.

    Which brings up the question -- how do international (non-U.S.) people abbreviate their province/region? Is it 2 letters or 3?

  • Aaron
    • CTO

    The problem here is what gets put in the state box is dependent on what payment gateway you are using and what countries you are enabling purchases to. I'm not sure what the best course of action would be to improve this though, as any limits we impose could foul up sites that use other gateways and shipping locations.

  • Aaron
    • CTO

    Example, we have a state field on the site here and international people were always running into trouble knowing what to put in it. We had to make the field bigger as it was confusing people. We have to leave it as open-ended as possible for everyone to be able to checkout.

    We could put a check on the shipping page where if it's set to USA then it returns an error if not picked a valid state. Doesn't work for other countries though.

  • nickd32
    • The Incredible Code Injector

    I'm not sure what the best course of action would be to improve this though, as any limits we impose could foul up sites that use other gateways and shipping locations.

    I think the best solution is to put in 2 checks -- one for the payment gateway and one for the country.

    If (Gateway = Paypal) AND (Country = US) --> put in a dropdown box of states which passes the 2-digit state abbreviation.

    If (Gateway = Paypal) AND (Country = UK or GB) --> state is optional

    For Paypal, here are the International standards:
    https://www.x.com/blogs/matt/2010/09/21/international-address-formats

    This is an issue we really need to resolve, because it's causing a royal pain in the backside for Marketpress users who use Paypal and ship both to the US and internationally.

    Perhaps, when the user gets to the "shipping information" page of the checkout, the "Country" drop-down box should be at the top of the form. Then have the regular address fields and rules auto-update based on the country the user selects.

  • Aaron
    • CTO

    If (Gateway = Paypal) AND (Country = US) --> put in a dropdown box of states which passes the 2-digit state abbreviation.

    If (Gateway = Paypal) AND (Country = UK or GB) --> state is optional

    Problem is gateway is unknown at the point of entering the shipping address.

    Then have the regular address fields and rules auto-update based on the country the user selects.

    This should be possible, though will require a bit of AJAX. Country would be weird though to put before the address.

  • brentjohner
    • The Incredible Code Injector

    Our users are struggling with this form also.

    I like the idea of having country drop-down first, where province/state dropdown is updated based on country selection, then city dropdown is updated based on province/state selection. Some systems will even validate address, postal codes, and phone number based on city selected, but I suspect that gets trickier.

    As for different payment gateways expecting province/state in different formats, are there any payment gateways that require full province/state name? Or will they all except abbreviations (with some accepting both)? If we think they all will except abbreviations we could validate accordingly. Otherwise, maybe it could be an option in Store Settings?

    Just some ideas to keep the conversation going...

  • nickd32
    • The Incredible Code Injector

    @Aaron - I think you should know what my clients are telling me about MarketPress. Major thorn in my side to have to go back and try different workarounds for this "full state name causes errors" issue.

    Nick,

    There is still a major issue with the "State" field on the shipping info page that is costing us a lot of money. I know you've attempted to fix it a number of times, but I don't think the solution you've come up with is working. We urgently need these changes (in order of preference):

    -Change the state field to a drop down menu rather than having the customers type it in
    -OR change it to a box that only allows you to type 2 letters so the customers realize as they're typing that they only have the option of the abbreviation (the small box idea isn't working)
    -OR allow both abbreviations and full names in the box.

    If not, it sounds like a flawed plugin and we at least need the note you put next to the state field to say in bold, red all caps "ENTER 2 DIGIT ABBREVIATIONS ONLY FOR STATE, PROVINCE, OR REGION" instead of "IMPORTANT...". Then, on the "Payment Information" page that comes after the shipping info page, start with this, "ATTENTION: IF YOU RECEIVE AN ERROR MESSAGE AFTER ATTEMPTING TO CHECKOUT, please re-enter your shipping state with the 2 DIGIT ABBREVIATION for your state, province or region on the Shipping Information form (the previous page). If you continue to receive an error message, contact customer service at xxxx@gmail.com." Then add what you have now-- "Please click the "Continue Checkout" button to process your payment securely via Paypal."

    Can you get to these things tomorrow for us? We've been disappointed with how the store has been functioning and feel that these issues should be resolved as part of the work we've paid for already. Is that doable?

    Thank you,
    xxxx

  • Philip John
    • DEV MAN’s Apprentice

    Hiya guys,

    Suggestion for Aaron here really: would a lookup be feasible? I.e. we know that AZ means Arizona so how about some sort of look up table when moving onto gateway stage so that MP can convert AZ to Arizona or vice versa where the gateway demands it?

    Phil

  • nickd32
    • The Incredible Code Injector

    I thought about that too, but I really think the best long-term fix is to have an AJAX form with the country dropdown box at the top.

    Then, if US is selected as the shipping country, the state box becomes a dropdown.

    This is exactly how Paypal works -- see the screenshot above.

  • Aaron
    • CTO

    I put a temporary fix into 2.0 already, there is a check for valid state abreviation, and a userfriendly notice to enter the 2 letter abreviation. That keeps them from getting to the payment page and seeing gateway errors.

    Ran out of time for autofill though. Still planning it.

  • brentjohner
    • The Incredible Code Injector

    Hi Aaron,

    I may not be reading this right but if your fix is what I think it is, it doesn't seem to be working for me.

    I tried entering a long, bogus state/province/region (QRWERQWE) and I wasn't stopped from proceeding.

    Should I have been forced to enter a 2 letter abbreviation?

    MP Version 2.0.6

    Shaun

  • brentjohner
    • The Incredible Code Injector

    +1 for dropdown box.

    Only if they select United States as their country.

    Any reason only United States? Our site is configured for Canada and there is no validation on user entry. Now that the MP taxes are tied to an abbreviated province (i.e. AB, BC, PE, ...) I am investigating options.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.