Custom WordPress and WooCommerce Development

  • 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…

  • Add Custom Meta Fields to WooCommerce Variations

    WooCommerce offers a robust platform for building and managing online stores, and one of its powerful features is product variations. Variations allow you to offer different versions of a product, such as varying sizes, colors, or other attributes. In this blog post, we’ll explore how to extend WooCommerce variations by adding custom information specific to…

  • Use WP-Cli in your GitHub actions for translating plugin releases

    Anybody who follows me on Twitter knows that I am always, and I mean, always fighting the build tools. Things that are supposed help us automate tasks and make life easier, frequently are hard to set up, break, and generally cause me a lot of stress. So when I figured out how to have Grunt…

  • Add BCC to WooCommerce Emails

    Sometimes you need to send WooCommerce emails to more people than you can do via the main plugin settings. Or, you need to quietly BCC somebody, like a vendor, etc. You can achieve that by modifying the email headers on the woocommerce_email_headers filter. To achieve this you can add the following snippet to your theme’s…

  • Three Reasons to Let Customers Name Their Price

    Since I developed the WooCommerce Name Your Price plugin back in 2012, entrepreneurs have used it to sell all kinds of products all around the world! But over the years, one question I’ve gotten about my plugin is why a business would ever let a customer decide what to pay! I’m also a business owner,…

  • WooCommerce Name Your Price – What’s New in 3.0

    WooCommerce Name Your Price version 3.0 features a total rewrite of the front-end validation scripts. We’ve streamlined the user experience, improved function for hidden minimum prices, provided accessibility for users of screen readers, and the same reliable compatibility with a broad range of product types and plugins.

  • Add Custom Fields to WordPress Menu Items

    First a little backstory A WordPress commit that I am personally very excited to finally see get merged into core is the addition of a wp_nav_menu_item_custom_fields hook! As the author of the Nav Menu Roles plugin, I’ve needed to display custom fields on menu items. But in the admin, the menu items are displayed by…

  • 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…

  • Change the sort order of WooCommerce Grouped Products

    WooCommerce has a small army of filters and hooks that you could customize almost every aspect of the plugin. If you have a grouped product the default display method is by menu_order. But recently, someone wanted to display the grouped items by the date they were published. This is very easily accomplished by filtering the…