Express Shop Page developer reference

Filters and actions for moving Express Shop Page’s fields and changing quantity limits.

Beka Rice Avatar

Written by

Last updated


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.

FilterDefault
wc_express_shop_page_loop_quantity_field_hookwoocommerce_after_shop_loop_item
wc_express_shop_page_loop_quantity_field_hook_priority5
wc_express_category_page_loop_quantity_field_hookwoocommerce_after_shop_loop_item
wc_express_category_page_loop_quantity_field_hook_priority5
wc_express_shop_page_loop_variation_dropdowns_hookwoocommerce_after_shop_loop_item
wc_express_shop_page_loop_variation_dropdowns_hook_priority6
wc_express_category_page_loop_variation_dropdowns_hookwoocommerce_after_shop_loop_item
wc_express_category_page_loop_variation_dropdowns_hook_priority6

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.

FilterSetting
wc_quantity_field_enabled_on_shopQuantity field » Display on shop page
wc_quantity_field_enabled_on_categoryQuantity field » Display on category pages
wc_variation_dropdowns_enabled_on_shopVariation dropdowns » Display on shop page
wc_variation_dropdowns_enabled_on_categoryVariation 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.

ParameterTypeDescription
$settingsarraySettings with boolean values.
$optionarrayThe 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.

FilterDefault
wc_express_page_quantity_input_min1
wc_express_page_quantity_input_maxThe most a customer can buy: the stock quantity when stock is tracked without backorders, otherwise no limit
wc_express_page_quantity_input_step1
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

ActionFires
wc_express_shop_page_before_quantity_fieldBefore the quantity box of a product in the list
wc_express_shop_page_after_quantity_fieldAfter the quantity box
wc_express_shop_page_before_variation_dropdownsBefore a variable product’s dropdowns
wc_express_shop_page_after_variation_dropdownsAfter a variable product’s dropdowns
wc_express_shop_page_register_scriptsAfter the front-end scripts are registered
wc_express_shop_page_load_scriptsAfter the front-end scripts are loaded on a page

Keep learning