Created
September 27, 2017 10:50
-
-
Save rashmimalpande/c4738b6e6685f4bc8c44b10c407ac145 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
public function add_after_add_to_cart() { | |
global $post; | |
$product_id = $post->ID; | |
$categories = get_the_terms( $product_id, 'product_cat' ); | |
if( empty( $categories ) ) { | |
return; | |
} | |
foreach( $categories as $cat ) { | |
if( 'men' == $cat->slug ) { | |
echo "<img src='safe_checkout1.png' >"; //add image url in the src attribute | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment