Skip to content

Instantly share code, notes, and snippets.

@clifgriffin
Created November 26, 2019 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clifgriffin/32349f2b2c3c4fce2fc63ddc77682b34 to your computer and use it in GitHub Desktop.
Save clifgriffin/32349f2b2c3c4fce2fc63ddc77682b34 to your computer and use it in GitHub Desktop.
For different billing address for CheckoutWC.
<?php
// Do NOT include opening PHP tag above
// Add to functions.php
add_filter( 'cfw_force_display_billing_address', '__return_true' );
@edirpedro
Copy link

Hi, I noticed that in the plugin Checkout WC the logic for Billing and Shipping forms is not the same by Woocommerce, for the plugin the Billing form is optional and for Woocommerce the Shipping form is the optional. This is causing problems with plugins that put additional required fields on the Billing form that is the main form for Woocommerce.

This hook can help, but it makes the user fills his address twice in most cases. Instead, why not provide an option to switch those forms? I'm telling my ideia and I hope this can help to reorganize those forms without changing the Shopify checkout style but make it work the way Woocommerce built those forms.

The tabs:

  • Information: Use billing form even if the title says Shipping address. (Plugins that put additional fields here will work better)
  • Shipping: When clicking at "change" on Ship to address, the Shipping form should be opened to provide the additional shipping address.
  • Payment: No need to show the billing form.

@clifgriffin
Copy link
Author

Hi @edirpedro,

I hear you. We have worked around this issue with many plugins by either replicating the fields in the shipping address or by moving the fields outside of the billing address and rendering them beneath.

The reason we haven't pursued that flow is that it puts the billing address 2 steps away from the payment information, and those two things are very related as one of the most common reasons for CC rejections is billing address mismatches.

Which plugin are you experiencing the issue with? Feel free to send us a support request: support@checkoutwc.com

We work through these types of issues all of the time.

Best,
Clif

@edirpedro
Copy link

Hi @clifgriffin,

https://wordpress.org/plugins/woocommerce-extra-checkout-fields-for-brazil/

This is the plugin every brazillian stores use to add fields like ID number that identify the person or company. Some are required fields and when the error message appears requiring that field, users can't find the form because it's optional on the checkout. Till now I can't see any solution for me, in my tests users are confusing with filling two forms, shipping and billing, with almost the same information. Just telling you to provide a feedback, the rest of the plugin works pretty good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment