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 30 replies, has 3 voices.
Last updated by Alejandro 4 years, 8 months ago.
Assisted by: Alejandro.
Author | Posts |
---|---|
June 21, 2019 at 5:39 am #4064745 | |
markusB-49 |
Hi there, |
June 21, 2019 at 9:20 am #4065709 | |
Alejandro Supporter
Languages: English (English ) Spanish (Español ) Italian (Italiano ) Timezone: Europe/Rome (GMT+01:00) |
I'm sorry for the delay in the answer. It seems you migrated your entire site into the sandbox which basically nulled the point of the test so i tried to replicate the problem myself by following your directions. I basically imported your theme, PODS plugin and created 3 products with a few images each. the problem is that i couldn't really see it as you do so there's a step i'm missing. Could you please access this sandbox: hidden link and in there try to replicate the problem? Please do not migrate anything from your site (i need to have a database and site as clean as possible, to avoid conflict issues and to be faster when running the tests), the basic structure seems to be there already, so you only need to make sure that it's properly configured as in your site so i can at least see the products in the front-end as you did. Then i'll continue the tests. Let me know when you do. |
June 21, 2019 at 3:02 pm #4067909 | |
markusB-49 |
I am not sure if I understand you correctly. All we need to achieve is that the gallery images in the GERMAN version per product show in all other languages on the product page, too (see screenshot). The alternative option would be to redo this all manually, which I'd obviously like to avoid. Does this all make sense? Can we Skype? |
June 21, 2019 at 3:27 pm #4068039 | |
Alejandro Supporter
Languages: English (English ) Spanish (Español ) Italian (Italiano ) Timezone: Europe/Rome (GMT+01:00) |
You're right. It looks like a compatibility issue, i see that all the other fields are copied without issues except the ones from the gallery, so i'll ask our developer about this and let you know. |
June 21, 2019 at 3:45 pm #4068185 | |
Alejandro Supporter
Languages: English (English ) Spanish (Español ) Italian (Italiano ) Timezone: Europe/Rome (GMT+01:00) |
I'm escalating this ticket to our compatibility team, they'll contact the PODS author and try to find a way to fix it. I'll keep you updated (you don't have to answer this message) Regards. |
June 21, 2019 at 7:42 pm #4069035 | |
markusB-49 |
Thanks so much. This is haunting us since weeks. |
June 24, 2019 at 3:30 pm #4078333 | |
Alejandro Supporter
Languages: English (English ) Spanish (Español ) Italian (Italiano ) Timezone: Europe/Rome (GMT+01:00) |
Hello, So, as we feared it seems to be a compatibility issue but our developers gave us a workaround. Please try to add the following filter in the code of the template where you show the galleries: apply_filters( 'wpml_object_id', int $element_id, string $element_type, bool $return_original_if_missing, mixed $ulanguage_code ) Most specifically, this code should go where the gallery ID is retrieved (i can only guess it's a PODS code that handles that) Remember to change the parameters above with the correct ones. You can use this documentation as a guide if you want to have more details on this filter: https://wpml.org/wpml-hook/wpml_object_id/ Let me know how it goes. |
June 28, 2019 at 3:36 pm #4108995 | |
markusB-49 |
O.k., I assuem that's good news. For the product page I assume I have located the code snippet (see screenshots). Just to not confuse anything where and how with what parameters do you want me to insert the line: 1 Thanks, |
June 28, 2019 at 3:45 pm #4109279 | |
Alejandro Supporter
Languages: English (English ) Spanish (Español ) Italian (Italiano ) Timezone: Europe/Rome (GMT+01:00) |
Can you tell me the name of the template and where to locate it, so i can send it to our developers? (i'm talking the one you show in Screenshot 2019-06-28 at 5.33.28 PM.png ) Thanks. |
June 28, 2019 at 5:33 pm #4109697 | |
markusB-49 |
I actually can't as the website was programmed before my time and the template name is hidden. If you ask your developer to access the sandbox he can access the template. Is not possible? |
July 1, 2019 at 2:48 pm #4120447 | |
Alejandro Supporter
Languages: English (English ) Spanish (Español ) Italian (Italiano ) Timezone: Europe/Rome (GMT+01:00) |
May i know how did you find that code (the one from the screenshots) |
July 5, 2019 at 1:06 pm #4151477 | |
normundsL |
Hi guys! I've found you conversation as I have same issue. I have several Pods custom post types. I purchased WPML and configured all custom fields as instructed in WPML documentation. But when I create new translation for post with custom image field (e.g. Person with Photo), photo is not copied, even after saving new translation (despite that it shows message at the top that a list of 'Copy' behaviour fields will be populated after saving). I have set custom field 'photo' to 'Copy' behaviour. I tried also Copy from original language option, but image fields (also relationship and actually other pods custom fields) are not copied. I've spent many hours now to find the solution but this conversation is the closest I could get - a compatibility issue. So is the only thing we can do is rely on Pods team to solve this? Or WPML team can do anything about this? Is there perhaps some workaround for admin UI so my client don't have to attach same image for each translation? New threads created by Alejandro and linked to this one are listed below: https://wpml.org/forums/topic/split-images-from-media-gallery-not-showing-in-all-languages/ |
July 7, 2019 at 9:36 am #4157441 | |
markusB-49 |
I find it here but did not check other pages: |
July 7, 2019 at 9:39 am #4157443 | |
markusB-49 |
@normundsl |
July 8, 2019 at 9:47 am #4160665 | |
Alejandro Supporter
Languages: English (English ) Spanish (Español ) Italian (Italiano ) Timezone: Europe/Rome (GMT+01:00) |
I believe the code should be added in the loop you created (line 75 of the produkt-details.php) apply_filters( 'wpml_object_id', int $element_id, string $element_type, bool $return_original_if_missing, mixed $ulanguage_code ) In there you have to replace the different parameters with the real ones, so "$element_id" would be either the ID or the function that returns the element ID. In your case you're using an array and i asked the developer how could this be added in there (but if you know how to proceed, go ahead) "$element_type" would be the element type ("attachment", in your case) in "$return_original_if_missing" you could set "TRUE" for "$ulanguage_code" you could use this hook to dynamically get the current language: Regards. |