Title: Hook not executing
Last modified: August 4, 2023

---

# Hook not executing

 *  Resolved [onelikenoone](https://wordpress.org/support/users/onelikenoone/)
 * (@onelikenoone)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/hook-not-executing/)
 * Hi, I’m having an issue exectuting this hook in functions.php:
 *     ```wp-block-code
       function check_if_product_in_cart() {
   
       	$product_id_1 = 15801;
       	$product_id_2 = 15799;
   
       	if( WC()->cart->find_product_in_cart( WC()->cart->generate_cart_id( $product_id_1 ) ) || WC()->cart->find_product_in_cart( WC()->cart->generate_cart_id( $product_id_2 ) )) {
       		wc_print_notice( 
       			sprintf( '<b>Dopo l'acquisto siete invitati a mettervi in contatto direttamente con me via Messenger!</b>'), 
       			'notice'
       		);
       	}
       }
   
       add_action( 'woocommerce_before_checkout_form', 'check_if_product_in_cart' );
       ```
   
 * I’m using Futurio, Elementor Pro and Woocommerce updated to latest versions. 
   Thank you

Viewing 1 replies (of 1 total)

 *  Theme Author [FuturioWP](https://wordpress.org/support/users/futuriowp/)
 * (@futuriowp)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/hook-not-executing/#post-17118528)
 * Hello
 * This code is not related to the theme. Contact the WooCommerce staff please.
 * Thank you

Viewing 1 replies (of 1 total)

The topic ‘Hook not executing’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/futurio/1.5.7/screenshot.png)
 * Futurio
 * [Support Threads](https://wordpress.org/support/theme/futurio/)
 * [Active Topics](https://wordpress.org/support/theme/futurio/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/futurio/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/futurio/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [FuturioWP](https://wordpress.org/support/users/futuriowp/)
 * Last activity: [2 years, 7 months ago](https://wordpress.org/support/topic/hook-not-executing/#post-17118528)
 * Status: resolved