0
votes

I'm having major problems customising the checkout page on a WooCommerce site for a client.

They have asked me to move a heap of fields around and, for the most part, I've got it done but the login form is causing me no end of grief.

They have asked that I create something similar to the checkout at www.adairs.com.au and would like the login form to be part of the "Billing Fields" section, and only displayed when a customer clicks the "Existing Member" tab.

I've got everything moved around but when clicking on the "Existing Member" tab to display the login form, and then logging in I get errors saying "Billing First Name", "Billing Last Name" and "Billing Address" are required.

Digging into it, it seems that when I call do_action( 'woocommerce_before_checkout_form', $checkout ) it is creating all the necessary form fields but it is not wrapping it in a form, so there is no data being posted.

I've tried moving the hook around to different parts of both the form-checkout.php and the form-billing.php files but get the same result.

When I call the same hook in the payment.php file, or leave it as it was originally coded the form is created as it should be, but is not rendered to the section of the checkout I am hoping for.

I can't for the life of me figure out why the form is created some times when I call the hook and not others.

I hope this makes sense. Any help would be greatly appreciated.

Thanks in advance, Don

1

1 Answers

0
votes

Sounds like all the "moving around" is breaking the logic. I would look into WooCommerce plugins that allow you to customize the checkout. There are lots of them

Another possibility... if you want the login form "only displayed when a customer clicks the Existing Member tab" why not leave the form where it is -- code wise -- and use JS/JQ to show/hide the actual form inputs. Look at this woo demo theme and click "Returning customer? Click here to login" for one idea.