IntelliSense for WooCommerce: Hook Autocomplete, Hover Docs and Snippets for VS Code

IntelliSense for WooCommerce is a VS Code extension that adds hook autocomplete, hover documentation, and code snippets for WooCommerce development. Specifically, it provides instant access to 200+ action and filter hooks, 50+ function signatures, and 16 ready-to-use code patterns — all sourced from WooCommerce 10.x and organized by category.

In other words, instead of switching between your editor and the WooCommerce developer documentation, you get the information you need directly inside VS Code as you type.

Furthermore, the extension is completely free, open source under the GPL-3.0 license, and available on the VS Code Marketplace.

Why You Need IntelliSense for WooCommerce

WooCommerce has over 2,000 hooks spread across hundreds of files. Finding the right hook name, remembering its parameters, and knowing which version introduced it requires constant trips to the documentation. Additionally, the only existing WooCommerce VS Code extension was last updated in January 2019 and targets WooCommerce 3.2 — a version that is now seven years outdated.

As a result, WooCommerce developers today face three recurring problems:

  • Hook names are long and easy to mistypewoocommerce_checkout_update_order_meta is 45 characters. A single typo means your hook silently fails with no error message.
  • Parameters vary between hookswoocommerce_order_status_changed passes four parameters ($order_id, $old_status, $new_status, $order), but woocommerce_thankyou passes only one. Getting the parameter count wrong means your callback receives null values.
  • Deprecated hooks waste debugging time — hooks like woocommerce_settings_tabs were deprecated in WooCommerce 3.4 but still appear in tutorials and Stack Overflow answers. Using them produces no warning, but the code does nothing.

IntelliSense for WooCommerce solves all three problems by putting accurate, version-specific hook data directly in your editor.

How It Works

The extension activates automatically when you open any PHP file in VS Code. It provides three types of IntelliSense:

Hook Autocomplete

Type inside any hook-accepting function — add_action(', add_filter(', remove_action(', remove_filter(', do_action(', or apply_filters(' — and an autocomplete dropdown appears with all matching WooCommerce hooks. Each item shows the hook name, its category (Cart, Checkout, Order, Product, etc.), and whether it is an action or filter.

Moreover, the extension correctly separates actions and filters. When you type inside add_action(', you only see action hooks. When you type inside add_filter(', you only see filter hooks. This prevents the common mistake of using an action hook name inside add_filter().

Additionally, the matching is case-insensitive. Since PHP function names are case-insensitive, typing Add_Action(' or ADD_FILTER(' triggers autocomplete just the same.

Hover Documentation

Hover over any woocommerce_* or wc_* hook name inside a quoted string to see rich documentation:

  • Description — what the hook does in plain English
  • Type — action or filter, plus the category (Cart, Checkout, Order, etc.)
  • Parameters — the exact parameter names and types the hook passes to your callback
  • Since — the WooCommerce version that introduced this hook
  • Deprecation warning — if the hook is deprecated, the hover shows the version it was deprecated in
  • Code example — a ready-to-copy usage example

In addition, hovering over wc_* function calls (like wc_get_product, wc_price, or wc_get_orders) shows the function signature, return type, parameter descriptions, and usage examples.

Function Autocomplete

Type wc_ anywhere in a PHP file to see all available WooCommerce functions with their return types and parameter hints. Selecting a function inserts a snippet with tab stops for each parameter, so you can fill in arguments without looking up the function signature.

Code Snippets

The extension includes 16 code snippets for the most common WooCommerce development patterns. Type the prefix and press Tab to expand:

Prefix Description
wc-action Action hook registration
wc-filter Filter hook registration
wc-product-query Product query with wc_get_products()
wc-order-query HPOS-compatible order query
wc-rest-endpoint Custom REST API endpoint with permission callback
wc-payment-gateway Payment gateway class skeleton
wc-shipping-method Shipping method class skeleton
wc-email Custom email notification class
wc-settings-page Settings page class extending WC_Settings_Page
wc-settings-register Register a settings page with WooCommerce
wc-checkout-field Block Checkout additional field
wc-product-tab Single product custom tab
wc-ajax WC AJAX handler with nonce verification
wc-get-product Get product with null check
wc-get-order Get order with null check
wc-admin-notice Admin dashboard notice

Notably, every snippet follows WordPress Coding Standards. Dollar signs are properly escaped, tab stops proceed in logical order, and the generated code uses modern WooCommerce APIs. For example, the settings page snippet extends WC_Settings_Page with get_settings_for_default_section() — the correct modern method — rather than the deprecated woocommerce_settings_tabs hooks that many tutorials still recommend.

WooCommerce Coverage

The extension ships with curated hook data extracted from the WooCommerce 10.6.1 source code. Specifically, it covers:

  • 100+ action hooks — lifecycle events for cart, checkout, order, product, payment, shipping, email, and admin
  • 100+ filter hooks — data modification points for prices, fields, templates, queries, and display
  • 50+ functionswc_get_product(), wc_get_orders(), wc_price(), wc_add_notice(), wc_get_template(), and more
  • 16 code snippets — complete class skeletons and common patterns

Furthermore, hooks are organized into 11 categories:

Category Examples
Cart woocommerce_add_to_cart, woocommerce_cart_updated, woocommerce_applied_coupon
Checkout woocommerce_checkout_process, woocommerce_checkout_fields
Order woocommerce_new_order, woocommerce_order_status_changed
Product woocommerce_single_product_summary, woocommerce_product_get_price
Payment woocommerce_available_payment_gateways, woocommerce_payment_gateways
Shipping woocommerce_package_rates, woocommerce_shipping_methods
Email woocommerce_email_classes, woocommerce_email_headers
Admin woocommerce_product_data_tabs, woocommerce_process_product_meta
REST API woocommerce_rest_prepare_product_object
Block Checkout woocommerce_blocks_enqueue_checkout_block_scripts_after
Template woocommerce_before_main_content, woocommerce_locate_template

HPOS and Block Checkout Support

WooCommerce 8.2 introduced High-Performance Order Storage (HPOS) as the default order storage engine, and WooCommerce 8.3 made the Block Checkout the default checkout experience. Both changes introduced new hooks and deprecated old patterns.

IntelliSense for WooCommerce is built for this modern stack:

  • HPOS-compatible queries — the wc-order-query snippet uses wc_get_orders() instead of get_posts(), ensuring your code works with both the legacy CPT and HPOS datastores
  • Block Checkout hooks — includes woocommerce_blocks_enqueue_cart_block_scripts_before, woocommerce_blocks_checkout_enqueue_data, and other block-specific hooks
  • Block Checkout fields — the wc-checkout-field snippet uses woocommerce_register_additional_checkout_field(), the official API for adding fields to the Block Checkout
  • Modern settings pattern — the settings snippet extends WC_Settings_Page instead of using the deprecated woocommerce_settings_tabs_* hooks

Compatibility

IntelliSense for WooCommerce works alongside other PHP extensions without conflicts:

  • Intelephense — no overlap. Intelephense provides PHP symbol completion, while this extension provides WooCommerce hook string completion. They operate in different contexts.
  • WordPress Hooks IntelliSense — complementary. That extension covers WordPress core hooks (init, wp_enqueue_scripts, etc.), while this extension covers WooCommerce-specific hooks (woocommerce_*, wc_*).
  • PHP IntelliSense — no conflicts. Different completion triggers and contexts.

The extension requires VS Code 1.80 or later and activates only on PHP files.

Installation

Install from the VS Code Marketplace in one click:

Alternatively, open VS Code, press Ctrl+Shift+X (or Cmd+Shift+X on macOS) to open the Extensions panel, and search for IntelliSense for WooCommerce.

The extension activates automatically when you open any PHP file. No configuration required.

About

IntelliSense for WooCommerce is published by Renzo Johnson and available under the GPL-3.0 license. The hook data is extracted from the WooCommerce 10.6.1 source code and curated for accuracy.

For other WordPress and WooCommerce development tools, see the full list of open source contributions.