Faragiri

Learn WooCommerce WordPress

Where the data actually lives before and after the order storage change, the four hooks worth knowing around the cart, and why checkout cannot be cached.

4Sections
3Min read
5Depth

Five stages, one shop

Where the hooks are, and which stage is the one to trust

Each stage below is a place code can run, and the taper is deliberately unmeasured: only one of them is reached by every customer whose money actually arrived.

  1. Catalogue viewA full page cache serves this, so no PHP runs at all
  2. Add to cartwoocommerce_add_to_cart_validation can refuse the item here
  3. Checkout pageEvery hit is PHP and queries, which is normal rather than a bug
  4. Order createdwoocommerce_checkout_create_order, the right moment to set fields
  5. Payment completeFires whether or not the customer ever loads the thank you page

The figure carries no numbers, because no two shops share them. The claim is the order and the last stage: hanging fulfilment on the thank you page loses every customer who closed the tab.

WooCommerce is a plugin that turns WordPress into a shop, which means every
product is a post, every order is a post, and every attribute is a taxonomy or a
meta row. Understanding that one sentence explains both why it integrates with
everything WordPress does and why it becomes slow at a size a purpose built shop
would not notice.

The consequence is concrete: product data lives across
wp_posts, wp_postmeta and, since the HPOS change,
orders live in their own tables rather than in posts. A store on an older
install may still have orders as posts, and a query written for one layout finds
nothing on the other, which is the first thing to check when a report comes back
empty.

The hooks that matter are around the cart and the checkout

  • woocommerce_add_to_cart_validation is the filter that can
    refuse an item, returning false with a notice, and it is where a stock or
    eligibility rule belongs
  • woocommerce_checkout_create_order lets you set fields on the
    order before it is saved, which is the right moment rather than after
  • woocommerce_payment_complete is the one to hang fulfilment on,
    not the thank you page, because a customer who closes the tab never loads
    it
  • Prices are filtered, not read: a plugin changing
    woocommerce_product_get_price changes what every other plugin
    sees

That last point is the source of the most confusing bugs in this ecosystem. A
price displayed and a price charged pass through different filters at different
moments, so two plugins each doing something reasonable produce a total nobody
intended, and the fix requires knowing which hook each is on.

Where the performance goes

The cart and checkout pages cannot be cached, because they are per customer,
so every hit is a full PHP request and a set of queries. A shop that is fast on
its catalogue and slow at checkout is normal and is not a bug; a shop that is
slow on its catalogue has a caching problem, because the catalogue is
cacheable.

Attribute filtering is the other one. Faceted navigation over meta rows is a
join per attribute, and it degrades sharply somewhere around a few thousand
products with several attributes. The answer is a purpose built index rather
than more database tuning, and knowing that early saves a month of the
wrong work.

What to run in 2026

High Performance Order Storage is the setting to have on, free with
WooCommerce, and it moves orders into dedicated tables with proper indexes
instead of the posts table. It replaced orders as posts, which is what made
order queries slow at volume, and any extension that has not been updated for it
is a compatibility risk worth checking before enabling.

Query Monitor with a staging copy of real data is the second, free and open
source. Order counts change query plans, so a checkout that is fast on twenty
test orders tells you nothing about one with fifty thousand. It replaced
optimising against seed data, which is the most common way to fix nothing.

Where this stalls people

The stall is customising the checkout by editing templates. WooCommerce
allows a theme to override its template files, so the change works, and then the
plugin updates its own version of that template and yours is now missing a field
that the newer code expects. It fails after an update nobody connected to
it.

Reach for a hook before a template override, every time, and when an override
is genuinely necessary, record the version it was copied from and re-check it on
each update. The hook system it is built on is
hooks, filters and
writing your own
, the templates it is overriding are
the template
hierarchy, and building one
, and the payment side of it belongs with
being told instead of asking,
inside what runs a large share of the
web
.

Alongside this

Above this