Skip to content

Instantly share code, notes, and snippets.

function show_content_after_add_to_cart() {
echo "<h1>Hello World</h1>";
}
function show_content_after_add_to_cart() {
echo "<img src='safe_checkout.png' >"; //add image URL in the src attribute
}
function show_content_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 ) {
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 ) {
function show_content_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 ) {
function show_content_after_add_to_cart() {
global $post;
$product_id = $post->ID;
$selected_ids = array( 643, 780, 767 );
foreach( $selected_ids as $id ) {
if( $product_id == $id ) {
echo "<img src='safe_checkout.png' >"; //add image URL in src attribute
}
}
function show_content_after_add_to_cart() {
global $post;
$product_id = $post->ID;
$tags = get_the_terms( $product_id, 'product_tag' );
if( empty( $tags ) ) {
return;
}
foreach( $tags as $tag ) {
<div>
<img src='wp-content/uploads/2017/09/safe_checkout1.png' >
<img src='wp-content/uploads/2017/09/payment-secure-ssl.jpg' width="100" height="100">
</div>
function include_files() {
include_once('after-add-cart-html.html');
}
function show_content_after_add_to_cart() {
global $post;
$product_id = $post->ID;
$tags = get_the_terms( $product_id, 'product_tag' );
if( empty( $tags ) ) {
add_action( 'woocommerce_after_add_to_cart_form', 'show_content_after_add_to_cart' );
function show_content_after_add_to_cart() {
echo "<div> <img src='safe_checkout.png'> </div>";
}