I am trying to create an automatic text in the sort description of the WooCommerce products and put the price of the product in this message.
For example: "buying this product you get 50 points."
In this example, he earns 50 points because he is in a product that costs $ 50
Here is the code I am using:
add_action( 'woocommerce_single_product_summary', function() {
echo 'Buying this product you get X points';
}, 25 );
I put this code in the functions.php, but it only shows the text, I could not put the price of the product too.
Could someone tell me how to do this?