How to Add Product Title to the Enquiry Modal Title?

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);

This only works in single product pages and not in the category loop. Reason for that is, that we only execute one form into the footer.

Leave a Reply

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