Support » Plugin: WOOCS - Currency Switcher for WooCommerce Professional » Converting the Sign-Up Fee (WooCommerce Subscriptions)

  • Resolved widecast

    (@widecast)


    Hello,

    Is it normal that when using WOOCS with WooCommerce Subscriptions, the sign-up fee displayed on the product pages is not being converted?

    For example:

    USD $18.89 / month with a 3-month free trial and a USD $66.00 sign-up fee

    The price per month is converted as expected, but the sign-up fee is showing the value in the original currency.

    On the cart and checkout pages, the sign-up fee is converted as expected. The issue seems to be limited to the way it’s displayed on product pages.

    Thank you!

    David

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author RealMag777

    (@realmag777)

    Hello David

    Try to in file \wp-content\plugins\woocommerce-subscriptions\includes\wcs-order-functions.php add next code( https://c2n.me/44v5F9x.png )

    if (class_exists('WOOCS')) {
        global $WOOCS;
        $order_currency = get_post_meta($order_id, '_order_currency', true);
        if ($order_currency AND $WOOCS->current_currency != $order_currency) {
            $WOOCS->set_currency($order_currency);
        }
    }

    then AND add next code in functions.php of current wp theme:

    add_filter('woocommerce_subscription_price_string_details', 'woocs_woocommerce_subscription_price_string_details', 100, 2);
    
    function woocs_woocommerce_subscription_price_string_details($arg, $_this) {
        if (class_exists('WOOCS')) {
            global $WOOCS;
            $order_currency = get_post_meta($_this->get_id(), '_order_currency', true);
            if ($order_currency AND $WOOCS->current_currency != $order_currency) {
                $WOOCS->set_currency($order_currency);
            }
        }
    
        return $arg;
    }

    Also add CSS in current wp theme styles:

    .price .subscription-details:nth-child(2) {
       display: none;
    }

    Also in file – “\wp-content\plugins\woocommerce-subscriptions-master\includes\class-wcs-cart-renewal.php” add code – https://c2n.me/43Oj181.png

    if (class_exists('WOOCS')) {
        global $WOOCS;
        if ($WOOCS->is_multiple_allowed) {
            $curr = get_post_meta($subscription->get_id(), '_order_currency', true);
            $currencies = $WOOCS->get_currencies();
            $rate = $currencies[$curr]['rate'];
            $price = $price / ($rate);
        }
    }

    p.s. we will update this code in our WOOCS LABS program https://currency-switcher.com/woocs-labs/

    Thread Starter widecast

    (@widecast)

    Hi again!

    Thanks for this. I’ve done all the integration steps.

    However, the suggested CSS styles hide the sign-up fee instead of converting it.

    Do you have a different solution?

    Thank you!

    David

    Plugin Author RealMag777

    (@realmag777)

    Hello David

    OK! please delete this code – https://c2n.me/44DWGWc.png and do tests

    Thread Starter widecast

    (@widecast)

    Hello!

    It seems that removing that code displays the entire text, but the sign-up fee is still not converted.

    Plugin Author RealMag777

    (@realmag777)

    Hello David

    Ok! In this case, please create a new adaptation request here: https://currency-switcher.com/woocs-labs/

    Thread Starter widecast

    (@widecast)

    I’ve created the new adaptation request. Thanks!

    Plugin Author RealMag777

    (@realmag777)

    Hello David

    Ok, thank you, wait reply there please …

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Converting the Sign-Up Fee (WooCommerce Subscriptions)’ is closed to new replies.