Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    7,518
    Plugin Contributions
    8

    Default Re: Empty state causes duplicate entry of city

    Quote Originally Posted by simon1066 View Post
    I believe that I made the state field optional - Minimum Values > State > Minimum length of state = [blank], I can't find any reference to it being 'required' in guest checkout.
    Maybe I'm really missing the business model that says, "Remove the requirement for the customer to enter their state and then complain that PayPal doesn't give it to me on return." is the right way to go.
    I'm surprised that PayPal doesn't throw at least a warning in this scenario. Are you not posting the PayPal check out button on the shopping cart?
    Did you read the posting tips?!?
    Responsive Color Changes for 155-156c demo here.
    Zen Cart PCI Compatible Hosting

  2. #12
    Join Date
    Jan 2004
    Posts
    65,475
    Blog Entries
    7
    Plugin Contributions
    237

    Default Re: Empty state causes duplicate entry of city

    @dbltoe ... have you worked much with UK addresses? There's no such thing as a "State" there.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #13
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    7,518
    Plugin Contributions
    8

    Default Re: Empty state causes duplicate entry of city

    Saw nothing that indicated a non-US situation.

    Relevant? -- http://www.factiva.com/CP_Developer/...ince_table.htm
    Did you read the posting tips?!?
    Responsive Color Changes for 155-156c demo here.
    Zen Cart PCI Compatible Hosting

  4. #14
    Join Date
    Feb 2009
    Location
    UK
    Posts
    775
    Plugin Contributions
    0

    Default Re: Empty state causes duplicate entry of city

    Quote Originally Posted by dbltoe View Post
    Maybe I'm really missing the business model that says, "Remove the requirement for the customer to enter their state and then complain that PayPal doesn't give it to me on return." is the right way to go.
    I'm surprised that PayPal doesn't throw at least a warning in this scenario. Are you not posting the PayPal check out button on the shopping cart?
    Yes, I guess there's no business model in that sense, I set up the no state feature ages ago - just to give customers one less field to enter. (perhaps most people use autofill these days). If I'm offering PayPal as an option then I guess I should really get the state during checkout.

    I don't have the PayPal EC button - just PayPal as one of the payment options
    Simon

  5. #15
    Join Date
    Jan 2004
    Posts
    65,475
    Blog Entries
    7
    Plugin Contributions
    237

    Default Re: Empty state causes duplicate entry of city

    @simon,

    I may have found it.

    In the PayPal Pro module I'd written this comment:
    Code:
          // if State is not supplied, repeat the city so that it's not blank, otherwise PayPal croaks
          if ((!isset($optionsShip['SHIPTOSTATE']) || trim($optionsShip['SHIPTOSTATE']) == '') && isset($optionsShip['SHIPTOCITY'])) $optionsShip['SHIPTOSTATE'] = $optionsShip['SHIPTOCITY'];
    ... presumably because PayPal was rejecting orders that had no State filled in.

    In the Express Checkout module the same logic is also present:
    Code:
          // if State is not supplied, repeat the city so that it's not blank, otherwise PayPal croaks
          if ((!isset($options['PAYMENTREQUEST_0_SHIPTOSTATE']) || trim($options['PAYMENTREQUEST_0_SHIPTOSTATE']) == '') && !empty($options['PAYMENTREQUEST_0_SHIPTOCITY'])) {
              $options['PAYMENTREQUEST_0_SHIPTOSTATE'] = $options['PAYMENTREQUEST_0_SHIPTOCITY'];
          }
    
    ... and later ...
    
    
    'ship_state'    => (isset($response['PAYMENTREQUEST_0_SHIPTOSTATE']) && $response['PAYMENTREQUEST_0_SHIPTOSTATE'] !='' ? urldecode($response['PAYMENTREQUEST_0_SHIPTOSTATE']) : urldecode($response['PAYMENTREQUEST_0_SHIPTOCITY'])),
    When receiving the order back from PayPal and creating address-book entries for it, there's no checking to see whether the city and state are identical strings in order to revert the duplication.
    Granted, it's not always true that an exact duplication is "wrong". Consider the city of "New York" in the state of "New York".
    I suppose in the NY case though there's likely already a Zone for it, so maybe we could only blank-out the State if it matches the City and there's no Zone found for it? ZC only uses the State name if there's no zone match, so that'd probably be a safe cleanup.

    I suppose the simple way to test whether the problem is still relevant is to change the logic to use an empty string instead of doing the city substitution, and see if the same order gives you any errors.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  6. #16
    Join Date
    Feb 2009
    Location
    UK
    Posts
    775
    Plugin Contributions
    0

    Default Re: Empty state causes duplicate entry of city

    Thank you for looking into this more deeply. It's good to be able to identify the reason behind the duplication.

    This is getting a tad complicated. I'll probably have to hold my hands up, opt for the easy way out, and reinstate the requirement for a state.
    Simon

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. v156 Autofill City & State from Zip Code
    By chadlly2003 in forum General Questions
    Replies: 4
    Last Post: 12 Feb 2020, 06:48 AM
  2. v139d Trouble making city+state fields readonly
    By gump47371 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 27 Oct 2012, 07:30 AM
  3. Postcode, city, state customization
    By yokozuna in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 3 Jan 2012, 05:17 AM
  4. 10736 Shipping Address Invalid City State Postal
    By jwashburn in forum PayPal Express Checkout support
    Replies: 30
    Last Post: 6 Jan 2010, 11:13 PM
  5. tax based on city in same state
    By fairview in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 2
    Last Post: 20 Dec 2006, 09:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR