How to Add Product Title to the Enquiry Modal Title?

Filter & Hooks Viewed: 1046

If you want to add the product name to the title of the enquiry form you can use the following snippet. Put this into your functions.php of your child theme.

function modify_modal_title($title) {
     global $post;

     return $title . ' for ' . $post->post_title;
}
add_filter('woocommerce_catalog_mode_single_product_modal_title', 'modify_modal_title', 10, 1);

Leave a Reply

Your email address will not be published. Required fields are marked *