Express Shop Page for WooCommerce has filters and actions for developers who need to move its fields, change quantity limits, or control where it loads. This article is for developers; if you’re not comfortable adding PHP to your site, ask your developer. For setup and settings, see Get started with Express Shop Page.
Move the fields
The quantity box and the variation dropdowns are added to each product in the list on a WooCommerce loop action. Each filter below returns the name of the action to use; the matching _priority filter returns its priority. The shop page filters also apply to [products] shortcode pages and Elementor or Divi pages.
| Filter | Default |
|---|---|
wc_express_shop_page_loop_quantity_field_hook | woocommerce_after_shop_loop_item |
wc_express_shop_page_loop_quantity_field_hook_priority | 5 |
wc_express_category_page_loop_quantity_field_hook | woocommerce_after_shop_loop_item |
wc_express_category_page_loop_quantity_field_hook_priority | 5 |
wc_express_shop_page_loop_variation_dropdowns_hook | woocommerce_after_shop_loop_item |
wc_express_shop_page_loop_variation_dropdowns_hook_priority | 6 |
wc_express_category_page_loop_variation_dropdowns_hook | woocommerce_after_shop_loop_item |
wc_express_category_page_loop_variation_dropdowns_hook_priority | 6 |
For example, to show the quantity box on shop pages right after the product title:
add_filter( 'wc_express_shop_page_loop_quantity_field_hook', function() {
return 'woocommerce_after_shop_loop_item_title';
} );
Express Shop Page already sets these for the OceanWP, Astra and Flatsome themes.
wc_express_page_product_loop_hook
The filter used to add Express Shop Page’s classes to each product in the list (wep-quantity-disabled and wep-variation-dropdowns-disabled, added when the feature is off on both kinds of page). Default post_class, with wc_express_page_product_loop_hook_priority defaulting to 5.
Turn the fields on or off
Each filter receives the matching setting as a boolean and returns whether the field shows on that kind of page.
| Filter | Setting |
|---|---|
wc_quantity_field_enabled_on_shop | Quantity field » Display on shop page |
wc_quantity_field_enabled_on_category | Quantity field » Display on category pages |
wc_variation_dropdowns_enabled_on_shop | Variation dropdowns » Display on shop page |
wc_variation_dropdowns_enabled_on_category | Variation dropdowns » Display on category pages |
add_filter( 'wc_quantity_field_enabled_on_category', '__return_true' );
wc_express_shop_page_settings
Filters all four settings at once, after yes and no values are turned into booleans.
| Parameter | Type | Description |
|---|---|---|
$settings | array | Settings with boolean values. |
$option | array | The raw stored option. |
woocommerce_get_settings_express-shop-page
WooCommerce’s standard filter for the fields on the Express shop page settings section.
Quantity limits
Each filter receives the default value and the product, and returns the value for that product’s quantity box in the list.
| Filter | Default |
|---|---|
wc_express_page_quantity_input_min | 1 |
wc_express_page_quantity_input_max | The most a customer can buy: the stock quantity when stock is tracked without backorders, otherwise no limit |
wc_express_page_quantity_input_step | 1 |
add_filter( 'wc_express_page_quantity_input_step', function( $step, $product ) {
// Sell this product in sixes.
return 123 === $product->get_id() ? 6 : $step;
}, 10, 2 );
Variation dropdowns
wep_ajax_variation_threshold
Above this number of variations, a product’s form looks up the matching variation as the shopper chooses, instead of loading every variation with the page. Default 30; the filter also receives the product.
wc_express_shop_page_wbv_enabled_on_archive
Whether WooCommerce Bulk Variations’ grid replaces the dropdowns for the current product. Default true when that plugin is active and licensed and the product’s own Bulk Variations settings allow it.
wc_express_page_wpo
The action that WooCommerce Product Options fields are printed on. Default wc_express_shop_page_before_quantity_field, with wc_express_page_wpo_priority defaulting to 4.
Scripts
wc_express_shop_page_scripts_enabled_on_page
Whether Express Shop Page loads its script and stylesheet on the current page. Default true on WooCommerce pages, pages with the [products] shortcode, and pages built with Elementor or Divi.
add_filter( 'wc_express_shop_page_scripts_enabled_on_page', function( $enabled ) {
// Load only on the main shop page and product category pages.
return is_shop() || is_product_category();
} );
Actions
| Action | Fires |
|---|---|
wc_express_shop_page_before_quantity_field | Before the quantity box of a product in the list |
wc_express_shop_page_after_quantity_field | After the quantity box |
wc_express_shop_page_before_variation_dropdowns | Before a variable product’s dropdowns |
wc_express_shop_page_after_variation_dropdowns | After a variable product’s dropdowns |
wc_express_shop_page_register_scripts | After the front-end scripts are registered |
wc_express_shop_page_load_scripts | After the front-end scripts are loaded on a page |
Keep learning
- Get started with Express Shop Page (setup, settings and common issues)
- How to add custom CSS to your site (styling the quantity box and dropdowns)
