Last active
June 19, 2022 14:11
-
-
Save rashmimalpande/2631bc83164a5eb8b3f0dcc8b1dab9a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php $present = false; ?> | |
<?php foreach( $order->get_items() as $item ): | |
$_product = wc_get_product( $item['product_id'] ); | |
// Add whatever product id you want below here | |
if ( $item['product_id'] == 643 ): | |
$present = true; ?> | |
<?php endif; endforeach; ?> | |
<?php if( $present ): ?> | |
<p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Thank you for buying this shirt', 'woocommerce' ), $order ); ?></p> | |
<?php else: ?> | |
<p class="woocommerce-notice woocommerce-notice--success woocommerce-thankyou-order-received"><?php echo apply_filters( 'woocommerce_thankyou_order_received_text', __( 'Thank you. Your order has been received.', 'woocommerce' ), $order ); ?></p> | |
<?php endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi i need this for multipe products please