PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Code Integration For Woocommerce Simple Auctions "Buy Now" Price

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 please
If 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.

Hello team, I found this code snippet within your documentation at this URL: https://currency-switcher.com/codex/#code to allow this plugin to work with Woocommerce Simple Auctions:

add_filter('woocommerce_simple_auctions_get_current_bid', function ($price, $_this) {

if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$price = $WOOCS->woocs_exchange_value(floatval($price));
}
}

return $price;
}, 20, 2);

add_filter('woocommerce_simple_auctions_get_increase_bid_value', function ($bid, $_this) {
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$bid = $WOOCS->woocs_exchange_value(floatval($bid));
}
}

return $bid;
}, 30, 2);

add_filter('woocommerce_simple_auctions_place_bid_value', function ($bid, $product_id) {

if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$currencies = $WOOCS->get_currencies();
$conversion_rate = $currencies[$WOOCS->current_currency]['rate'];
$bid = $bid / $conversion_rate;
}
}

return $bid;
}, 30, 2);

This snippet works perfectly and I thank you very much for this integration code it is extremely helpful! There is just one issue, it does not work with the “Buy Now” feature for auctions. So the price remains the same for the buy now feature even when a user changes currencies. Is it possible to make this snippet work for that too?

Hello

please drop me wp-admin+ftp access to your test site - https://share.pluginus.net/image/i20230222134241.png -> https://share.pluginus.net/image/i20230222134615.png and  exact link to the issue

And I'll add it to the adaptation queue

Yes of course, I have added the information to the area as stated (as well as an additional query, I hope that is okay)

Thank you for your consideration of these issues, your plugin is already the best currency switcher plugin, but these fixes would make it perfect! :)

All the best! Lars

Hello

Ok! Great!

I'll write to you as soon as I get the result

Wonderful, thank you very much!

Hello

Please  do a  test

I added  this  code

add_filter( 'woocommerce_simple_auctions_minimal_bid_value', function($bid_value, $product_data, $bid){
    if (class_exists('WOOCS')) {
        global $WOOCS;
        if ($WOOCS->is_multiple_allowed) {
            $currencies = $WOOCS->get_currencies();
            $conversion_rate = $currencies[$WOOCS->current_currency]['rate'];
            $bid_value = $bid_value / $conversion_rate;
        }
    }
return $bid_value;
},30,3 );
add_filter('single_add_to_cart_text', function($price_str, $product){
    if (class_exists('WOOCS')) {
        global $WOOCS;
        if ($WOOCS->is_multiple_allowed) {
            $price = $WOOCS->woocs_exchange_value($product->get_regular_price());
$price_str = sprintf(__( 'Buy now for %s', 'wc_simple_auctions' ),wc_price($price));
        }
    }
return $price_str;
},30,2);

Pablo you are amazing! I cannot thank you enough for your help, it works perfectly now! Your support for this plugin is beyond appreciated, there is no competition for currency switcher plugins with you around. Thank you once again!

Great!  Welcome;)