Book Image

Mastering WooCommerce - Second Edition

By : Patrick Rauland
Book Image

Mastering WooCommerce - Second Edition

By: Patrick Rauland

Overview of this book

Author Patrick Rauland is a WooCommerce expert with a deep-rooted passion for the platform. Drawing from his multifaceted experience as a customer, WooCommerce support team member, core developer, release leader, and conference planner, he presents the latest edition of this guide to help you master every facet of launching and managing a successful WooCommerce store. From initiation to seamless integration of essential components such as payments, shipping, and tax configurations, this book takes you through the entire process of establishing your online store. You’ll then customize your store's visual identity, optimizing for search engines and advanced sales management through Point of Sale (POS) systems, outsourced fulfillment solutions, and external reporting services. You’ll then advance to enhancing the user experience, streamlining reorders, and simplifying the checkout process for your customers. With this new edition, you’ll also gain insights into secure hosting and bug fixing and be prepared for updates. That’s not all; you’ll build a promotional landing page, ensure store safety, contribute to the WooCommerce community, and design custom plugins for your unique needs. By the end of this WooCommerce book, you'll emerge with the skills to run a complete WooCommerce store and customize every aspect of the store on the frontend as well as backend.
Table of Contents (20 chapters)
Free Chapter
1
Part 1: Exploring the essentials of an ECommerce Store
6
Part 2: Managing an Online Store
12
Part 3: Customizing the Appearance and Functionality of Your Store

Customizing order statuses

WooCommerce uses order statuses to track the state of orders. WooCommerce includes several different order statuses, including the following:

  • Completed
  • Processing
  • Pending payment
  • On hold
  • Refunded
  • Canceled
  • Failed

But some shops may need more order statuses. You might need a Building status to indicate that you started building the order. You can easily add a custom order status yourself with some custom code. We’re going to start with our WooCommerce example plugin and then we’re going to register a post status and add it to WooCommerce.

Using the WooCommerce example plugin

We can start by using the example plugin we created earlier in this chapter.

We’ll copy the example code, and then we should change the name of the class from WC_Example to WC_Building_Order_Status, since this describes what this plugin will do. Here’s the code:

// only run if there's no other class with...