Custom product price fields in a Button element and custom product page

Hi,

I am wondering if there is an “easy” way to insert woocommerce product price fields in a custom Button element. Instead of using the default Woocommece page, I want to make my custom Woocommerce product pages using Pro. As I understand, we can add a Snippet to the function.php file like this one (https://wpcodebook.com/snippets/get-product-price-by-product-id-in-woocommerce/), however, after adding this, I do not know how to insert that price data to the Button element. Should I convert this code to a short code and write into a Content Area?

I am not actually a fan of adding custom codes to my site, as with theme updates, I will lose all of them.

If this is not possible or is not easy to do, I understand that too.

Thank you for great support!

Hello Gunes,

Thanks for writing in!

You can utilize the dynamic content in the button element to achieve what you have in mind. The dynamic content in the button element will allow you to display the product price.

  • LsGyN40uSDKnVh5PMaBhUQ

To learn more about dynamic content, please check this out:

Hope this helps.

@Ruenel, this is an AWESOME feature! Thank you so much!

You’re welcome :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.