WooCommerce

Woo Commerce- Remove Add to cart button with Contact us button.

Written by AskYouNow
Here we are with another blog post related to Woo-commerce. in this, we can let you that how you can remove Add to cart button/link and put the Email button with mail link. as we see there are lots of people asking questions about it that how they can do this with a simple code of the snippet.
// For remove Add to cart button
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart');
				
					//add inquiry button into every product
add_action( 'woocommerce_after_shop_loop_item', 'prfx_add_inquiry_button', 10); 
add_action( 'woocommerce_single_product_summary', 'prfx_add_inquiry_button', 30);
function prfx_add_inquiry_button() {
	$current_product_id = get_the_ID(); 
	$current_product_title = get_the_title(); 
	$product = wc_get_product( $current_product_id );
			echo $current_product_title;
			echo '<a href="mailto:test@example.com?subject=Inquiry for product id:$current_product_id" class="button">Inquiry</a>';
			echo '</a>';
}
				
			
So that’s it for now, Hope you guys like this. We will come up with another blog post soon. Contact us for any query. Follow us on Facebook

About the author

AskYouNow

9 Comments

  • I am really glad to read this website posts which consists
    of lots of useful data, thanks for providing
    these kinds of statistics.

  • Hi there, I discovered your web site by the use of Google whilst looking for
    a similar matter, your website came up, it seems to be good.
    I’ve bookmarked it in my google bookmarks.
    Hello there, just was alert to your blog through Google, and found that it’s really informative.
    I’m gonna be careful for brussels. I will be grateful in the event you continue this in future.

    Numerous other people will likely be benefited out of your writing.
    Cheers!

  • I will immediately grab your rss feed as I can not in finding your
    e-mail subscription link or newsletter service. Do you have any?
    Please let me understand so that I may subscribe. Thanks.

  • It’s going to be end of mine day, but before finish I am reading this fantastic
    piece of writing to improve my know-how.

  • It is in reality a nice and useful piece of information. I’m satisfied that you shared this useful information with
    us. Please keep us up to date like this. Thank
    you for sharing.

  • Hey there! I just would like to give you a huge thumbs up
    for the great information you have right here on this post.
    I will be coming back to your website for more soon.

  • I feel that is one of the such a lot significant information for me.
    And i’m satisfied studying your article: D.
    Just right activity, cheers

Leave a Comment

Retype the CAPTCHA code from the image
Change the CAPTCHA codeSpeak the CAPTCHA code