Hi @brandsforless
With other words i need to translate in Greeks the product title but leave the permalink slug in English.
In that case you could put the English slug in the Other Post Options -> Post Slug field inside the import template: https://d.pr/i/1JxyqH. I’m assuming this would be your product title element without the function.
Thank you for your quick response.
I do many trials with the field Post Slug with no effort.
My item product in the xml feed is like this:
<product id=”107541″>
<name>Skirt model 107541 IVON</name>
<brand>IVON</brand>
<category_path>/WOMEN/Women`s Clothing/Skirts</category_path>
<category id=”125″>Skirts</category>
<color>black</color>
<type>Skirt</type>
<images></images>
<price>23.9</price>
<description></description>
<options>
<option id=”M668398″>
<option_name>36</option_name>
<STOCK>5</STOCK>
<avaible_in>7</avaible_in>
</option>
<option id=”M668399″></option>
<option id=”M668400″></option>
<option id=”M668401″></option>
<option id=”M668402″></option>
</options>
</product>
What input i have to use in Post Slug for the <name> field during the import process to be translated in Greece but the permalink keep in English?
Thank you
Hi @brandsforless
What input i have to use in Post Slug for the <name> field during the import process to be translated in Greece but the permalink keep in English?
In the Title put:
[my_translate_data({name[1]})]
See: https://d.pr/i/vR9NYg.
Then, in the Post Slug, put:
{name[1]}
See: https://d.pr/i/InO77g.
If you need further assistance with this please open a ticket at http://www.wpallimport.com/support/ so we can see your import settings & data.
Hello,
everything works like charms now.
My function.php is ok.
One more question please.
Can i use seperate functions file for each import?
My only one function.php is the same for all my imports. But in some imports i have to translate one word different way for each one.
For example shirt translation is right for women tops but is not right for swimsuits and for tankini shist product.
It will be very usefull to use different function.php for each import.
Thanks
Hi @brandsforless
You can’t have multiple function files for our Function Editor, but you can create different functions for each import in the same file. Or, if you’d rather organize your code better, you could not use our Function Editor at all and move your code to a plugin like Code Snippets: https://wordpress.org/plugins/code-snippets/.
Thank you again for your response.
Actually i do not like the idea to use another plugin. I prefer to have one function.php file from your Function Editor.
As you realize i am not a developer and run my e-commerce site alone.
For sure i need to add a code for make the different function for each import.
I think it need to add an add_filter command or something like this.
Can you please suggest something to me for the following function?
<?php
function my_translate_data( $data ) {
$map = array(
‘Lenght’ => ‘Μήκος’,
‘Total’ => ”,
‘Size’ => ‘Μέγεθος’,
‘Hips’ => ‘Γοφοί’,
‘Width’ => ”,
‘Chest’ => ‘Μπούστο’,
‘Bust’ => ‘Μπούστο’,
‘Waist’ => ‘Μέση’,
‘Under’ => ‘Κάτω από ‘,
‘Bottom’ => ‘Κάτω σύνολο ‘,
);
}
?>
return str_ireplace( array_keys( $map ), $map, $data );
Don’t care of course for the Greeks translations.
And again excuse me to be so efortic to you.
Thank you.
Hi @brandsforless
For sure i need to add a code for make the different function for each import.
My suggestion would be to add a second argument to your function so that you can pass the import name (or translation name) to it. For example, the function could look like this: https://paste.ee/p/G3GAC. Then, in the import template, you can decide which translations to use, e.g.:
[my_translate_data( {data[1]} )] // this uses default translations
[my_translate_data( {data[1]}, "swimsuits" )] // this uses swimsuits translations
[my_translate_data( {data[1]}, "shirts" )] // this uses shirts translations
@brandsforless I’m marking this as resolved. Let us know if you have more questions regarding the same issue.
Hi,
everything works fine. I am very excited about your fast and reliable halp.
Keep going.
Thank you