Created
October 19, 2016 07:42
-
-
Save mahdi-alavi/62a9b3dbfea7666d49e515fe02633a2e to your computer and use it in GitHub Desktop.
Add a message to buyers in single product page
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
/* | |
* Add a message to buyers in single product page | |
*/ | |
function itl_display_note_buyers() { | |
global $product; | |
$current_user = wp_get_current_user(); | |
if ( wc_customer_bought_product( $current_user->email, $current_user->ID, $product->id ) ) { | |
_e( 'your message', 'text-domain' ); | |
} | |
}; | |
add_action( 'woocommerce_single_product_summary', 'itl_display_note_buyers', 29 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment