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

[WOOCS LABS] SUMO Subscriptions plugin compatibility

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!

I have a problem in my subscription products, via SUMO Subscriptions, when I use the default currency (USD) everything works as expected, but when I switch to a differente currency the total amount is added to the cart instead of the partial payment (monthly).

Example:

  • USD currency: monthly fee USD$25, and in the total amount it is displayed as USD$25, with next billing cycle 2022-4-25. This is CORRECT.
  • Switching to a different currency, for example, MXN: monthly fee MXN$501.75, this is CORRECT, and in the total amount it is displayed as MXN$10,070.12, this is INCORRECT, with next billing cycle 2022-4-25. The correct amount, should be MXN$501.75

Defaul currency:

defaul currency

After swtiching currency:

switching to a different currency

 

Versions:

Regards

Hello

Please paste your license key here - https://share.pluginus.net/image/i20210618130558.png -> https://share.pluginus.net/image/i20210618130614.png

Add wp-admin+FTP  access  to your  test  site - https://share.pluginus.net/image/i20210618130558.png ->https://share.pluginus.net/image/i20210618130637.png

I will add the plugin to the adaptation queue

Thanks Pablo.

The requested data has been uploaded to the ticket.

  • Plugin license key
  • Minimal store with the product, plugins and currency already configured and fully tested
  • Wordpress admin user
  • FTP user

Regards,

Jesus

 

Hello Jesus

Ok! I added the plugin to the adaptation queue

I will write to you as soon as I get the result

Hello Jesus

In  functions.php  add  this  code:

add_filter( 'sumosubscriptions_get_line_total', function( $line_total, $subscription, $default_line_total, $is_trial_enabled,$subscription_obj_type ){

if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
$line_total = $line_total / $rate;
}
}
}

return $line_total;
},99,5);

And  do  a  test

Hi!

Thanks for the update.

For your convenience and to simplify the testing process, I have added the importable Filezilla settings in the private area.  Please save and import the data provided in an xml file.

Could you please try again to login via ftp? I just retested the login, and I was able to do it, no problem whatsoever.

If you are unable to do so, could you please provide more information and if possible a file patch?

I have added your code at the END of the file, I am not sure if this is the right place to put it. I've tried the site with the coded provided, and when swtiching currencies the site is no longer converting the amount in subtotal and total (shown in red). It is only switching in the individual product (shown in green)

 

Regards,

Jesus

Hello Jesus

Have you added this code somewhere?

Hello

My test - https://c2n.me/4fnFrQR.png

Awesome! It works now with subcriptions, as is.  I've added more products that fail the currency change.

I have left Product A, for testing purposes and to check all cases in a single run.

Regards,

Jesus

Hello Jesus

Ok! I will check  it

Hello

Please  do a test  - https://c2n.me/4frl3rM.png

In  file  - \wp-content\plugins\sumosubscriptions\includes\subscription-UI-functions.php - I added  this  code - https://share.pluginus.net/image/i20220415143247.png

if (class_exists('WOOCS') ) {
global $WOOCS;
$initial_fee = $WOOCS->woocs_exchange_value($initial_fee);
$trial_fee = $WOOCS->woocs_exchange_value($trial_fee);
}

Hi!

Thanks for the update.

I have checked Product B which includes a setup fee ($1 USD) and a monthly fee ($1 USD).

The product in the cart is shown correctly in USD, as shown below:

 

After I change the currency to MXN, I am getting the following screen. At this moment and for reference the exchange rate is: $1 USD = $20.20 MXN

  • The setup fee + monthly fee is CORRECT ($40.40 MXN)
  • The monthly fee ($20.20 MXN) is CORRECT
  • The subtotal ($428.29 MXN) is INCORRECT, and should be ($40.40 MXN)
  • The total ($428.29 MXN) is INCORRECT, and should be ($40.40 MXN)

Regards,

Jesus

Hello

Ok!  I will check it

Hello

Ok!  Please  delete  the code  in  functions.php

And  in  file - \wp-content\plugins\sumosubscriptions\includes\class-subscription-frontend.php - add code - https://c2n.me/4fyvUE2.png

if (class_exists('WOOCS')) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
$line_total = $line_total / $rate;
}
}
}