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

Tweak To Integration With Woocommerce Simple Auctions Plugin

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.

Hi PluginUs support, I hope you are well. I have this code snippet to make the Fox currency switcher plugin compatible with the Woocommerce Simple Auctions plugin and all its stored prices:

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);

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);

I got this code from your support/codex and I am eternally grateful for it. It works almost perfectly, except for two prices that are not converting properly (the currency prefix shows but the price is not properly converted). The “Max Bid” price, and the winning bid price: https://snipboard.io/Aual6o.jpg

I managed to make the “Max Bid” price convert properly using the following code:

// Apply currency conversion only to max bid price display
add_filter('wc_price', function($formatted_price, $price, $args) {
if (!is_admin() && class_exists('WOOCS')) {
// Check if we're inside the max-bid template
$debug_backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10);
$is_max_bid = false;

foreach ($debug_backtrace as $trace) {
if (isset($trace['file']) && strpos($trace['file'], 'max-bid.php') !== false) {
$is_max_bid = true;
break;
}
}

if ($is_max_bid) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
// Only convert if not already converted
if (!isset($args['_woocs_converted'])) {
$price = $WOOCS->woocs_exchange_value(floatval($price));
$args['_woocs_converted'] = true;
return wc_price($price, $args);
}
}
}
}
return $formatted_price;
}, 99, 3);

So this part is not really an issue, but I thought I would mention it so I could provide you the code to put into your codex if you were interested. Although honestly I am not a coder and don’t know if this code is a good solution or not in terms of efficiency, but it does work.

The second issue of the “Winning Bid” price is something I have not been able to figure out how to fix.

Of course this issue regards a third party plugin so I have no expectation for you to help in this fix, but I figured I would ask just in case on the off chance you might know how to make the winning bid price convert.

Thank you for your time and your great work!

Hello

Thank you for your cooperation!

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

Describe in more detail how to get this price( “Winning Bid” ).  You can use links, screenshots and videos

And as described in this article - https://currency-switcher.com/woocs-labs  - I will add this plugin to the adaptation queue

Thank you so much for your willingness to help! I have included as much detail as I could, but I had to slim down my response due to the character limit. It should be detailed enough, but if you have any questions please feel free to ask! Thanks again :)

Hello

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

Wonderful thank you so much!

Hi Pablo, I hope you are well. I just wanted to let you know that it seems as though somebody on my team or that I work with changed the SFTP password recently, and I apologize if that was any inconvenience to you as I did not realize this until now. If a file manager plugin isn’t enough and you still need SFTP access just let me know and I will gladly provide the new password.

Thank you for your time and help!

Hello

Please drop me sftp password

Gotcha the SFTP password has been updated within the provided info. Thank you again for your time and help!

Ok! Great! thank you!

My pleasure, and thank you as well my friend!

Hello

Checked your site - https://share.pluginus.net/image/i20250304135846.png  - it looks like it"Winning Bid"  converts correctly.  Maybe I'm doing something wrong?

Hi Pablo, you are correct, the issue appears to be fixed on the staging site. When updating the SFTP password for you after it was changed, I noticed the same thing, the issue appeared to be fixed on the staging site. However I did not mention anything as I assumed this was due to some work you had done on the site to make it work, and maybe the final fix was still in progress. However I have checked my live site and the issue still remains on the live site. Are you sure you didn’t do any work a couple of weeks ago to fix this and maybe forgot about it? If you want I can produce another staging site so you can see the issue remains on the original/live site.

(As a side note, although the SFTP password was changed at some point and I had to provide you with a new one, the staging site was never accessed or edited by anyone)

Thank you for your time and help!

Hello

ok! I'll double check, yes we worked on this site before. Maybe the developer changed the code and didn't make a report.

Hello

Yes, it seems it was my mistake, I didn't make the report. Sorry about that.

I added this code( https://share.pluginus.net/image/i20250306134145.png ):

add_filter('woocommerce_get_price_html', function($price, $_this){
if ($_this->is_closed() && $_this->is_started() ){
if ($_this->get_auction_closed() != '3'){
if ($_this->get_auction_current_bid()){
if ( $_this->is_reserve_met() != FALSE){
$winning_price  = $_this->get_auction_current_bid();
if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$winning_price = $WOOCS->woocs_exchange_value(floatval($winning_price));
}
}
$price = __('<span class="winned-for auction">Winning Bid:</span> ','wc_simple_auctions').wc_price($winning_price);
}
}
}
}
return $price;
}, 10, 2 );
please do a test

You are amazing! Thank you so much for your help, it works perfectly! I just have one question, I see on the staging site you managed to make the bids on the auction activity table convert: https://snipboard.io/jRHsV8.jpg however the code snippet you provided does not manage to do this. I see that you edited the auction activity template file directly to do this. I tried pasting the template file into Claude AI to make a code snippet out of your work, however it was unable to do so. Did you ever manage to make a code snippet to do this? If not, no worries, just thought I would ask :)

Thank you for all your time and great help!

Hello

Oh my god! It looks like I did that too but unfortunately I don't remember.

Looks like I made a temporary solution for the test and didn't make a report because I wanted to rework this code.

Yes, I will check this code.

Hello

Unfortunately, there is no way around this, in this case the only option is to change the plugin file - \woocommerce-simple-auctions\templates\shortcodes\my-auctions-acivity.php - https://share.pluginus.net/image/i20250307143623.png

if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$bid = $WOOCS->woocs_exchange_value(floatval($bid));
}
}
Of course, there is an option to make a custom shortcode to display this template, but this is no longer part of the LABS concept.

No worries my friend, thank you so much for all your time and help, it is beyond appreciated! By far the best currency conversion plugin and support! :)

Thanks again!

Thank you and welcome;)