[WOOCS LABS] TeraWallet Approx prices
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page pleaseIf you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.
Quote from abd_sa on April 29, 2022, 05:40Dear support,
I used this code from the FAQs (TeraWallet – For WooCommerce) with the TeraWallet plugin and it changes the balance, but I just want to show the approx price as I am enabling approx prices feature on the WOOCS plugin. (screenshot: https://prnt.sc/2pMbsWJGNHwd.)
Could you please take a look at it ?
Thank you very much.
Dear support,
I used this code from the FAQs (TeraWallet – For WooCommerce) with the TeraWallet plugin and it changes the balance, but I just want to show the approx price as I am enabling approx prices feature on the WOOCS plugin. (screenshot: https://prnt.sc/2pMbsWJGNHwd.)
Could you please take a look at it ?
Thank you very much.
Quote from Pablo Borysenco on April 29, 2022, 11:48Hello
Please drop me wp-admin+FTP access to your test site - https://share.pluginus.net/image/i20210618130558.png ->https://share.pluginus.net/image/i20210618130637.png
I'll add it to the adaptation queue
Hello
Please drop me wp-admin+FTP access to your test site - https://share.pluginus.net/image/i20210618130558.png ->https://share.pluginus.net/image/i20210618130637.png
I'll add it to the adaptation queue
Quote from abd_sa on April 30, 2022, 08:35Hello,
I did, Thanks.
How long it is gonna take if I may ask ? because I might need to update the staging environment ? Does the adaptation queue has a lot of requests already ?
Hello,
I did, Thanks.
How long it is gonna take if I may ask ? because I might need to update the staging environment ? Does the adaptation queue has a lot of requests already ?
Quote from Pablo Borysenco on May 2, 2022, 11:51Hello
There are not many adaptations at the moment.
I think we will do it next week (Friday)
Hello
There are not many adaptations at the moment.
I think we will do it next week (Friday)
Quote from abd_sa on May 3, 2022, 03:40Hello,
Ok Thank you so much. I'll try to keep the staging as it is until next week.
Let me know when you have any update.
Hello,
Ok Thank you so much. I'll try to keep the staging as it is until next week.
Let me know when you have any update.
Quote from Pablo Borysenco on May 3, 2022, 10:45Hello
I will write to you as soon as we get the result
Hello
I will write to you as soon as we get the result
Quote from Pablo Borysenco on May 6, 2022, 19:04Hello
In functions.php I added code:
add_filter('woo_wallet_current_balance', function ($balance, $user_id) {
if (class_exists('WOOCS')) {
global $WOOCS;$balance = $WOOCS->woocs_exchange_value($balance);
}return $balance;
}, 10, 2);add_filter( 'woo_wallet_amount', function( $amount, $currency, $user_id ){
if (class_exists('WOOCS')) {
global $WOOCS;$amount = $WOOCS->woocs_exchange_value($amount);
}return $amount;
},10,3);
in file - \wp-content\plugins\woo-wallet\includes\class-woo-wallet-wallet.php - I added this code - https://share.pluginus.net/image/i20220506170257.png
//woocs
$additional_info = '';
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_use_geo_rules() AND get_option('woocs_show_approximate_amount', 0) ) {$user_currency = $WOOCS->get_currency_by_country($WOOCS->storage->get_val('woocs_user_country'));
$currencies = $WOOCS->get_currencies();if ($user_currency != $WOOCS->current_currency AND !empty($user_currency) AND $balance) {
$tmp_curr_currency = $WOOCS->current_currency;
$WOOCS->set_currency($user_currency);
$decimal_separator = $WOOCS->get_decimal_sep($user_currency);
$thousand_separator = $WOOCS->get_thousand_sep($user_currency);
$balance = $WOOCS->woocs_exchange_value($balance);$wc_price = $WOOCS->wc_price($balance, true, array('thousand_separator' => $thousand_separator, 'decimal_separator' => $decimal_separator, 'decimals' => $WOOCS->get_currency_price_num_decimals($user_currency, $WOOCS->price_num_decimals)));
$additional_info = '<span class="woocs_cart_item_price ">';
$additional_info .= apply_filters('woocs_get_approximate_amount_text', sprintf(esc_html__('(Approx. %s)', 'woocommerce-currency-switcher'), $wc_price), $wc_price);$additional_info .= '</span>';
$WOOCS->set_currency($tmp_curr_currency);
}
}
}
return 'view' === $context ? wc_price( $this->wallet_balance, woo_wallet_wc_price_args($this->user_id) ) . $additional_info : number_format( $this->wallet_balance, wc_get_price_decimals(), '.', '' );
In file - wp-content\plugins\woo-wallet\templates\wc-endpoint-wallet.php - I added code - https://share.pluginus.net/image/i20220506170419.png
$additional_info = '';
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_use_geo_rules() AND get_option('woocs_show_approximate_amount', 0) ) {$user_currency = $WOOCS->get_currency_by_country($WOOCS->storage->get_val('woocs_user_country'));
$currencies = $WOOCS->get_currencies();if ($user_currency != $WOOCS->current_currency AND !empty($user_currency) AND $transaction->amount) {
$curr_price = $transaction->amount;$tmp_curr_currency = $WOOCS->current_currency;
$WOOCS->set_currency($user_currency);
$decimal_separator = $WOOCS->get_decimal_sep($user_currency);
$thousand_separator = $WOOCS->get_thousand_sep($user_currency);
$curr_price = $WOOCS->woocs_exchange_value($curr_price);$wc_price = $WOOCS->wc_price($curr_price, true, array('thousand_separator' => $thousand_separator, 'decimal_separator' => $decimal_separator, 'decimals' => $WOOCS->get_currency_price_num_decimals($user_currency, $WOOCS->price_num_decimals)));
$additional_info = '<span class="woocs_cart_item_price ">';
$additional_info .= apply_filters('woocs_get_approximate_amount_text', sprintf(esc_html__('(Approx. %s)', 'woocommerce-currency-switcher'), $wc_price), $wc_price);$additional_info .= '</span>';
$WOOCS->set_currency($tmp_curr_currency);
}
}
}
echo $additional_info;
Hello
In functions.php I added code:
add_filter('woo_wallet_current_balance', function ($balance, $user_id) {
if (class_exists('WOOCS')) {
global $WOOCS;
$balance = $WOOCS->woocs_exchange_value($balance);
}
return $balance;
}, 10, 2);
add_filter( 'woo_wallet_amount', function( $amount, $currency, $user_id ){
if (class_exists('WOOCS')) {
global $WOOCS;
$amount = $WOOCS->woocs_exchange_value($amount);
}
return $amount;
},10,3);
in file - \wp-content\plugins\woo-wallet\includes\class-woo-wallet-wallet.php - I added this code - https://share.pluginus.net/image/i20220506170257.png
//woocs
$additional_info = '';
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_use_geo_rules() AND get_option('woocs_show_approximate_amount', 0) ) {
$user_currency = $WOOCS->get_currency_by_country($WOOCS->storage->get_val('woocs_user_country'));
$currencies = $WOOCS->get_currencies();
if ($user_currency != $WOOCS->current_currency AND !empty($user_currency) AND $balance) {
$tmp_curr_currency = $WOOCS->current_currency;
$WOOCS->set_currency($user_currency);
$decimal_separator = $WOOCS->get_decimal_sep($user_currency);
$thousand_separator = $WOOCS->get_thousand_sep($user_currency);
$balance = $WOOCS->woocs_exchange_value($balance);
$wc_price = $WOOCS->wc_price($balance, true, array('thousand_separator' => $thousand_separator, 'decimal_separator' => $decimal_separator, 'decimals' => $WOOCS->get_currency_price_num_decimals($user_currency, $WOOCS->price_num_decimals)));
$additional_info = '<span class="woocs_cart_item_price">';
$additional_info .= apply_filters('woocs_get_approximate_amount_text', sprintf(esc_html__('(Approx. %s)', 'woocommerce-currency-switcher'), $wc_price), $wc_price);
$additional_info .= '</span>';
$WOOCS->set_currency($tmp_curr_currency);
}
}
}
return 'view' === $context ? wc_price( $this->wallet_balance, woo_wallet_wc_price_args($this->user_id) ) . $additional_info : number_format( $this->wallet_balance, wc_get_price_decimals(), '.', '' );
In file - wp-content\plugins\woo-wallet\templates\wc-endpoint-wallet.php - I added code - https://share.pluginus.net/image/i20220506170419.png
$additional_info = '';
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_use_geo_rules() AND get_option('woocs_show_approximate_amount', 0) ) {
$user_currency = $WOOCS->get_currency_by_country($WOOCS->storage->get_val('woocs_user_country'));
$currencies = $WOOCS->get_currencies();
if ($user_currency != $WOOCS->current_currency AND !empty($user_currency) AND $transaction->amount) {
$curr_price = $transaction->amount;
$tmp_curr_currency = $WOOCS->current_currency;
$WOOCS->set_currency($user_currency);
$decimal_separator = $WOOCS->get_decimal_sep($user_currency);
$thousand_separator = $WOOCS->get_thousand_sep($user_currency);
$curr_price = $WOOCS->woocs_exchange_value($curr_price);
$wc_price = $WOOCS->wc_price($curr_price, true, array('thousand_separator' => $thousand_separator, 'decimal_separator' => $decimal_separator, 'decimals' => $WOOCS->get_currency_price_num_decimals($user_currency, $WOOCS->price_num_decimals)));
$additional_info = '<span class="woocs_cart_item_price">';
$additional_info .= apply_filters('woocs_get_approximate_amount_text', sprintf(esc_html__('(Approx. %s)', 'woocommerce-currency-switcher'), $wc_price), $wc_price);
$additional_info .= '</span>';
$WOOCS->set_currency($tmp_curr_currency);
}
}
}
echo $additional_info;
Quote from abd_sa on May 6, 2022, 23:22That's Awesome :D Thank you very much!
Have you added also
display: blockto.woocs_cart_item_priceinside `wp-content/plugins/woocommerce-currency-switcher/css/front.css` ?
That's Awesome :D Thank you very much!
Have you added also display: block to .woocs_cart_item_price inside `wp-content/plugins/woocommerce-currency-switcher/css/front.css` ?
Quote from Pablo Borysenco on May 9, 2022, 09:56Hello
Welcome;)
Have you added also
display: blockto.woocs_cart_item_priceinside `wp-content/plugins/woocommerce-currency-switcher/css/front.css` ? - yes
Hello
Welcome;)
Have you added also display: block to .woocs_cart_item_price inside `wp-content/plugins/woocommerce-currency-switcher/css/front.css` ? - yes
Quote from abd_sa on May 10, 2022, 00:34Perfect.
Thank you very much again.
Perfect.
Thank you very much again.