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.
- First of all, you need to remove the Add to cart button from your website.
- Go to your active theme function.php file which is located in your website's active theme file.
- Here's the code for the same through which you can remove your Add to cart button/link.
- Please take the backup of your previous file in case you do something wrong while customizing the current code.
- Please implement below code for remove Add to cart button/link:-
// 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');
- After you removed the Add to cart button/link from your website, now its time to put an email button with a link in there.
- For this, you need to put the below code in the same file from where you removed the Add to cart button code. Just place the below code and save the file.
- Here the code for add an email button with mail link:-
//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 'Inquiry';
echo '';
}
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
I am really glad to read this website posts which consists
of lots of useful data, thanks for providing
these kinds of statistics.
Relevant!!
Finally, I have found something that helped me.
Thanks!
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 very nice blog!
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