Category: WooCommerce
-
Extending WooCommerce Product REST API Responses
WooCommerce supports many core properties when fetching a product via the REST API. In this tutorial, we’ll explore three code snippets that extend WooCommerce product responses, allowing for the retrieval and updating of custom fields and metadata. 1. Adding Custom Fields to Product Schema The first snippet focuses on modifying the product schema, defining additional…
-
How to Add a Customizable Field to a WooCommerce Product
UPDATED 9/29/2019: Noticed some code typos and updated some of the display sections for compatibility with WooCommmerce 3.7. In this WooCommerce tutorial I will be showing you how to add a custom field to the front-end of a WooCommerce product. We’ll be adding a text input that a customer could use to enter some special…
-
Create WooCommerce Multicheck Form Field
I’ve expanded on the code I posted in my tutorial on how to customize the WooCommerce Checkout. First you need to register the new checkout fields. This is where I’ve added a current_user_can() to test if the current user has the appropriate capabilities to see these extra fields. I’m using the manage_options capability because it…