[Resolved] Export multiple feeds with different curriencies
This thread is resolved. Here is a description of the problem and solution.
Problem:
The client needed to export feeds with different currencies using WP All Export. They could export in EUR using a custom function, but the same approach did not work for NOK, even though the default currency was SEK. Solution:
Here is the function that solved the issue (provided by the user):
The following shortcode should be used in the WP All Export field:
[allafroer_convert_currency({Price}, 'NOK')]
If you're experiencing similar issues with currency conversion in WP All Export, we recommend trying the provided custom function and adjusting the shortcode accordingly. However, please note that this solution might be outdated or not applicable to your case. If it doesn't resolve your issue, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket.
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.
I try to export feeds with wp all export with different currenies.
When i add this function i can export with EUR. But when i add NOK i cant export with NOK . My default currency is SEK. How should i do for exporting feeds with different currencies. This is the code i insert in the field in wp all export [all_export_price_euro({Price})]
Function1
function all_export_price_euro($value){
apply_filters('wcml_raw_price_amount', $value, 'SEK');
return apply_filters('wcml_raw_price_amount', $value, 'EUR');
}
Function 2 (doesnt works with NOK but still with EUR)
function all_export_price_euro($value){
apply_filters('wcml_raw_price_amount', $value, 'SEK');
return apply_filters('wcml_raw_price_amount', $value, 'EUR');
}
function all_export_price_nok($value){
apply_filters('wcml_raw_price_amount', $value, 'SEK');
return apply_filters('wcml_raw_price_amount', $value, 'NOK');
}
When you apply_filters to a value, you (potentially) modify the value and return it, but in these examples, you don't do anything with the returned value, and it is discarded, so it is meaningless.
As for the problem, in WP All Export, when exporting a field, in this case, price, you can pass it through a function.
According to what you wrote, you use the all_export_price_euro function.
Do you have a separate export where they use the all_export_price_nok function instead of the euro function?
Simply declaring a all_export_price_nok function isn't enough, you have to use it. That seems obvious, but you don't state that you do, and it is the simplest explanation for why this wouldn't work.
I hope that this explanation helps you to solve the problem.
Okay. So I can remove this from the function?
apply_filters('wcml_raw_price_amount', $value, 'SEK');
I have two separate exports. One in English and one in Norwegian.
I have attached a picture of how it looks in the function editor and then how it looks in the price field for each export.
The English export exports EUR but the Norwegian still exports SEK.
It's not clear why the EUR conversion would work but not the NOK conversion, and I'd really need to see your site and look at the data being exported to better understand why this may be happening.
Could I get access to your site. Do you have a staging server I could check rather than a production site? (I may want to run the export a few times as part of the debugging process, and it may require adding one or two utility plugins to help.) If you only have the production server and I can't spot anything just reviewing the settings, I could take a copy of the site to install locally to work on.
Let me mark your next reply as private so that we can get log-in credentials from you—you may want to create a temporary admin user for us to use that you can later delete. And be sure to have a current backup of your site.
Can you also confirm which export job you are running?
(Note, I'm not actually working today either, but I was conscious that this has been waiting for a response, and if I can get the credentials from you I'll be able to address this Monday morning.)
and this in the field: [allafroer_convert_currency({Price}, "NOK")]
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.