• Resolved wpseriouslee

    (@wpseriouslee)


    I have a problem when I try to add a new shipping or billing address after registering on my site. When I try to add an address, after pressing submit, the page scrolls to the top of the form as if an error occurred but I see no errors in the debug log or on the page. I tried to test adding a new address with the twentytwenty theme and it works, the only difference between my theme and the twenty twenty one is that I have unset the billing and shipping country field which is a required field. I can however, add an address on checkout without the country field and it shows up in my account but even then, I cannot edit it. If I remove the code that unsets the field, I can add and edit addresses just fine. I’ve provided a link to the site, you can sign up with whatever looks like a valid email address.

    Reproduction Steps.
    1. Register for an account
    2. Go to My Account > Manage Addresses
    3. Click ‘Add’ link
    4. Type in whatever looks like a real address (UK)
    5. Click Save
    6. Observe that nothing changes

    Here is the system status below

    
    ### WordPress Environment ###
    
    WordPress address (URL): https://localhost/ari
    Site address (URL): https://localhost/ari
    WC Version: 4.1.0
    REST API Version: ? 1.0.7
    WC Blocks Version: ? 2.5.16
    Action Scheduler Version: ? 3.1.5
    WC Admin Version: ? 1.1.1
    Log Directory Writable: ?
    WP Version: 5.4.1
    WP Multisite: –
    WP Memory Limit: 512 MB
    WP Debug Mode: ?
    WP Cron: ?
    Language: en_GB
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: Apache/2.4.41 (Win64) OpenSSL/1.1.1c PHP/7.2.29
    PHP Version: 7.2.29
    PHP Post Max Size: 40 MB
    PHP Time Limit: 120
    PHP Max Input Vars: 1000
    cURL Version: 7.67.0
    OpenSSL/1.1.1c
    
    SUHOSIN Installed: –
    MySQL Version: 5.5.5-10.4.11-MariaDB
    Max Upload Size: 40 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ? Your server does not have the SoapClient class enabled - some gateway plugins which use SOAP may not work as expected.
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?
    
    ### Database ###
    
    WC Database Version: 4.1.0
    WC Database Prefix: wp_
    Total Database Size: 4.16MB
    Database Data Size: 2.47MB
    Database Index Size: 1.69MB
    wp_woocommerce_sessions: Data: 0.08MB + 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.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_order_itemmeta: Data: 0.06MB + Index: 0.03MB + 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: 0.08MB + Index: 0.11MB + 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: 0.06MB + Index: 0.03MB + Engine InnoDB
    wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
    wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_litespeed_img_optm: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
    wp_litespeed_optimizer: Data: 0.02MB + Index: 0.03MB + 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_options: Data: 1.11MB + Index: 0.06MB + Engine InnoDB
    wp_postmeta: Data: 0.13MB + Index: 0.14MB + Engine InnoDB
    wp_posts: Data: 0.05MB + Index: 0.06MB + Engine InnoDB
    wp_sbi_instagram_feeds_posts: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_sbi_instagram_posts: 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.08MB + Index: 0.06MB + Engine InnoDB
    wp_users: Data: 0.02MB + Index: 0.05MB + 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_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + 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_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
    wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wpforms_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    
    ### Post Type Counts ###
    
    attachment: 4
    nav_menu_item: 3
    page: 21
    post: 2
    product: 6
    revision: 28
    shop_order: 21
    wpcf7_contact_form: 1
    wpforms: 1
    
    ### Security ###
    
    Secure connection (HTTPS): ?
    					Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates.
    Hide errors from visitors: ?Error messages should not be shown to visitors.
    
    ### Active Plugins (11) ###
    
    All-in-One WP Migration: by ServMask – 7.21
    Contact Form 7: by Takayuki Miyoshi – 5.1.8
    Smash Balloon Instagram Feed: by Smash Balloon – 2.4.2
    Jetpack by WordPress.com: by Automattic – 8.5
    Mailchimp for WooCommerce: by Mailchimp – 2.4.0 – Installed version not tested with active version of WooCommerce 4.1.0
    Regenerate Thumbnails: by Alex Mills (Viper007Bond) – 3.1.3
    WooCommerce Royal Mail Shipping Calculator: by WPRuby – 1.5.2 – Installed version not tested with active version of WooCommerce 4.1.0
    WooCommerce Stripe Gateway: by WooCommerce – 4.3.3 – Installed version not tested with active version of WooCommerce 4.1.0
    WooCommerce Services: by Automattic – 1.23.0 – Installed version not tested with active version of WooCommerce 4.1.0
    WooCommerce: by Automattic – 4.1.0 (update to version 4.1.1 is available)
    WP Mail SMTP: by WPForms – 2.0.1
    
    ### Inactive Plugins (4) ###
    
    Akismet Anti-Spam: by Automattic – 4.1.5
    Clear Cache For Me: by Webhead LLC – 1.4
    Hello Dolly: by Matt Mullenweg – 1.7.2
    LiteSpeed Cache: by LiteSpeed Technologies – 3.0.9
    
    ### Settings ###
    
    API Enabled: –
    Force SSL: –
    Currency: GBP (£)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    
    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: #13 - /shop/
    Basket: #68 - /basket/
    Checkout: #48 - /checkout/
    My account: #49 - /my-account/
    Terms and conditions: #44 - /privacy-policy/
    
    ### Theme ###
    
    Name: AriStore
    Version: 1.1
    Author URL: 
    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: aristore/woocommerce/archive-product.php
    aristore/woocommerce/auth\footer.php
    aristore/woocommerce/auth\form-grant-access.php
    aristore/woocommerce/auth\form-login.php
    aristore/woocommerce/auth\header.php
    aristore/woocommerce/cart\cart-empty.php
    aristore/woocommerce/cart\cart-item-data.php
    aristore/woocommerce/cart\cart-shipping.php
    aristore/woocommerce/cart\cart-totals.php
    aristore/woocommerce/cart\cart.php
    aristore/woocommerce/cart\cross-sells.php
    aristore/woocommerce/cart\mini-cart.php
    aristore/woocommerce/cart\proceed-to-checkout-button.php
    aristore/woocommerce/cart\shipping-calculator.php
    aristore/woocommerce/checkout\cart-errors.php
    aristore/woocommerce/checkout\form-billing.php
    aristore/woocommerce/checkout\form-checkout.php
    aristore/woocommerce/checkout\form-coupon.php
    aristore/woocommerce/checkout\form-login.php
    aristore/woocommerce/checkout\form-pay.php
    aristore/woocommerce/checkout\form-shipping.php
    aristore/woocommerce/checkout\order-receipt.php
    aristore/woocommerce/checkout\payment-method.php
    aristore/woocommerce/checkout\payment.php
    aristore/woocommerce/checkout\review-order.php
    aristore/woocommerce/checkout\terms.php
    aristore/woocommerce/checkout\thankyou.php
    aristore/woocommerce/content-product.php
    aristore/woocommerce/content-product_cat.php
    aristore/woocommerce/content-single-product.php
    aristore/woocommerce/content-widget-price-filter.php
    aristore/woocommerce/content-widget-product.php
    aristore/woocommerce/content-widget-reviews.php
    aristore/woocommerce/emails\admin-cancelled-order.php
    aristore/woocommerce/emails\admin-failed-order.php
    aristore/woocommerce/emails\admin-new-order.php
    aristore/woocommerce/emails\customer-completed-order.php
    aristore/woocommerce/emails\customer-invoice.php
    aristore/woocommerce/emails\customer-new-account.php
    aristore/woocommerce/emails\customer-note.php
    aristore/woocommerce/emails\customer-on-hold-order.php
    aristore/woocommerce/emails\customer-processing-order.php
    aristore/woocommerce/emails\customer-refunded-order.php
    aristore/woocommerce/emails\customer-reset-password.php
    aristore/woocommerce/emails\email-addresses.php
    aristore/woocommerce/emails\email-customer-details.php
    aristore/woocommerce/emails\email-downloads.php
    aristore/woocommerce/emails\email-footer.php
    aristore/woocommerce/emails\email-header.php
    aristore/woocommerce/emails\email-order-details.php
    aristore/woocommerce/emails\email-order-items.php
    aristore/woocommerce/emails\email-styles.php
    aristore/woocommerce/emails\plain\admin-cancelled-order.php
    aristore/woocommerce/emails\plain\admin-failed-order.php
    aristore/woocommerce/emails\plain\admin-new-order.php
    aristore/woocommerce/emails\plain\customer-completed-order.php
    aristore/woocommerce/emails\plain\customer-invoice.php
    aristore/woocommerce/emails\plain\customer-new-account.php
    aristore/woocommerce/emails\plain\customer-note.php
    aristore/woocommerce/emails\plain\customer-on-hold-order.php
    aristore/woocommerce/emails\plain\customer-processing-order.php
    aristore/woocommerce/emails\plain\customer-refunded-order.php
    aristore/woocommerce/emails\plain\customer-reset-password.php
    aristore/woocommerce/emails\plain\email-addresses.php
    aristore/woocommerce/emails\plain\email-customer-details.php
    aristore/woocommerce/emails\plain\email-downloads.php
    aristore/woocommerce/emails\plain\email-order-details.php
    aristore/woocommerce/emails\plain\email-order-items.php
    aristore/woocommerce/global\breadcrumb.php
    aristore/woocommerce/global\form-login.php
    aristore/woocommerce/global\quantity-input.php
    aristore/woocommerce/global\sidebar.php
    aristore/woocommerce/global\wrapper-end.php
    aristore/woocommerce/global\wrapper-start.php
    aristore/woocommerce/loop\add-to-cart.php
    aristore/woocommerce/loop\loop-end.php
    aristore/woocommerce/loop\loop-start.php
    aristore/woocommerce/loop\no-products-found.php
    aristore/woocommerce/loop\orderby.php
    aristore/woocommerce/loop\pagination.php
    aristore/woocommerce/loop\price.php
    aristore/woocommerce/loop\rating.php
    aristore/woocommerce/loop\result-count.php
    aristore/woocommerce/loop\sale-flash.php
    aristore/woocommerce/myaccount\dashboard.php
    aristore/woocommerce/myaccount\downloads.php
    aristore/woocommerce/myaccount\form-add-payment-method.php
    aristore/woocommerce/myaccount\form-edit-account.php
    aristore/woocommerce/myaccount\form-edit-address.php
    aristore/woocommerce/myaccount\form-login.php
    aristore/woocommerce/myaccount\form-lost-password.php
    aristore/woocommerce/myaccount\form-reset-password.php
    aristore/woocommerce/myaccount\lost-password-confirmation.php
    aristore/woocommerce/myaccount\my-account.php
    aristore/woocommerce/myaccount\my-address.php
    aristore/woocommerce/myaccount\my-downloads.php
    aristore/woocommerce/myaccount\my-orders.php
    aristore/woocommerce/myaccount\navigation.php
    aristore/woocommerce/myaccount\orders.php
    aristore/woocommerce/myaccount\payment-methods.php
    aristore/woocommerce/myaccount\view-order.php
    aristore/woocommerce/notices\error.php
    aristore/woocommerce/notices\notice.php
    aristore/woocommerce/notices\success.php
    aristore/woocommerce/order\form-tracking.php
    aristore/woocommerce/order\order-again.php
    aristore/woocommerce/order\order-details-customer.php
    aristore/woocommerce/order\order-details-item.php
    aristore/woocommerce/order\order-details.php
    aristore/woocommerce/order\order-downloads.php
    aristore/woocommerce/order\tracking.php
    aristore/woocommerce/product-searchform.php
    aristore/woocommerce/single-product\add-to-cart\external.php
    aristore/woocommerce/single-product\add-to-cart\grouped.php
    aristore/woocommerce/single-product\add-to-cart\simple.php
    aristore/woocommerce/single-product\add-to-cart\variable.php
    aristore/woocommerce/single-product\add-to-cart\variation-add-to-cart-button.php
    aristore/woocommerce/single-product\add-to-cart\variation.php
    aristore/woocommerce/single-product\meta.php
    aristore/woocommerce/single-product\photoswipe.php
    aristore/woocommerce/single-product\price.php
    aristore/woocommerce/single-product\product-attributes.php
    aristore/woocommerce/single-product\product-image.php
    aristore/woocommerce/single-product\product-thumbnails.php
    aristore/woocommerce/single-product\rating.php
    aristore/woocommerce/single-product\related.php
    aristore/woocommerce/single-product\review-meta.php
    aristore/woocommerce/single-product\review-rating.php
    aristore/woocommerce/single-product\review.php
    aristore/woocommerce/single-product\sale-flash.php
    aristore/woocommerce/single-product\share.php
    aristore/woocommerce/single-product\short-description.php
    aristore/woocommerce/single-product\stock.php
    aristore/woocommerce/single-product\tabs\additional-information.php
    aristore/woocommerce/single-product\tabs\description.php
    aristore/woocommerce/single-product\tabs\tabs.php
    aristore/woocommerce/single-product\title.php
    aristore/woocommerce/single-product\up-sells.php
    aristore/woocommerce/single-product-reviews.php
    aristore/woocommerce/single-product.php
    aristore/woocommerce/taxonomy-product_cat.php
    aristore/woocommerce/taxonomy-product_tag.php
    
    ### Action Scheduler ###
    
    Complete: 125
    Oldest: 2020-05-05 20:56:54 +0000
    Newest: 2020-05-25 23:15:27 +0000
    
    Pending: 1
    Oldest: 2020-05-26 20:16:22 +0000
    Newest: 2020-05-26 20:16:22 +0000
    
    

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hi @wpseriouslee,

    I’ve performed some cross-testing for us today on several of my sites which have the latest versions of WordPress, WooCommerce and our free Storefront theme as the only enabled software. When doing so I’ve not been able to replicate the behaviour which you describe with regards to not being able to enter address parameters if no country is selected.

    I tried to test adding a new address with the twentytwenty theme and it works

    The results of your test above along with the results of my own testing indicates that what you’re experiencing is not directly related to WooCommerce itself.

    I’d suggest carrying out a conflict test in your site to try and locate the culprit. This document below offer guidance on how to conflict test on a WordPress installation.

    https://docs.woocommerce.com/document/how-to-test-for-conflicts/

    If you haven’t carried out this type of testing on your site as yet it’s what we would recommend.

    Thread Starter wpseriouslee

    (@wpseriouslee)

    Quick note, I’ve set display none on the errors at the top of the form and even though I expect errors when I try to submit an empty form, I see nothing there, only until I remove unset shipping/billing country depending on which address I want to add/edit

    Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hey @wpseriouslee,

    As indicated it’s not something we can replicate using WooCommerce and the free Storefront theme.

    Thread Starter wpseriouslee

    (@wpseriouslee)

    Sorry, I hadn’t seen your reply, I will try this conflict testing and see where it takes me; thank you

    Thread Starter wpseriouslee

    (@wpseriouslee)

    Conflict testing did not prove fruitful, so I went for some good old log based debugging, turns out I’m hitting this line

    https://github.com/woocommerce/woocommerce/blob/master/includes/class-wc-form-handler.php#L92

    EDIT: Asked a stupid question, removed it; new question, is there a way I can set the default country to be sent in the payload when I edit address?

    • This reply was modified 4 years, 6 months ago by wpseriouslee.
    Thread Starter wpseriouslee

    (@wpseriouslee)

    The best workaround I can find to allow hiding the country field and still be able to edit billing and shipping addresses is to add this to the form-edit-address.php file

    <input type="hidden" name="billing_country" value="GB" />
    <input type="hidden" name="shipping_country" value="GB" />

    But is this acceptable?

    Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hey @wpseriouslee,

    What you could try as a test to set a defined country at checkout which a customer could change would be to set your Default customer location setting to be Shop base address. That would populate the field with the base country of your store.

    You can configure that setting by navigating to WooCommerce > Settings > General > General options.

    It’s actually best to have a customer populate a Country field for billing as certain payment gateways as an example require that amongst other details to process payment.

    When removing fields you may find that you experiences behaviour like you have described.

    Thread Starter wpseriouslee

    (@wpseriouslee)

    Setting a shop base address did not change anything, the error is still there and I suppose this might just have to be the workaround for now. I get that the customer has to fill in the country and it might interfere with some plugins but my client is adamant about not wanting that field there and now here I sit.

    Plugin Support Stuart Duff – a11n

    (@stuartduff)

    Automattic Happiness Engineer

    Hey @wpseriouslee,

    From what you describe it sounds like your workaround of hiding the fields may be your best approach to meet your client’s project requirements if you’ve found that works for you.

    I’ll mark this topic as resolved for now and if you find an alternative method to solve this you can still reply here in case others are looking for anything similar in the future.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Cannot add a billing or shipping address if country is not provided’ is closed to new replies.