How can I add an extra button to the WooCommerce product page?

bugrastar

Active member
Sep 7, 2020
126
41
28
28
Turkey
bit.ly
The theme I use is cartzilla - digital marketplace and grocery wordpress theme. I want to add an extra button to the product features page in this theme? but I don't know how to do this. Would you help me with this topic?
1663081808068.png
 

tothetop

Member
May 4, 2022
37
16
8
One way of doing it... Create child theme... edit single product template
Edit - Another way--- functions.php.. add function
Another way - there should be a few plugins out there to accomplish this
 
Last edited:
  • Like
Reactions: bugrastar

bugrastar

Active member
Sep 7, 2020
126
41
28
28
Turkey
bit.ly
One way of doing it... Create child theme... edit single product template
Edit - Another way--- functions.php.. add function
Another way - there should be a few plugins out there to accomplish this
I have tried many plugins but some plugins break product display or not show extra features
 

bugrastar

Active member
Sep 7, 2020
126
41
28
28
Turkey
bit.ly
Code:
add_action( 'woocommerce_single_product_summary', 'new_button',99 );
function new_button() {
    // Your button code.
}
first I added the code functions.php, no results. then I researched the code a little on the internet and got a successful result with smoother codes. Thanks for the help :)
 
  • Like
Reactions: tothetop

juxhin20

Active member
Babiato Lover
Trusted Uploader
May 25, 2020
129
49
28
first I added the code functions.php, no results. then I researched the code a little on the internet and got a successful result with smoother codes. Thanks for the help :)
Can you post the code here for others to see? Thanks
 

juxhin20

Active member
Babiato Lover
Trusted Uploader
May 25, 2020
129
49
28
what do you think .. leechers only get help from others and vanish ...
I think we try to help everyone as mutch as we can. Post it for users than have more than 1 year ore more than x resources to see .
 

bugrastar

Active member
Sep 7, 2020
126
41
28
28
Turkey
bit.ly
Can you post the code here for others to see? Thanks
Sorry, I didn't add any code. I solved it with the help of @tothetop. I thought maybe others could figure it out thanks to the code written by @tothetop. If you want me to add code. We can add buttons via Function.php, but you cannot make different arrangements on the product or content or add a link for this code. The button you add to Functions.php will appear in all products. You can also edit the button via Functions.php.

Go to Appearance > theme editor > functions.php

Then paste the button style code below of the function.php file

.button2{ display:inline-block; margin:20px; text-decoration:none; font-family:Arial; font-size:16px; border:2px solid #5BBB2B; border-radius:5px; color:#5BBB2B; background-color:#C0E9B5; padding:3px 7px;}.button2:hover{ color:#fff; background-color:#5BBB2B;}

<a href="link" class="button2">Button 2</a>

If anyone claims that it doesn't work or can't, contact me and I will help you immediately.
 
  • Like
Reactions: Fredo and juxhin20

Fredo

Member
Babiato Lover
Mar 26, 2019
92
37
18
Sorry, I didn't add any code. I solved it with the help of @tothetop. I thought maybe others could figure it out thanks to the code written by @tothetop. If you want me to add code. We can add buttons via Function.php, but you cannot make different arrangements on the product or content or add a link for this code. The button you add to Functions.php will appear in all products. You can also edit the button via Functions.php.

Go to Appearance > theme editor > functions.php

Then paste the button style code below of the function.php file



If anyone claims that it doesn't work or can't, contact me and I will help you immediately.
finally bravo :) for sharing
i thinked you are a leecher like most of some users
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu