Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You want to set a minimum order amount in multiple currencies on your WooCommerce site using WPML.
Solution:
We recommend adding custom code to handle multi-currency minimum order amounts. Follow these steps:
1. Open the

functions.php

file of your theme using a code editor.
2. Insert the following code at the end of the file:

// WPML workaround for compsupp-7423<br />add_filter( 'ct_mpac_filter_min_cart_total', function( $minimumCartTotal ){<br />    $minimumCartTotal = apply_filters('wcml_raw_price_amount', $minimumCartTotal);<br />    return $minimumCartTotal;<br />},10 );

3. Save the changes to the file.
This code snippet adjusts the minimum cart total to support multiple currencies through WPML.
Additionally, we suggest contacting the developers of the 'Minimum Purchase Amount For Woo Cart – For WooCommerce' plugin and encourage them to participate in our Go Global Program. This will help ensure their plugin's compatibility with WPML.

If this solution does not apply to your situation, or if it seems outdated, please check the related known issues and confirm that you have the latest versions of themes and plugins installed. If issues persist, we highly recommend opening a new support ticket at WPML support forum.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 8 replies, has 2 voices.

Last updated by Itamar 4 months, 3 weeks ago.

Assisted by: Itamar.

Author Posts
June 13, 2024 at 10:26 am #15734570

dominikM-32

Background of the issue:
I want to enter a minimum order amount in several currencies on my site hidden link.

Symptoms:
No specific issue or error message mentioned.

Questions:
Do you have any solution for entering a minimum order amount in several currencies?
Do you recommend any free plugin that will make this possible?
Is there an option in WPML that I haven't found?
Maybe you already have a solution that addresses this?

June 13, 2024 at 10:44 am #15735615

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

This ticket has been inactive for quite a while. I didn't get a reply from you. So, I've transformed this chat into a support ticket because you may still need our help. If you do, please reply to this ticket, and one of our supporters will continue helping you.

Please check the chat and my replies after you stopped responding.

Regards,
Itamar.

June 13, 2024 at 10:46 am #15735649

dominikM-32

Hi!

June 13, 2024 at 11:01 am #15735673

dominikM-32

OK, Thanks.
I still need help. I need solution for minimal cart amount in 2 currencies. How?

Thanks, Adam.

June 13, 2024 at 4:57 pm #15737368

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Adam.

I installed the Minimum Purchase Amount For Woo Cart – For WooCommerce plugin on my test site with WooCommerce and WooCommerce Multilingual & Multicurrency. It works for different currencies! On my test site, I have two currencies. USD and NIS. When adding products in each currency, the notice from the plugin will be in the current currency. Please see the attached screenshots.

Please ensure to follow our multicurrency guide.

https://wpml.org/documentation/related-projects/woocommerce-multilingual/multi-currency-support-woocommerce/

Please let me know if you have any further questions.

If you need further help, please note that my weekend is Friday-Saturday, and I'll be able to continue to reply on Sunday.

Regards,
Itamar.

price-in-usd.jpg
price-in-nis.jpg
June 17, 2024 at 6:57 am #15743464

dominikM-32

Hello! Thank you for taking the test. That's nice.

The plugin also shows the correct currencies for me, but does not convert them.

I have PLN and EUR.
If I set e.g. PLN 100, the value in EUR is also 100 - it should be converted according to the conversion rate in WPML - i.e. approximately EUR 21.5.

Do we have any advice for this?

Thanks, Adam.

June 17, 2024 at 12:51 pm #15745478

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Adam.

I will escalate this issue to our second-tier supporters to see if they can come up with a solution for this. I'll keep you updated when I have news about this issue.

Regards,
Itamar.

June 18, 2024 at 9:47 am #15748229

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

This issue is now escalated to our compatibility team.

We'll keep you updated here on any news regarding this issue.

Regards,
Itamar.

June 20, 2024 at 7:47 pm #15766750

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

Our compatibility team has provided a workaround for this issue.

1. Edit the functions.php file of your theme with a code editor.

2. Add the following code (you can add it at the bottom of the file).

// WPML workaround for compsupp-7423
add_filter( 'ct_mpac_filter_min_cart_total', function( $minimumCartTotal ){
	
	$minimumCartTotal = apply_filters('wcml_raw_price_amount', $minimumCartTotal);

	return $minimumCartTotal;

},10 );

3. Save the file.

Now, the problem should be solved.

We would appreciate it if you could also report this problem to the authors of the Minimum Purchase Amount For Woo Cart – For WooCommerce plugin. Please also urge them to join our Go Global Program. You can find details about it here.

https://wpml.org/documentation/theme-compatibility/go-global-program/

We will happily cooperate with the authors to make their plugin officially compatible with WPML.

You send them the following information.

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:

public function get_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;
}

Regards,
Itamar.