Been trying to find something about this, but the solutions I found so far here do not work.
I need, in the single product page, to display the add to cart button like this:
ADD TO CART - JUST $PRICE
It needs to be done from the functions.php file in the child theme.
Thanks a lot!
Edit your
woocommerce/loop/add-to-cart.php
template file like this:For the single product pages do basically the same in:
woocommerce/single-product/add-to-cart/simple.php
And any other template you use in the add-to-cart directory.
I would suggest you override the WooCommerce template from the child theme, the file name is add-to-cart.php and can be found at woocommerce > loop.
At the bottom add the following code, it will be displayed only in product single.
To handle the display of the product price in add-to-cart button for all product prices on shop, other archives pages and single product pages, without any need of overriding templates, using dedicated Woocommerce filter hooks:
Code goes in function.php file of your active child theme (or active theme). Tested and works.
On shop page:
On single product pages: