hi guys! how are you? I have a question for worpress developers. What would be the easiest way to convert the currency I have set in my woocommerce shop to btc? Right now I have my products with prices set in € but I would like to show the equivalent in btc/sats. I was thinking in a snippet in function.php or something. do any of you already have a solution for this?
Im using btcpayserver connected to my node, but i dont find any setting to do that
I am grateful for any help or guidance you can give me.
It's been many moons since I wrote some PHP, but let's give this a go:
https://jdoodle.com/ia/x5m
Thanks man it really helps!! I have adapted the function to work in the front end of wordpress, just add this to the function.php file of your theme.
In case anyone wants to use/understand it: What the function does is to take the regular price of the woocommerce product, store it in the variable $product_p and then pass the price acquired through the get of $price_oracle_url. after that the price of the product converted to btc with an updated exchange rate appears in the front end through add_action and inside a html span tag with the css class btc-price, so you can play with a custom css.
Glad you got it working!
Better can answer @d11n about this.
it would be amazing if @d11n had an answer to this. Tanks :)