Variation Swatches for WooCommerce 1.0.14 has 1 actions and 14 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when Variation Swatches for WooCommerce fires an action
add_action( 'woocommerce_ajax_added_to_cart', function( $product_id ) {
// Your code runs here.
}, 10, 1 );
// Change a value Variation Swatches for WooCommerce is about to use
add_filter( 'cfvsw_available_variations', function( $json_encode ) {
// Change $json_encode here.
return $json_encode;
}, 10, 1 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
cfvsw_available_variations
filterapply_filters( 'cfvsw_available_variations', wp_json_encode( $available_variations ) ); -
cfvsw_is_required_page
filterapply_filters( 'cfvsw_is_required_page', $this->requires_global_settings() || $this->requires_shop_settings() ); -
apply_filters( 'cfvsw_is_required_screen_for_swatch_types', isset( $current_screen->base ) && 'product_page_product_attributes' === $current_screen->base ); -
apply_filters( 'cfvsw_requires_global_settings', is_product() ); -
cfvsw_requires_shop_settings
filterapply_filters( 'cfvsw_requires_shop_settings', is_shop() || is_product_category() || is_product_taxonomy() ); -
apply_filters( 'cfvsw_swatches_shop_page_position', [ 'before_title' => [ 'action' => 'woocommerce_shop_loop_item_title', 'priority' => 0, ], 'after_title' => [ 'action' => 'woocommerce_shop_loop_item_title', 'priority' => 9999, ], 'before_price' => [ 'action' => 'woocommerce_after_shop_loop_item_title', 'priority' => 9, ], 'after_price' => [ 'action' => 'woocommerce_after_shop_loop_item_title', 'priority' => 11, ], ] ); -
plugin_locale
filterapply_filters( 'plugin_locale', $get_locale, 'variation-swatches-woo' ); -
apply_filters( 'woocommerce_add_to_cart_product_id', absint( $_POST['product_id'] ) ); -
apply_filters( 'woocommerce_add_to_cart_validation', true, $product_id, $quantity, $variation_id, $variation ); -
do_action( 'woocommerce_ajax_added_to_cart', $product_id ); -
apply_filters( 'woocommerce_ajax_variation_threshold', 30, $product ); -
apply_filters( 'woocommerce_cart_redirect_after_error', get_permalink( $product_id ), $product_id ); -
apply_filters( 'woocommerce_out_of_stock_message', __( 'This product is currently out of stock and unavailable.', 'variation-swatches-woo' ) ); -
apply_filters( 'woocommerce_product_add_to_cart_text', $product->add_to_cart_text(), $product ); -
apply_filters( 'woocommerce_reset_variations_link', '<a class="reset_variations" href="#">' . esc_html__( 'Clear', 'variation-swatches-woo' ) . '</a>' );
Generated from Variation Swatches for WooCommerce's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Can't find the right hook?
We can build the customisation for you. Describe what you need: