Content of the page

WooCommerce Subscriptions by WooCommerce


Content of the article

Pluginhttps://woocommerce.com/products/woocommerce-subscriptions/

  • In file functions.php of your current wp theme add next code:
    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;
    }
  • In file \wp-content\plugins\woocommerce-subscriptions\includes\wcs-order-functions.php add next code:
    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);
        }
    }

     

Faster WordPress Hosting