How to make a custom button that redirects to a “user specified link while entering product details” woocommerce

You’re getting Call to undefined function get_field() because you don’t have Advanced Custom Fields installed.

You’ll need to install ACF, set up a field group, set the location to “Post type is equal to product”, and add a text/link field called “url_demo” in order for it to work.

Then your code will go and grab the user-defined value of “url_demo” if it exists.