Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

inkavn on "how to change woocommerce_after_shop_loop_item"

$
0
0

Woocommerce problem
I write new action to change button " add to cart " in archive page.

Here is my code :

remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
add_action( 'woocommerce_after_shop_loop_item', 'my_woocommerce_template_loop_add_to_cart', 10 );
'my_woocommerce_template_loop_product_link_close', 5 );

function my_woocommerce_template_loop_add_to_cart() {
echo '
Add to cart <i class="icon-shopping-cart"></i>
';
}

Button changed ! but problem is, when i press " Add to cart " button, it will be redirect to product details page...

I think i have to do something with : woocommerce_template_loop_product_link_close

But I dont know how
So, can you help me ? Thank you !


Viewing all articles
Browse latest Browse all 8245

Trending Articles