Skip Navigation

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

Problem:

[Aliexpress Dropship for Woocommerce] the shipping price does not change to the other currencies

Solution:

The Aliexpress Dropship for Woocommerce plugin is not officially compatible with WPML and WooCommerce Multilingual. Nevertheless, our second-tier supporter has debugged this issue and found a workaround to fix it. Here is what you need to do.

1. Take a backup of your site in case something goes wrong.

2. In the theme's functions.php file add this code:

add_filter( 'wcml_multi_currency_ajax_actions', 'add_action_to_multi_currency_ajax', 10, 1 );

function add_action_to_multi_currency_ajax( $ajax_actions ) {

	$ajax_actions[] = 'a2w_frontend_load_shipping_info'; // Add a AJAX action to the array
	return $ajax_actions;

}

3. In: wp-content/plugins/ali2woo/includes/classes/utils/A2W_Shipping.php
After the line:

                    $ship_price = A2W_ShippingPriceFormula::apply_formula($method, $local_values);

add these lines:

	        $current_currency = apply_filters('wcml_price_currency', NULL );
	        $ship_price = apply_filters( 'wcml_raw_price_amount', $ship_price, $current_currency );

4. In:wp-content/plugins/ali2woo/includes/classes/utils/A2W_Utils.php
After the line:

            if (!$has_shipping_method) {

add this line:

	            $current_currency = apply_filters('wcml_price_currency', NULL );

after the line:

 $price = isset($item['previewFreightAmount']['value']) ? $item['previewFreightAmount']['value'] : $item['freightAmount']['value'];

add this line:

$price = apply_filters( 'wcml_raw_price_amount', $price, $current_currency );

after the line:

$shipping_cost = isset($item['previewFreightAmount']['value']) ? $item['previewFreightAmount']['value'] : $item['freightAmount']['value'];

add this line:

$shipping_cost = apply_filters( 'wcml_raw_price_amount', $shipping_cost, $current_currency );

After adding and saving the above changes, the shipping prices will be according to the exchange rate set in WooCommerce Multilingual.

Please note that the workaround will probably not work with custom prices specified in the 2nd currency. That is true if it is possible to be set, as we are unsure where the shipping plugin sets those prices.

In the future we may not be able to support this workaround. Please share this with the ali2woo support. You can also urge them to join our Go Global program. You can find details about it here.

https://wpml.org/documentation/support/go-global-program/

We will be happy to cooperate with the authors in making their plugin officially compatible with WPML.

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.

Our next available supporter will start replying to tickets in about 2.37 hours from now. Thank you for your understanding.

This topic contains 15 replies, has 2 voices.

Last updated by Itamar 1 year, 10 months ago.

Assisted by: Itamar.

Author Posts
May 21, 2022 at 12:15 pm #11271019

Ali Elsnafawy

i have WPML translation plugin and i enable multi currency option

but not effected for shipping prices

i think because the wpml reat it as text not price

can you please fix it

photo attached

here

hidden link
hidden link

May 21, 2022 at 7:07 pm #11271671

Ali Elsnafawy

this is ali2woo support replay

Our plugin already uses the standard function to display the price:

wc_price(123)
Please, show me, where is the currency configured in your WPML settings? We will check why the price is not recalculated.

Also,

Ask WPML developers what hook they are using to recalculate the price. If we know what this hook is, we can add support for it to our plugin.

May 22, 2022 at 7:37 pm #11274339

Itamar
Supporter

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

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

Hi again,

I'll also help you with this issue.

We might be looking at a compatibility issue between WPML and the AliExpress Dropshipping Business plugin for WooCommerce by ma-group.

hidden link

This plugin is not on our list of officially compatible plugins at the following link and is also not known to us.

https://wpml.org/plugin/

In such cases, we try to do our best to provide a fix or a workaround for the problem.

To proceed, we need to replicate this issue on a fresh WordPress installation. Then I'll be able to escalate it to our compatibility team. For this, I created a test website with a clean WordPress install. You can access it through this link:

hidden link

With this link, you'll be directly logged in.

Could you please install the Dropshipping Business plugin for WooCommerce plugin and see if the issue is replicable on a clean WordPress installation?

Please configures WPML and WooCommerce the same as on your site (the basic configurations needed to replicate the issue are enough).

Please also make sure that you are installing the latest version of the plugin.

When everything is finished, and you can replicate the problem, please let us know.

Thanks,
Itamar.

May 22, 2022 at 9:09 pm #11274419

Ali Elsnafawy

this error happened when i install ali2woo plugin

Screen Shot 2022-05-23 at 12.07.59 AM.png
May 23, 2022 at 8:00 am #11276675

Itamar
Supporter

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

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

Hi, and thanks for trying my suggestions.

Can you please send me the ali2woo plugin so I can continue investigating this issue?

You can upload the plugin to a service like Google Drive or Dropbox and share the link with me.
For this, I'll enable a private message for the following reply.

Regards,
Itamar.

May 24, 2022 at 8:43 pm #11296971

Itamar
Supporter

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

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

Hi, and thanks for sharing the plugin with me.

I installed and activated it on a new test site without a fatal error.

Please proceed with replicating the issue on the test site. The following link will give you access to the admin as an administrator.

hidden link

Please let me know once you replicate the issue.

Regards,
Itamar.

May 24, 2022 at 11:27 pm #11297773

Ali Elsnafawy

can you check this link
hidden link

Screen Shot 2022-05-25 at 2.24.55 AM.png
Screen Shot 2022-05-25 at 2.24.24 AM.png
May 25, 2022 at 7:56 am #11300677

Itamar
Supporter

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

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

Hi,

Can you please explain to me where you configure the AliExpress Standard Shipping?

May 25, 2022 at 8:43 am #11301297

Ali Elsnafawy

from here

Screenshot 2022-05-25 114733.png
May 25, 2022 at 10:56 am #11303209

Itamar
Supporter

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

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

Thanks.

In this location (see the link below), it is possible to configure the Initial Name and the Service Name. Please see the attached screenshot Aliexpress Selection Standard.jpg.

hidden link

But where is it possible to set the shipping price?

Aliexpress Selection Standard.jpg
May 25, 2022 at 2:43 pm #11306629

Ali Elsnafawy

the shipping price is stored on database not shown
because it's imported from aliexpress and not editable

May 25, 2022 at 7:53 pm #11309527

Itamar
Supporter

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

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

Thanks for this info.

I'm consulting our second-tier supporters regarding this issue. When I have their reply I'll update you here.

Thank you for your patience.
Regards,
Itamar.

May 26, 2022 at 12:50 pm #11316027

Itamar
Supporter

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

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

Hi,

Our second-tier supporter says that if the Ali2woo team wants to provide support on their side to the shipping prices, they can use this filter to convert the price:

https://wpml.org/wcml-hook/wcml_raw_price_amount/

And they can get the current currency on the front-end from:

https://wpml.org/wcml-hook/wcml_price_currency/

I will also escalate this issue to our compatibility team, and they will also try to help the author of the Ali2woo plugin on our side.

I'll update you here on any news regarding this issue.

Regards,
Itamar.

May 28, 2022 at 6:45 pm #11334509

Itamar
Supporter

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

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

Hi,

I've escalated this issue to our compatibility team. I'll update you here on any news regarding this issue.

Thank you for your patience.
Itamar.

May 31, 2022 at 1:00 pm #11353349

Itamar
Supporter

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

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

Hi,

Our second-tier supporter has debugged this issue and found a workaround to fix it. Here is what you need to do.

1. Take a backup of your site in case something goes wrong.

2. In the theme's functions.php file add this code:

add_filter( 'wcml_multi_currency_ajax_actions', 'add_action_to_multi_currency_ajax', 10, 1 );

function add_action_to_multi_currency_ajax( $ajax_actions ) {

	$ajax_actions[] = 'a2w_frontend_load_shipping_info'; // Add a AJAX action to the array
	return $ajax_actions;

}

3. In: wp-content/plugins/ali2woo/includes/classes/utils/A2W_Shipping.php
After the line:

                    $ship_price = A2W_ShippingPriceFormula::apply_formula($method, $local_values);

add these lines:

	        $current_currency = apply_filters('wcml_price_currency', NULL );
	        $ship_price = apply_filters( 'wcml_raw_price_amount', $ship_price, $current_currency );

4. In:wp-content/plugins/ali2woo/includes/classes/utils/A2W_Utils.php
After the line:

            if (!$has_shipping_method) {

add this line:

	            $current_currency = apply_filters('wcml_price_currency', NULL );

after the line:

 $price = isset($item['previewFreightAmount']['value']) ? $item['previewFreightAmount']['value'] : $item['freightAmount']['value'];

add this line:

$price = apply_filters( 'wcml_raw_price_amount', $price, $current_currency );

after the line:

$shipping_cost = isset($item['previewFreightAmount']['value']) ? $item['previewFreightAmount']['value'] : $item['freightAmount']['value'];

add this line:

$shipping_cost = apply_filters( 'wcml_raw_price_amount', $shipping_cost, $current_currency );

After adding and saving the above changes, the shipping prices will be according to the exchange rate set in WooCommerce Multilingual. We tried it on the test site here.

hidden link

Please share this with the ali2woo support. Our developers will also try to contact them.

Nevertheless, please note that the workaround will probably not work with custom prices specified in the 2nd currency. That is true if it is possible to be set, as we are unsure where the shipping plugin sets those prices.

Regards,
Itamar.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.