woocommerce / woocommerce-gateway-paypal-express-checkout

58 stars 65 forks source link

Puerto Rico is returned from PayPal as a state, fails WooCommerce US state validation #824

Open jessLundie opened 3 years ago

jessLundie commented 3 years ago

Describe the bug

Customers in Puerto Rico are not able to check out when Puerto Rico addresses are passed back to WooCommerce from PayPal due to a Billing State field validation error in WooCommerce.

As far as I can tell, this is because PayPal handles Puerto Rico as a US state. WooCommerce expects Puerto Rico as a country and passing back Puerto Rico as a state fails the validation for US states.

To reproduce

  1. Place a product in the cart
  2. Use the PayPal button on cart checkout
  3. On the PayPal side, use or add a Puerto Rico address
  4. Try to complete checkout
  5. See validation error

Screenshots

https://d.pr/i/hK83KM Full Image: https://d.pr/i/hK83KM

https://d.pr/i/e1ALB2 Full Image: https://d.pr/i/e1ALB2

Expected behavior

I expected to be able to complete check out with a PayPal-saved address in Puerto Rico with no error.

Environment (please complete the following information):

Additional details

System status ``` ### WordPress Environment ### WordPress address (URL): https://maintest.mystagingwebsite.com Site address (URL): https://maintest.mystagingwebsite.com WC Version: 4.5.2 REST API Version: ✔ 4.5.2 WC Blocks Version: ✔ 3.1.0 Action Scheduler Version: ✔ 3.1.6 WC Admin Version: ✔ 1.5.0 Log Directory Writable: ✔ WP Version: 5.5.1 WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: ✔ Language: en_US External object cache: ✔ ### Server Environment ### Server Info: nginx PHP Version: 7.2.34 PHP Post Max Size: 2 GB PHP Time Limit: 1200 PHP Max Input Vars: 6144 cURL Version: 7.72.0 OpenSSL/1.1.0l SUHOSIN Installed: – MySQL Version: 5.5.5-10.3.21-MariaDB-log Max Upload Size: 2 GB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔ ### Database ### WC Database Version: 4.5.2 WC Database Prefix: wp_ Total Database Size: 1070.66MB Database Data Size: 620.55MB Database Index Size: 450.11MB wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 0.08MB + Index: 0.05MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 0.50MB + Index: 0.52MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 319.42MB + Index: 268.70MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 270.33MB + Index: 172.39MB + Engine InnoDB wp_advanced_notifications: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_advanced_notification_triggers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ariadminer_connections: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_automatewoo_abandoned_carts: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_automatewoo_customers: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_automatewoo_customer_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_automatewoo_events: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_automatewoo_guests: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_automatewoo_guest_meta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_automatewoo_logs: Data: 0.16MB + Index: 0.25MB + Engine InnoDB wp_automatewoo_log_meta: Data: 0.45MB + Index: 0.52MB + Engine InnoDB wp_automatewoo_queue: Data: 0.16MB + Index: 0.23MB + Engine InnoDB wp_automatewoo_queue_meta: Data: 1.52MB + Index: 0.58MB + Engine InnoDB wp_automatewoo_referrals: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_automatewoo_referral_advocate_keys: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_automatewoo_referral_invites: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 1.14MB + Index: 0.45MB + Engine InnoDB wp_failed_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_fm_log: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_followup_coupons: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_coupon_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_followup_customers: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_followup_customer_carts: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_customer_notes: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_customer_orders: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_followup_email_excludes: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_followup_email_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_followup_email_orders: Data: 2.11MB + Index: 0.09MB + Engine InnoDB wp_followup_email_tracking: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_followup_followup_history: Data: 0.08MB + Index: 0.05MB + Engine InnoDB wp_followup_order_categories: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_order_items: Data: 0.05MB + Index: 0.05MB + Engine InnoDB wp_followup_subscribers: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_subscribers_to_lists: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_followup_subscriber_lists: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_mailchimp_carts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_mailchimp_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ms_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_options: Data: 1.06MB + Index: 0.13MB + Engine InnoDB wp_postmeta: Data: 2.50MB + Index: 2.88MB + Engine InnoDB wp_posts: Data: 1.22MB + Index: 0.30MB + Engine InnoDB wp_queue: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_say_what_strings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_termmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_usermeta: Data: 0.16MB + Index: 0.14MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wcpv_commissions: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wcpv_per_product_shipping_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wcrp_rental_products_rentals: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wcs_payment_retries: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_bookings_availability: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_bookings_availabilitymeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_booking_relationships: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_deposits_payment_plans: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_deposits_payment_plans_schedule: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_points_rewards_user_points: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_points_rewards_user_points_log: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.05MB + Index: 0.09MB + Engine InnoDB wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_warranty_products: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_bundled_itemmeta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_bundled_items: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_per_product_shipping_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_pickup_locations_geodata: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_woocommerce_shipping_flat_rate_boxes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_table_rates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_software_activations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_software_licenses: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_square_customers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_subscription_downloads: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpfm_backup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpml_mails: Data: 17.52MB + Index: 0.00MB + Engine InnoDB wp_wps_hit: Data: 0.02MB + Index: 0.14MB + Engine InnoDB wp_wps_index: Data: 0.11MB + Index: 0.16MB + Engine InnoDB wp_wps_key: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wps_object_type: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_wps_query: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wps_uri: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wps_user_agent: Data: 0.02MB + Index: 0.02MB + Engine InnoDB ### Post Type Counts ### attachment: 44 aw_workflow: 50 bookable_person: 2 bookable_resource: 11 custom_css: 1 customize_changeset: 2 easy-pricing-table: 1 event_ticket: 2 follow_up_email: 5 global_product_addon: 1 mc4wp-form: 1 nav_menu_item: 18 page: 31 post: 2 product: 147 product_variation: 192 revision: 43 shop_coupon: 24 shop_order: 542 shop_order_refund: 13 shop_subscription: 104 wc_booking: 30 wc_membership_plan: 3 wc_memberships_team: 2 wc_pickup_location: 2 wc_user_membership: 4 wcpf_item: 4 wcpf_project: 1 ### Security ### Secure connection (HTTPS): ✔ Hide errors from visitors: ✔ ### Active Plugins (9) ### ARI Adminer: by ARI Soft – 1.2.3 AutomateWoo: by WooCommerce – 5.0.3 Say What?: by Lee Willis – 1.9.6 Stop Emails: by Sal Ferrarello – 1.2.1 WooCommerce Additional Variation Images: by WooCommerce – 1.7.26 WooCommerce PayPal Checkout Gateway: by WooCommerce – 2.1.0 WooCommerce Subscriptions: by WooCommerce – 3.0.9 WooCommerce: by Automattic – 4.5.2 WP phpMyAdmin: by Puvox.software – 3.03.1 ### Inactive Plugins (111) ### Action Scheduler: by Automattic – 3.1.2 Akismet Anti-Spam: by Automattic – 4.1.6 AutomateWoo - Birthdays Add-on: by WooCommerce – 1.1.1 (update to version 1.1.2 is available) – Installed version not tested with active version of WooCommerce 4.5.2 AutomateWoo - Refer A Friend Add-on: by WooCommerce – 2.5.5 – Installed version not tested with active version of WooCommerce 4.5.2 AutomateWoo - Subscriptions Add-on: by Prospress Inc. – 1.0.1 – Installed version not tested with active version of WooCommerce 4.5.2 Classic Editor: by WordPress Contributors – 1.6 Code Snippets: by Code Snippets Pro – 2.14.0 Disable PayPal Reference Transactions: by Matt Allan – 1.0 Don't autocomplete orders: by – 1.0 Easy Pricing Tables by Fatcat Apps: by Fatcat Apps – 2.4.4 Enable jQuery Migrate Helper: by The WordPress Team – 1.0.1 Extend WooCommerce Subscription Intervals: by Brent Shepherd – 1.0 – Installed version not tested with active version of WooCommerce 4.5.2 File Manager: by Aftabul Islam – 5.1.9 Fix Action Scheduler Action IDs: by Automattic – 0.2 Follow-Up Emails: by WooCommerce – 4.9.2 (update to version 4.9.8 is available) – Installed version not tested with active version of WooCommerce 4.5.2 Health Check & Troubleshooting: by The WordPress.org community – 1.4.4 Jetpack by WordPress.com: by Automattic – 9.0.2 Mailchimp for WooCommerce: by Mailchimp – 2.4.0 – Installed version not tested with active version of WooCommerce 4.5.2 MC4WP: Mailchimp for WordPress: by ibericode – 4.7.8 Meks Quick Plugin Disabler: by Meks – 1.0 Product Filters for WooCommerce: by Nexter – 1.1.16 (update to version 1.2.3 is available) – Installed version not tested with active version of WooCommerce 4.5.2 Query Monitor: by John Blackbourn – 3.6.4 Quote Request for WooCommerce: by FantasticPlugins – 1.0 – Installed version not tested with active version of WooCommerce 4.5.2 Rental Products: by 99w – 2.0.2 (update to version 2.3.0 is available) – Installed version not tested with active version of WooCommerce 4.5.2 Storefront Blog Customiser: by WooCommerce – 1.3.0 Storefront Blog Excerpt: by Wooassist – 1.1.4 Storefront Parallax Hero: by WooCommerce – 1.5.7 Storefront Powerpack: by WooCommerce – 1.5.0 Storefront Product Hero: by WooThemes – 1.2.13 Subscriptions Order Complete - Extra Logging: by WooCommerce - Ohana W.B. – 1.0 – Installed version not tested with active version of WooCommerce 4.5.2 Teams for WooCommerce Memberships: by SkyVerge – 1.4.0 (update to version 1.4.3 is available) – Installed version not tested with active version of WooCommerce 4.5.2 Transients Manager: by Pippin Williamson – 1.8 Troubleshooting code: by – 1.0 User Role Editor: by Vladimir Garagulya – 4.55.1 User Switching: by John Blackbourn & contributors – 1.5.5 WooCommerce - ShipStation Integration: by WooCommerce – 4.1.37 (update to version 4.1.39 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Accommodation Bookings: by WooCommerce – 1.1.17 (update to version 1.1.21 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Admin: by WooCommerce – 1.1.3 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce All Products For Subscriptions: by SomewhereWarm – 3.1.5 (update to version 3.1.18 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Amazon S3 Storage: by WooCommerce – 2.1.18 (update to version 2.1.22 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce AvaTax: by SkyVerge – 1.10.2 (update to version 1.10.4 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Bookings: by WooCommerce – 1.15.26 (update to version 1.15.29 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Box Office: by WooCommerce – 1.1.19 (update to version 1.1.29 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Canada Post Shipping: by WooCommerce – 2.5.18 (update to version 2.5.19 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Chained Products: by StoreApps – 2.9.6 (update to version 2.9.8 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Composite Products: by SomewhereWarm – 6.2.2 (update to version 7.1.1 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Conditional Shipping and Payments: by SomewhereWarm – 1.8.4 (update to version 1.8.6 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Deposits: by WooCommerce – 1.5.4 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Distance Rate Shipping: by Automattic – 1.0.18 (update to version 1.0.26 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Dropshipping: by WooCommerce – 2.4 (update to version 2.7 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Dynamic Pricing: by Lucas Stark – 3.1.21 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce eWAY Payment Gateway: by WooCommerce – 3.1.24 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce FedEx Shipping: by WooCommerce – 3.4.31 (update to version 3.4.33 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Flat Rate Box Shipping: by WooCommerce – 2.0.10 (update to version 2.0.16 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Force Sells: by WooCommerce – 1.1.25 (update to version 1.1.27 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Google Analytics Integration: by WooCommerce – 1.4.23 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Local Pickup Plus: by SkyVerge – 2.8.2 (update to version 2.9.2 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Memberships: by SkyVerge – 1.18.0 (update to version 1.19.1 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Min/Max Quantities: by WooCommerce – 2.4.17 (update to version 2.4.20 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Mix and Match: by Kathy Darling – 1.7.0 (update to version 1.10.3 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Multi-currency: by TIV.NET INC – 2.5.4 (update to version 2.6.7 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Name Your Price: by Kathy Darling – 2.9.6 (update to version 3.1.6 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce New Zealand Post: by WooCommerce – 2.0.2 (update to version 2.1.1 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce One Page Checkout: by Automattic – 1.7.5 (update to version 1.7.9 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Order Delivery: by Themesquad – 1.7.0 (update to version 1.8.1 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Payments: by Automattic – 1.3.0 (update to version 1.5.0 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce PayPal Payments Advanced Gateway: by WooCommerce – 1.24.11 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce PayPal Pro (Classic and PayFlow Editions) Gateway: by WooCommerce – 4.5.0 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce PayPal Pro Hosted: by WooCommerce – 1.0.20 (update to version 1.0.22 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce PDF Invoices: by Andrew Benbow – 4.6.4 (update to version 4.7.4 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Points and Rewards: by WooCommerce – 1.6.36 (update to version 1.6.38 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Points and Rewards: by WooCommerce – 1.6.36 (update to version 1.6.38 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Pre-Orders: by WooCommerce – 1.5.26 (update to version 1.5.29 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Product Add-ons: by WooCommerce – 3.0.38 (update to version 3.1.0 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Product Bundles: by SomewhereWarm – 6.3.5 (update to version 6.4.1 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Product CSV Import Suite: by WooCommerce – 1.10.36 (update to version 1.10.37 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Product Search: by itthinx – 2.20.0 (update to version 3.1.1 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Product Vendors: by WooCommerce – 2.1.34 (update to version 2.1.43 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Purchase Order Payment Gateway: by WooCommerce – 1.2.5 (update to version 1.2.12 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Quick View: by WooCommerce – 1.2.4 (update to version 1.2.12 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Sale Flash Pro: by WooCommerce – 1.2.18 (update to version 1.2.19 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Sales Report Email: by WooCommerce – 1.1.12 (update to version 1.1.17 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Services: by Automattic – 1.24.0 (update to version 1.25.0 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Shipment Tracking: by WooCommerce – 1.6.19 (update to version 1.6.26 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Shipping Per Product v2: by WooCommerce – 2.3.0 (update to version 2.3.12 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Ship to Multiple Addresses: by WooCommerce – 3.6.17 (update to version 3.6.23 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Smart Coupons: by StoreApps – 4.1.0 (update to version 4.9.5 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Software Add-On: by WooCommerce – 1.7.9 (update to version 1.7.17 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Square: by WooCommerce – 2.2.2 WooCommerce Store Credit: by Themesquad – 3.2.1 (update to version 3.2.2 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Stripe Gateway: by WooCommerce – 4.5.2 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Subscription Downloads: by WooCommerce – 1.1.25 (update to version 1.1.30 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Subscriptions - Advanced Options: by Automattic. – 1.0 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Subscriptions - Auto-Complete Orders: by Prospress Inc. – 1.3.0 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Subscriptions - Custom Price String: by Prospress Inc. – 1.0.1 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Subscriptions - Preserve Billing Schedule: by Prospress Inc. – 1.0.0 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Subscriptions - Reset Next Payment Dates: by Prospress Inc. – 1.1.0 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Subscriptions CSV Importer and Exporter: by Prospress Inc – 2.0.1 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Subscriptions Gifting: by WooCommerce – 2.1.0 (update to version 2.1.1 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Subscriptions Load Deprecation Handlers: by Prospress Inc. – 1.0 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Subscriptions Restrict Product: by Prospress Inc. – 1.0.2 – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Table Rate Shipping: by WooCommerce – 3.0.24 (update to version 3.0.30 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce UPS Shipping: by WooCommerce – 3.2.22 (update to version 3.2.29 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce USPS Shipping: by WooCommerce – 4.4.48 WooCommerce Warranty Requests: by WooCommerce – 1.9.11 (update to version 1.9.19 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WooCommerce Xero Integration: by WooCommerce – 1.7.32 (update to version 1.7.33 is available) – Installed version not tested with active version of WooCommerce 4.5.2 WordPress Importer: by wordpressdotorg – 0.7 WP Add Mime Types: by Kimiya Kitani – 2.5.4 WP Crontrol: by John Blackbourn & crontributors – 1.8.5 WP File Manager: by mndpsingh287 – 5.7 WP Mail Logging: by MailPoet – 1.9.7 ### Dropin Plugins (2) ### advanced-cache.php: advanced-cache.php object-cache.php: Memcached ### Must Use Plugins (1) ### Health Check Troubleshooting Mode: by – 1.7.1 ### Settings ### API Enabled: – Force SSL: – Currency: USD ($) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 2 Taxonomies: Product Types: booking (booking) bundle (bundle) composite (composite) external (external) grouped (grouped) mix and match (mix-and-match) simple (simple) subscription (subscription) variable (variable) variable subscription (variable-subscription) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: ✔ ### WC Pages ### Shop base: ❌ Page not set Cart: ❌ Page not set Checkout: #7 - /checkout/ My account: #8 - /my-account/ Terms and conditions: ❌ Page not set ### Theme ### Name: Storefront Version: 2.6.0 (update to version 2.8.0 is available) Author URL: https://woocommerce.com/ Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ✔ ### Templates ### Overrides: – ### Subscriptions ### WCS_DEBUG: ✔ No Subscriptions Mode: ✔ Live Subscriptions Live URL: https://maintest.mystagingwebsite.com Subscription Statuses: wc-active: 30 wc-expired: 2 wc-pending: 1 wc-on-hold: 55 wc-cancelled: 16 WooCommerce Account Connected: ✔ Yes Active Product Key: ❌ No Custom Retry Rules: ✔ No Custom Retry Rule Class: ✔ No Custom Raw Retry Rule: ✔ No Custom Retry Rule: ✔ No Retries Migration Status: ✔ Completed Report Cache Enabled: ✔ Yes Cache Update Failures: ✔ 0 failure ### Store Setup ### Country / State: United States (US) — Washington ### Subscriptions by Payment Gateway ### other: wc-on-hold: 2 wc-active: 3 wc-cancelled: 7 wc-active: 24 wc-cancelled: 7 wc-expired: 1 wc-on-hold: 43 PayPal Checkout: wc-active: 2 wc-cancelled: 1 wc-on-hold: 1 ### Payment Gateway Support ### PayPal Checkout: products refunds subscriptions subscription_cancellation subscription_reactivation subscription_suspension multiple_subscriptions subscription_payment_method_change_customer subscription_payment_method_change_admin subscription_amount_changes subscription_date_changes ### Action Scheduler ### Complete: 995,507 Oldest: 2020-05-20 12:24:33 -0700 Newest: 2020-10-14 09:47:06 -0700 Pending: 27 Oldest: 2020-10-14 10:28:11 -0700 Newest: 2022-09-21 21:17:05 -0700 Failed: 2 Oldest: 2020-01-01 03:00:00 -0800 Newest: 2020-06-15 17:30:30 -0700 ```
zqh375 commented 3 years ago

not just Puerto Rico

GeoJunkie commented 3 years ago

Reported in 3520637-zen

tijosh commented 3 years ago

26416222-hc

chickenn00dle commented 3 years ago

Hey @jessLundie, I'm sorry it's taken so long for us to get to this!!!

It'll probably take some time to find the best way forward here, but for now, the following snippet is a workaround. It tells WC to remove PR from the countries array and add PR to the array of US States:

add_filter( 'woocommerce_countries', 'remove_pr_from_countries' );

function remove_pr_from_countries( $countries ) {
    unset( $countries['PR'] );
    return $countries; 
}

add_filter( 'woocommerce_states', 'add_pr_to_us_states' );

function add_pr_to_us_states( $states ) {
    $states['US']['PR'] = 'Puerto Rico';
    return $states;
}

Note I've only tested this with WC and PPEC active, and can't say whether it will affect other extensions (i.e. other gateways, or shipping extensions).

yankarley commented 1 year ago

Hey @jessLundie, I'm sorry it's taken so long for us to get to this!!!

It'll probably take some time to find the best way forward here, but for now, the following snippet is a workaround. It tells WC to remove PR from the countries array and add PR to the array of US States:

add_filter( 'woocommerce_countries', 'remove_pr_from_countries' );

function remove_pr_from_countries( $countries ) {
  unset( $countries['PR'] );
  return $countries; 
}

add_filter( 'woocommerce_states', 'add_pr_to_us_states' );

function add_pr_to_us_states( $states ) {
  $states['US']['PR'] = 'Puerto Rico';
  return $states;
}

Note I've only tested this with WC and PPEC active, and can't say whether it will affect other extensions (i.e. other gateways, or shipping extensions).

Please guys, give an update on this because I see WooCommerce is still in the wrong with PR and it's causing me problems on my page for all types of checkouts like Klarna...also every client gets an annoying message at checkout about "PR" not being a valid choice...

yankarley commented 1 year ago

Hey @jessLundie, I'm sorry it's taken so long for us to get to this!!!

It'll probably take some time to find the best way forward here, but for now, the following snippet is a workaround. It tells WC to remove PR from the countries array and add PR to the array of US States:

add_filter( 'woocommerce_countries', 'remove_pr_from_countries' );

function remove_pr_from_countries( $countries ) {
  unset( $countries['PR'] );
  return $countries; 
}

add_filter( 'woocommerce_states', 'add_pr_to_us_states' );

function add_pr_to_us_states( $states ) {
  $states['US']['PR'] = 'Puerto Rico';
  return $states;
}

Note I've only tested this with WC and PPEC active, and can't say whether it will affect other extensions (i.e. other gateways, or shipping extensions).

where do I put this code? new to WP!

yankarley commented 1 year ago

Hey @jessLundie, I'm sorry it's taken so long for us to get to this!!!

It'll probably take some time to find the best way forward here, but for now, the following snippet is a workaround. It tells WC to remove PR from the countries array and add PR to the array of US States:

add_filter( 'woocommerce_countries', 'remove_pr_from_countries' );

function remove_pr_from_countries( $countries ) {
  unset( $countries['PR'] );
  return $countries; 
}

add_filter( 'woocommerce_states', 'add_pr_to_us_states' );

function add_pr_to_us_states( $states ) {
  $states['US']['PR'] = 'Puerto Rico';
  return $states;
}

Note I've only tested this with WC and PPEC active, and can't say whether it will affect other extensions (i.e. other gateways, or shipping extensions).

downloaded WP Code! What type of snippet should I put it as?

yankarley commented 1 year ago

Hey @jessLundie, I'm sorry it's taken so long for us to get to this!!!

It'll probably take some time to find the best way forward here, but for now, the following snippet is a workaround. It tells WC to remove PR from the countries array and add PR to the array of US States:

add_filter( 'woocommerce_countries', 'remove_pr_from_countries' );

function remove_pr_from_countries( $countries ) {
  unset( $countries['PR'] );
  return $countries; 
}

add_filter( 'woocommerce_states', 'add_pr_to_us_states' );

function add_pr_to_us_states( $states ) {
  $states['US']['PR'] = 'Puerto Rico';
  return $states;
}

Note I've only tested this with WC and PPEC active, and can't say whether it will affect other extensions (i.e. other gateways, or shipping extensions).

ok added it as a PHP and it works BUT...I am still getting the same error message on top (screenshot below) and the same problem with Klarna not appearing :(

2023-02-21