I have spent the majority of the day trying to figure out how to adjust the single product page using woocommerce.
I would like to add a custom button next to the "Add to cart" button that would be a custom link that says "More Info". I am working on an shop website where there are numerous components to an products, so I want there to be an option that says "More Info" so they can go ahead check detail on vandor website. (I will have custom fields for each). The More Info button won’t be on all products, and the link will be different for each. I don’t think this is the best way to do it, but don’t have another solution right now. I use elemontor Pro to create product page i can add botton in their but how i will add my botton custom link when i add new product Please help me to solve it
3
Answers
You can use this hook in your function.php of active theme
You can use the Woocommerce hook
woocommerce_after_add_to_cart_button
to add any custom HTML or button besides the "Add to Cart" button.Put below code to the function.php file which is located in your child theme directory.
Note: If child theme is not exists, please create it by taking some help from the theme documentation. It will prevent to loss data while you update with the parent theme.
If you use the Elementor pro, you can add a button for a single product page. Also, you said you have custom fields for each, you can add dynamic URLs.
screenshot