Home » Modern WooCommerce for Developers: What Changed in the Cart, Checkout and Orders

Modern WooCommerce for Developers: What Changed in the Cart, Checkout and Orders

Home » Modern WooCommerce for Developers: What Changed in the Cart, Checkout and Orders

Modern WooCommerce for Developers: What Changed in the Cart, Checkout and Orders

The store looks the same. A customer adds a beanie to the cart, checks out, and an order shows up in the admin. Under the hood, almost every step of that path works differently from the WooCommerce many of us…

The store looks the same. A customer adds a beanie to the cart, checks out, and an order shows up in the admin. Under the hood, almost every step of that path works differently from the WooCommerce many of us learned on.

This is not a “you are doing it wrong” post. The classic way still works in many stores. The point is to know both paths and choose on purpose. Let’s follow one order, step by step.

1. Add to cart: the Store API

In a block-based store, Add to cart sends a request to the Store API (POST /wc/store/v1/cart/add-item). The Mini-Cart block updates from the response. No page reload, no wc-ajax cart fragments.

Then: cart shortcodes, wc-ajax, cart fragments. Now: Cart and Mini-Cart blocks on the Store API.

2. Checkout: the Checkout block

The Checkout block talks to the same Store API. That is why some classic checkout hooks do not run here: woocommerce_checkout_fields belongs to the classic (shortcode) checkout.

A new field in the block checkout, such as a VAT number, comes from the Additional Checkout Fields API.

Then: woocommerce_checkout_fields filter. Now: Additional Checkout Fields API.

3. The order: HPOS

With HPOS (High-Performance Order Storage), orders live in their own tables instead of wp_posts and wp_postmeta:

TableWhat it holds
wp_wc_ordersMain order data
wp_wc_order_addressesBilling and shipping addresses
wp_wc_order_operational_dataInternal order data
wp_wc_orders_metaOrder meta

HPOS changes the storage, not the way your code works with orders, as long as the code goes through the CRUD API:

PHP
<?php
$order = wc_get_order( $order_id );
$vat   = $order->get_meta( '_vat_number' );
$order->update_meta_data( '_erp_synced', 'yes' );
$order->save();

The same code works with HPOS and with the old posts storage. get_post_meta() and SQL against wp_posts do not.

4. After the order: Action Scheduler

Webhooks, ERP sync and other heavy work should not run inside the checkout request. WooCommerce ships Action Scheduler: a queue of background jobs stored in the database, with statuses (pending, in-progress, complete, failed), retries and logs. You find it in WooCommerce → Status → Scheduled Actions.

Then: WP-Cron or work inside the request. Now: Action Scheduler.

5. The product list: Product Collection and the Interactivity API

Then: the

shortcode and jQuery for anything interactive. Now: the Product Collection block, and filters that update the list without a reload through the Interactivity API.

Cheat sheet

TaskThenNow
Orderswp_posts + get_post_meta()HPOS + $order->get_meta()
Cart and checkoutshortcodes, wc-ajax, cart fragmentsblocks on the Store API
Checkout fieldwoocommerce_checkout_fieldsAdditional Checkout Fields API
Product list
shortcode
Product Collection block
Front-end interactivityjQueryInteractivity API
Background jobsWP-CronAction Scheduler

In an interview

Question: A client switched to the block checkout and a custom field disappeared. What do you do?

Weak answer. Check the woocommerce_checkout_fields filter.

Strong answer. The block checkout works through the Store API, so the classic filter does not apply there. I would register the field with the Additional Checkout Fields API, check how its value is saved to the order, read it through the CRUD API, and test the order in both checkouts if the store still uses the classic one somewhere.

Know the old way. Choose the new one on purpose.

👉 More: 4wp.dev/wc

Build WordPress the right way

Production-ready 4WP plugins with clean architecture — or a team that builds it with you.

Latest videos

All videos →

Learn by topic