How do you check in code whether HPOS is enabled?
AutomatticWooCommerceUtilitiesOrderUtil::custom_orders_table_usage_is_enabled().
questions
AutomatticWooCommerceUtilitiesOrderUtil::custom_orders_table_usage_is_enabled().
The woocommerce_after_order_object_save hook — it fires no matter where the order was saved from: admin, REST, checkout, CLI.
A class responsible for saving and reading a specific object type. The CRUD object doesn't know where its data lives. That's why HPOS could be introduced without changing the public API: only the order data store changed.
During the transition WooCommerce writes orders to both storages. You can roll back, and old plugins that read wp_posts still get data. After the transition sync is turned off because it doubles every write.
A denormalized table with a product's price, stock, SKU and rating. WooCommerce uses it for sorting and filters to avoid slow JOINs on wp_postmeta.
In the woocommerce_sessions table. The cookie holds only the session key. For a logged-in user the cart is also saved in user meta so it can be restored on another device.
WP-Cron depends on site visits and has no statuses or retries. Action Scheduler stores jobs in the database, runs them in batches and logs errors. Webhooks, analytics, some emails and migrations run on it.
Orders get their own tables with the needed columns and indexes (status, date, customer, total). No thousands of wp_postmeta rows per order and no heavy JOINs. Order search and reports don't compete with posts and pages.
It takes parameters in WooCommerce terms (price, stock_status, sku, visibility), builds the query itself and returns WC_Product objects. The code doesn't depend on how the data is laid out in tables.
Not for the parts rendered by blocks: a block has its own render. Some blocks (for example, the classic Legacy Template) still use PHP templates, but the main path is blocks.
Look in includes/wc-template-hooks.php, in Query Monitor → Hooks, or dump $wp_filter['hook_name'].
A plugin header since WordPress 6.5. Core won't activate the plugin until its dependencies are active, and won't deactivate a dependency while a dependent plugin is active.
A hook whose name contains a variable part. For example, woocommerce_order_status_completed or woocommerce_product_get_price — WooCommerce builds them from a status or property name.
An action does something at a given moment and returns nothing. A filter receives a value, changes it and must return it. Technically both run on the same WP_Hook system.
It depends on the project. A block theme gives code-free editing of store templates and the modern checkout. A classic one fits when many extensions depend on PHP templates and checkout hooks. Back the decision with a plugin audit.
WooCommerce → Status → System status, the Templates section. It shows the copy's version and the core version.
before_woocommerce_init: WooCommerce collects declarations before it initializes features. A later declaration is ignored.
WooCommerce shows a warning in the plugin list if the WooCommerce version is newer than the tested one. It's a signal for the admin before updating.
wc_get_product_id_by_sku( $sku ) — a lookup table query. Not a meta_query on _sku.
$product->get_variation_price( 'min' ) and ( 'max' ), or get_price_html(). Don't loop over all variations by hand.
A _ prefix doesn't protect it from REST: meta_data returns all meta. Filter it with woocommerce_rest_prepare_product_object, or don't keep sensitive data in product meta.
A global attribute is a pa_* taxonomy shared by all products: you can filter the catalog by it. A local one lives only in one product and has no filters.
Not in principle: wc_get_products() is a wrapper that creates a WC_Product_Query and returns the result.
With the outofstock term in the product_visibility taxonomy and the "Hide out of stock items" option. Catalog queries add a tax_query on that taxonomy.
Hundreds are technically possible, but the product form and price calculation slow down. If there are thousands of combinations, rethink the model: separate products, add-ons or options instead of variations.
When the product behaves differently: pricing, cart, shipping, post-payment handling. If only a few fields change, meta fields are enough.
save_post fires for any post and before WooCommerce saves its own data. woocommerce_admin_process_product_object gives you the product object and makes your changes part of the main save.
Yes, that's its main use case together with blocks. But payment on an external frontend depends on the payment gateway: not every gateway supports paying through the Store API.
No, it's the customer's public API. Changes need the Nonce header (CSRF protection) and a session or a Cart-Token.
woocommerce_cart_calculate_fees and $cart->add_fee( $name, $amount, $taxable ). Fees are calculated on the server, so they work in both checkouts.
With the Additional Checkout Fields API: woocommerce_register_additional_checkout_field() on the woocommerce_init hook, with an id in the namespace/name format, a location and a field type.
With woocommerce_store_api_register_endpoint_data() for the endpoint you need (cart, cart item). The data shows up in the extensions.<namespace> field.
A check in woocommerce_check_cart_items with an error through wc_add_notice(): a cart with an error won't pass checkout, neither in the template nor through the Store API.
A draft order that block checkout creates while the customer fills in the form. It isn't visible as a regular order and is cleaned up on a schedule if the purchase isn't completed.
Everything that happens to the cart and the order on the server: fee and price calculation, coupons, woocommerce_new_order, status changes, woocommerce_payment_complete.
The form is rendered by React on the client, and the data goes as a JSON request to the Store API. There is no PHP form template, so the hooks that inserted HTML into the form or read $_POST aren't there either.
wp_interactivity_state( 'namespace', [...] ) — global state; wp_interactivity_data_wp_context() — the local context of a specific block.
A way to pass data from a parent block to its children: providesContext on the parent, usesContext on the child. Product Template passes the postId of every product.
A WooCommerce block for product lists with ready-made collections (new arrivals, on sale, best sellers, related products) and filters. The inner Product Template defines the product card from separate blocks.
The WordPress standard for frontend interactivity: the server renders HTML with data-wp-* directives, and a small runtime binds them to a JS store. Blocks on the same page can share state.
When the data changes independently of content editing: prices, stock, user data, post lists. Then render.php generates the HTML on every request.
In the database as a post of type wp_template. They take priority over the theme file until they are reset.
It adds the classes and styles from supports (colors, spacing, alignment) to the block wrapper. Without it the inspector settings don't reach the markup.
Store templates are edited without code, styles are centralized in theme.json, and block cart and checkout work by default. The price is a compatibility audit of plugins that depend on PHP templates.
No duplicated markup on the client, it works with server rendering, and the scripts are modules loaded only with the block. State can be passed from PHP through wp_interactivity_state().
Add refunds to $this->supports and implement process_refund( $order_id, $amount, $reason ) calling the provider's API.
A class extends WC_Email with trigger() and templates, registered through woocommerce_email_classes. Then the email has its settings in WooCommerce → Settings → Emails.
processing — payment received, the order has to be packed and shipped. completed — fulfilled. For virtual and downloadable products WooCommerce sets completed right after payment.
It sets the status (processing or completed), saves the transaction ID and the payment date, reduces stock if it wasn't reduced yet and fires the woocommerce_payment_complete hook.
An array with result (success or failure) and redirect — the URL to send the customer to: the provider's page or the thank-you page.
An array with the cart items, the shipping address and the total, for which the methods calculate rates. The cart can be split into several packages with woocommerce_cart_shipping_packages.
woocommerce_payment_complete or woocommerce_order_status_processing, not the thank-you page. Heavy actions go through Action Scheduler.
Rates are cached in the session by the package hash. If only the method settings changed, the cart takes the old cache. Clear the shipping cache in tests.
Providers retry delivery if they didn't get a 200 in time, and they may send several events about one payment. Processing it again must not change the result.
The woocommerce_rest_prepare_shop_order_object filter or register_rest_field() for the matching type.
Consumer key / secret through Basic auth over HTTPS. For requests from your own site (admin, blocks) — a cookie + the wp_rest nonce.
Mark changes coming from the external system (a meta or a runtime flag) and don't send them back. Or define a single source of truth for every field.
Calculate base64_encode( hash_hmac( 'sha256', $raw_body, $secret, true ) ) and compare it with X-WC-Webhook-Signature using hash_equals().
Page through with per_page=100 following X-WP-TotalPages, or filter by date (modified_after) and sync incrementally.
wc_get_logger() with your own source. The logs are in WooCommerce → Status → Logs, with levels from debug to emergency.
Disable WP-Cron (DISABLE_WP_CRON) and run wp cron event run --due-now and/or wp action-scheduler run from the system cron.
A job queue library for WordPress, built into WooCommerce. Jobs are stored in the database, have groups, statuses and a log, and run in batches through WP-Cron, an async request or WP-CLI.
An "update if it exists, otherwise create" operation by a stable key. Running it again doesn't create duplicates — the sync can be safely restarted.
No. A nonce protects against CSRF — a forged request on behalf of the user. Whether the user has the right to the action is checked by current_user_can() or an owner check of the resource.
A mechanism that updates the mini cart with the get_refreshed_fragments AJAX request. It made an uncached server request on every page. In modern versions the script loads only where the classic cart widget is.
It keeps query results and transients in memory (Redis, Memcached) between requests. Fewer SQL queries on every page, especially for logged-in users and the cart.
Insecure Direct Object Reference: a customer changes the order_id in a request and gets someone else's order. The protection is a check that the order belongs to the current user, or access by the order key.
Sanitize on input, before saving. Escape on output, in the output context (HTML, attribute, URL). One doesn't replace the other.
LCP (how fast the main content appears), INP (how fast the page reacts to actions) and CLS (layout stability).
Sessions (woocommerce_sessions), Action Scheduler jobs and logs, order meta, draft orders. They need cleanup and size monitoring.
The lab is one run on an emulated device. Field data (CrUX) comes from real users with different devices, networks and caches.
They are personal: the cart, the address, the discounted prices of a specific customer. A page cache would serve one customer another customer's cart. So they are excluded from the cache, and WooCommerce sets cookies that caching plugins and hosts use to bypass the cache for customers.
The big picture first, then the details. Separate the must-haves from the nice-to-haves. Explain the reason and give links. Praise good decisions. Big changes — talk them through, not 40 comments.
Move the logic into separate classes with pure methods, and only call them from the hook. Then unit tests cover the logic and integration tests cover the hook registration.
PHPCS checks style and patterns (WPCS: escaping, nonce, prepare). PHPStan is static analysis of types and logic: non-existent methods, wrong types, dead code.
Style (PHPCS), static analysis (PHPStan), tests, the JS build. The human keeps architecture, business logic and security in context.
Clear Dev → Test → Live environments, code only through git, a read-only file system on Live and Test (except uploads), built-in Redis and edge-level caching.
The @wordpress/env tool that runs WordPress in Docker with the plugins you need, from a .wp-env.json config. Handy for local development and for tests in CI.
The cart, checkout, My Account and requests with the woocommerce_items_in_cart, woocommerce_cart_hash, wp_woocommerce_session_* cookies. Managed hosts usually do it themselves, but it has to be checked.
The critical money path: add to cart, apply a coupon, place an order with a test payment method, get the thank-you page. For both classic and block checkout if both are used.
Production keeps getting new orders, customers and stock changes. Moving the staging database would overwrite that data. Settings changes are moved by hand, with migration scripts or by exporting specific settings.
Clarify the requirements and the numbers, then data, flows, risks, verification. Name the choice "ready plugin / own code / external service" explicitly and say why.
Volumes (products, orders, peaks), the source of truth for the data, integrations, payment and tax requirements, who will maintain the solution, budget and deadlines.
Say so honestly and show your reasoning: what related things you know, where you would look, how you would check. The interviewer evaluates thinking, not memory.
Say what exactly doesn't work and what your hypotheses are. Asking for a hint is better than 5 minutes of silence. The interviewer evaluates the process.
That the woocommerce_before_cart hook works only in the classic cart. For the block cart — extend the Store API with your data and show it through a block or a cart slot.
A junior describes what to do. A middle developer explains why, what the alternatives are, what can go wrong and how they will check it.
A ready plugin when the feature is standard and critical for money (subscriptions, payments, taxes) and the plugin is maintained. Your own code when the business is specific and ready solutions need more workarounds than your own code would.
How code review and deploys work, which WooCommerce versions and themes the projects use, who talks to the clients, how tasks are estimated, whether there are tests and staging.
Variations need a separate woocommerce_product_variation_get_price filter, and the price range of a variable product is cached. Without changing the cache hash the catalog will show the old range.
No questions found. Try another search.