Customizing add-to-cart messages based on the product IDs in WooCommerce 3
问题 I have two products in my website and want to display different messages (In message I want to use HTML) on adding different products to cart. Right now it displays Product successfully added to cart. I am using this code in my child's function.php which is working but is not giving me what I exactly want. add_filter ( 'wc_add_to_cart_message', 'wc_add_to_cart_message_filter', 10, 2 ); function wc_add_to_cart_message_filter($message, $product_id = null) { $titles[] = get_the_title( $product