Filters/Actions for WooCommerce Products

Actions available for WooCommerce Products are listed below.

uael_woo_products_before_summary_wrap

Fires at the beginning of the product summary

function summary_wrap( $product_id, $settings ) {
    echo '<div> I am at the beginning of the product summary. </div>'; 
} 
add_action( 'uael_woo_products_before_summary_wrap', 'summary_wrap', 10, 2 );

uael_woo_products_after_summary_wrap

Fires at the end of the product summary

function summary_wrap( $product_id, $settings ) {
    echo '<div> I am at the end of the product summary. </div>'; 
} 
add_action( 'uael_woo_products_after_summary_wrap', 'summary_wrap', 10, 2 );

uael_woo_products_title_before

Fires at the end of the product title

function title_before( $product_id, $settings ) {
    echo '<div> I am at the beginning of the product title. </div>'; 
} 
add_action( 'uael_woo_products_title_before', 'title_before', 10, 2 );

uael_woo_products_title_after

Fires at the end of the product title

function title_after( $product_id, $settings ) {
    echo '<div> I am at the end of the product title. </div>'; 
} 
add_action( 'uael_woo_products_title_after', 'title_after', 10, 2 );

uael_woo_products_price_before

Fires at the beginning of the product price

function price_before( $product_id, $settings ) {
    echo '<div> I am at the beginning of the product price. </div>'; 
} 
add_action( 'uael_woo_products_price_before', 'price_before', 10, 2 );

uael_woo_products_price_after

Fires at the end of the product price

function price_after( $product_id, $settings ) {
    echo '<div> I am at the end of the product price. </div>'; 
} 
add_action( 'uael_woo_products_price_after', 'price_after', 10, 2 );

uael_woo_products_rating_before

Fires at the beginning of the product rating

function rating_before( $product_id, $settings ) {
    echo '<div> I am at the beginning of the product rating. </div>'; 
} 
add_action( 'uael_woo_products_rating_before', 'rating_before', 10, 2 );

uael_woo_products_rating_after

Fires at the end of the product rating

function rating_after( $product_id, $settings ) {
    echo '<div> I am at the end of the product rating. </div>'; 
} 
add_action( 'uael_woo_products_rating_after', 'rating_after', 10, 2 );

uael_woo_products_short_description_before

Fires at the beginning of the product short description

function desc_before( $product_id, $settings ) {
    echo '<div> I am at the beginning of the product short description. </div>'; 
} 
add_action( 'uael_woo_products_short_description_before', 'desc_before', 10, 2 );

uael_woo_products_short_description_after

Fires at the end of the product short description

function desc_after( $product_id, $settings ) {
    echo '<div> I am at the end of the product short description. </div>'; 
} 
add_action( 'uael_woo_products_short_description_after', 'desc_after', 10, 2 );

uael_woo_products_add_to_cart_before

Fires at the beginning of the product add to cart

function add_to_cart_before( $product_id, $settings ) {
    echo '<div> I am at the beginning of the product add to cart. </div>'; 
} 
add_action( 'uael_woo_products_add_to_cart_before', 'add_to_cart_before', 10, 2 );

uael_woo_products_add_to_cart_after

Fires at the end of the product add to cart

function add_to_cart_after( $product_id, $settings ) {
    echo '<div> I am at the end of the product add to cart. </div>'; 
} 
add_action( 'uael_woo_products_add_to_cart_after', 'add_to_cart_after', 10, 2 );

uael_woo_products_category_before

Fires at the beginning of the product category

function category_before( $product_id, $settings ) {
    echo '<div> I am at the beginning of the product category. </div>'; 
} 
add_action( 'uael_woo_products_category_before', 'category_before', 10, 2 );

uael_woo_products_category_after

Fires at the end of the product category

function category_after( $product_id, $settings ) {
    echo '<div> I am at the end of the product category. </div>'; 
} 
add_action( 'uael_woo_products_category_after', 'category_after', 10, 2 );

#Filters

Filters available for WooCommerce Products are listed below.

Helps modify Query Arguments.

add_filter( 'uael_woo_product_query_args', function( $query, $settings ) {
    // Modify the query here
    return $query;
}, 10, 2 );

Helps modify ‘out of stock’ string.

add_filter( 'uael_woo_out_of_stock_string', function( $modified_string ) { 
// Modify the string here
return $modified_string;
}, 10, 2 );

Helps modify the product title link.

add_filter( 'uael_woo_title_link', function( $title_link ) { 
// Modify the link here
return $title_link;
}, 10, 2 );

Helps modify the product structure.

add_filter( 'uael_woo_products_content_structure', function( $shop_structure, $settings ) { 
// The below array is the actual structure, you can swap the elements to have the desired structure
$shop_structure = [ 'category', 'ratings', 'title', 'price', 'add_cart', 'short_desc' ];
return $shop_structure;
}, 10, 2 );

Helps disable the link of the product image.

add_filter( 'uael_product_disable_link', function( $is_enable ){
// return false to disable the link
return $is_enable;
}, 10, 2 );

Helps modify the structure of a quick view.

add_filter( 'uael_quick_view_product_structure', function( $quick_view_structure ) {
// The below array is the actual structure, you can swap the elements to have the desired structure.
$quick_view_structure = [ 'title','ratings','price','short_desc','add_cart' ];
return $quick_view_structure;
}, 10, 2 );

For changing the “Quick View” text

add_filter( 'gettext', function ($translated_text, $text, $domain){
if($domain === 'uael'){
switch ( $translated_text ) {
// the text you want to change/translate.
case 'Quick View' :
$translated_text = __( 'View Now!', 'uael' ); // translated text.
break;
}
}
return $translated_text;
}, 20, 3 );

Was this article helpful?
Did not find a solution? We are here to help you succeed.

Related Docs

Get access to growing library of 40+ innovative widgets and 300+ creative templates.

Scroll to Top