@gzoo
4214 stacked

We are designing to make it as affordable as possible, also open source, the intention is that anyone can buy one or more.

at the moment you connect the pill to any device it can promt the xpub of the generated seed and with it check the balance. at the moment this is the case, we plan to improve this by providing some more visual and intuitive tools.

Lets gooo! πŸš€πŸš€

This guide was a need for the community!! thanks!!! :)

Ok, I hope I didn't bother you. All credits to the code in the snippet that makes the request to blockchain info and returns the btc amount for @gd

Hi tanaris! thanks for your feedback :)

  1. this is because in my woocommerce I have configured two decimals in the price and in the function woo_product_price_2sats I format the price in $product_p_formated with rtrim($total, ".0"); to avoid having zeros that I don't need. You can solve it in a very simple way, either adding two decimals in the woocommerce price settings (woocommerce>settings) or commenting that line of code and in the fiat price print print "<span class='fiat-price'>&nbsp;{$product_p_formated} €</span>"; replace $product_p_formated with $total.
1function woo_product_price_2sats() { 2 global $woo_currency; 3 $all_meta_data = get_post_meta(get_the_ID()); 4 $total=$all_meta_data['_regular_price'][0]; 5 $price_oracle_url = "https://blockchain.info/tobtc?currency=$woo_currency&value=$total"; 6 $ch = curl_init($price_oracle_url); 7 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 8 curl_setopt($ch, CURLOPT_HEADER, 0); 9 $data = number_format(ltrim(curl_exec($ch), "0.")); 10 $product_p_formated=rtrim($total, ".0"); 11 curl_close($ch); 12 print "<span class='btc-price'>{$data} Sats&nbsp;</span>"; 13 print "<span class='fiat-price'>&nbsp;{$product_p_formated} €</span>"; 14}
  1. Yes, I've had those problems too (that's why they appear disabled), it's because woocommerce doesn't have a filter to differentiate between the cart page and the minicart and that breaks it, however I already have a way to do it by digging in the woocommerce template files, I haven't had time to develop it yet, but it's the starting point.

No way man! it would be awesome if this little piece of code contributed something to the Satsale project!!! I love the project and i was running a test instance on my node. Do you do the PR or do I do it?

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.

1function woocommerce_regular_price_tobtc(){ 2 $all_meta_data = get_post_meta(get_the_ID()); 3 $product_p=$all_meta_data['_regular_price'][0]; 4 $price_oracle_url = "https://blockchain.info/tobtc?currency=eur&value=$product_p"; 5 $ch = curl_init($price_oracle_url); 6 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 7 curl_setopt($ch, CURLOPT_HEADER, 0); 8 $data = curl_exec($ch); 9 curl_close($ch); 10 print "<span class='btc-price'>{$data}β‚Ώ</span>"; 11 12} 13 14add_action('woocommerce_before_add_to_cart_form', 'woocommerce_regular_price_tobtc'); 15

it would be amazing if @d11n had an answer to this. Tanks :)

you mean for generate the invoices? yea, but I'm looking for a solution that everyone can use without needing to have an lnbits

Yes, I thought about using my node, but that's a solution for me only, I don't have a node for 'public' use at the moment. My idea is that once I have this script in production I can share the repository and others can use it without depending on having a node. Can you think of a custodial service that fits? So far the solution I can think of is to integrate it with lightning tip bot or lntxbot in telegram. The ideal would be an api that I could call inside my script and it would generate the invoice.

Pd thanks for replying, I really appreciate your guidance :)

GENESIS