I am selling digital downloads on my WordPress site using Woocommerce. I have been able to use a plugin to customize the checkout page so that customers only have to give their first and last names and email address to purchase a product. I would like the same thing to show on the Customer Information page and Edit My Address page and Account page.
Right now at the bottom of the Account page, it’s calling information from the my-address.php
page. It calls Billing Address (First and Last Name) and Shipping Address, which doesn’t show up because they have not been required to enter a shipping address.
I would like the Billing Address to be “Name” and the Shipping Address to be “Email” and to have the person’s email address to be called from my-address.php
. I actually know how to change the Billing Address to Name. But I can’t figure out how to change Shipping Address to Email and to have the person’s email show up.
Does anyone have a clue how I could do this?
Thanks for your time.
If you copy the template files from the plugin directory to your theme (or child theme) directory, you can edit them to get what you want. The files in your theme directory will override the stock plugin template.
So the original templates are in
plugins/woocommerce/templates/myaccount
Move the files you want to alter (probably just
my-address.php
, and/ormy-account.php
) tothemes/my-theme/woocommerce/templates/myaccount/
.(NB: that’s what the docs say, although I’ve found that the directory ought to be
themes/my-theme/woocommerce/myaccount/
âalthough that could be from conflicting plugins I also have installed.)When you’re editing the PHP file, the fields you’re after are:
The
my-address.php
file has an array that’s similar:$name
gets substituted as'billing'
, so you can just change one of those address lines to'_email'
if you like.