Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
WooCommerce Cookbook

You're reading from   WooCommerce Cookbook WooCommerce makes it easy to create, design, and manage your own personalized eCommerce store - this WooCommerce tutorial eBook will show you how to get started

Arrow left icon
Product type Paperback
Published in Mar 2015
Publisher Packt
ISBN-13 9781784394059
Length 248 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Author (1):
Arrow left icon
Patrick Rauland Patrick Rauland
Author Profile Icon Patrick Rauland
Patrick Rauland
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. WooCommerce Basics FREE CHAPTER 2. Adding Products 3. Changing the Product Organization 4. Running a Membership Site 5. Setting Up Shipping Methods 6. Getting Paid 7. Modifying the Checkout Process 8. Managing Orders and Taxes 9. WooCommerce Theming 10. Exploring More with WooCommerce Index

Hiding all checkout fields for virtual products


WooCommerce is pretty smart. If you only have virtual products such as memberships or downloadable products in the cart, WooCommerce won't ask for any shipping information. But some people want to take this a step further. They don't want all of the billing details—they only want the bare minimum information.

WooCommerce doesn't automatically remove these fields because some payment gateways require more billing information. If your payment gateway doesn't require billing details, then you could do this and make the checkout process a bit smoother. The best way to find out if your payment gateway allows this is to try the following code snippet and do a test purchase.

How to do it…

We'll have to add some code to our functions.php file in our theme or create a custom WooCommerce plugin.

  1. At the bottom of your theme's functions.php file, add the following code to change the checkout fields that are displayed to the user:

    // Remove unnecessary checkout...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime