• Resolved adamstocklotstv

    (@adamstocklotstv)


    Hello!

    If you have a multilingual website and you have a minimum order amount, you have the same amount for each currency. Poorly.
    If you have a WPML plugin, this is the solution proposed by WPML. WPML invites creators to cooperate and submit corrections.
    It looks like this:
    This can be fixed by adding the wcml_raw_price_amount filter to CtMPAC_Application::get_minimum_purchase_value() in app/public/wp-content/plugins/minimum-purchase-amount-for-woo-cart/includes/public/ct-class-min-cart -amount -application.php:

    publicfunctionget_minimum_purchase_value() {

    ????$minimumCartTotal= get_option( 'ct_mpac_minimum_purchase_value_for_all', 0);

    ????$minimumCartTotal= apply_filters('wcml_raw_price_amount', $minimumCartTotal);

    ????/**

    ?????* Filter the amount set as the minimum cart total to customize the behaviour with this hook.

    ?????*

    ?????* @since 2.2

    ?????*/

    ????$minimumCartTotal= apply_filters('ct_mpac_filter_min_cart_total', $minimumCartTotal, WC()->cart);

    ????return$minimumCartTotal;

    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author CT Talks

    (@cttalks)

    Hello, @adamstocklotstv
    Thanks for writing to us & bringing this to our notice. Since WPML is widely used for translations we will make sure the values will be translated for compatibility with WPML in our next update.

    Until then you can use the filter ‘ct_mpac_filter_min_cart_total’ to correctly convert the values. (You can try adding this code to your functions.php file)

    add_filter('ct_mpac_filter_min_cart_total', 'WPMLGetValueForCurrency', 99, 2);
    if(!function_exists('WPMLGetValueForCurrency')) {
    function WPMLGetValueForCurrency($value, $cart) {
    return apply_filters('wcml_raw_price_amount', $value);
    }
    }


    Let us know if this resolves you issue.

    Thread Starter adamstocklotstv

    (@adamstocklotstv)

    Hello! I have this:

    add_filter( ‘ct_mpac_filter_min_cart_total’, function( $minimumCartTotal ){

    $minimumCartTotal = apply_filters('wcml_raw_price_amount', $minimumCartTotal);
    
    return $minimumCartTotal;

    },10 );

    Plugin Author CT Talks

    (@cttalks)

    Glad to know it’s already there for you and working. ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Multicurrency problem with WPLM’ is closed to new replies.