remove_action('woocommerce_shop_loop_item_title','woocommerce_template_loop_product_title',10);
add_action('woocommerce_shop_loop_item_title','fun',10);
function fun()
{
echo 'custom_field_value';
}
Note: I want to replace the title on shop page with custom field value. The code is correct but the echo part I need help on it.
remove_action('woocommerce_shop_loop_item_title','woocommerce_template_loop_product_title',10);
add_action('woocommerce_shop_loop_item_title','fun',10);
function fun()
{
echo 'custom_field_value';
}
Note: I want to replace the title on shop page with custom field value. The code is correct but the echo part I need help on it.
woocommerce_shop_loop_item_title
is not the right hook to change the title on shop page.
Try this instead:
add_filter( 'woocommerce_page_title', function() {
echo 'custom_field_value';
} );
I need help on this section only since the code I have provided is 100% working to remove the title.
echo 'custom_field_value';
If I will call custom field as custom_title how can I show this?