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 9 replies, has 2 voices.

Last updated by Riffaz 6 months, 4 weeks ago.

Assigned support staff: Riffaz.

Author Posts
March 17, 2019 at 1:35 am

beatrizu

I am trying to: use a shortcode in a textwidget

Link to a page where the issue can be seen: hidden link

I expected to see: a availability checker, just as on the English page:
hidden link

Instead, I got: a widget where only the widget title was translated,
but the widget body with the shortcode, is not parsed/displayed.

March 17, 2019 at 12:59 pm #3363447

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Thank you for contacting WPML support.

I could not find your theme in our compatibility list: https://wpml.org/documentation/theme-compatibility/
Anyhow, if the theme follows the standards of WordPress then it should work.

We need to reproduce this issue in a fresh installation to troubleshoot this.
1. please go to : hidden link
2. install your theme .
3. complete the WPML setup as you have it in your site. Just click next on the last step (sitekey)
4. create that shortcode widget.
5. Let us know how to create it and how to check it.

Regards,
Riffaz.

March 17, 2019 at 2:32 pm #3363703

beatrizu

Hi Riffaz,

Thanks for your reply, I will do as you explained.

But one question:
Can you please explain step 5? What do you want me to do in step 5?

March 17, 2019 at 5:10 pm #3364085

beatrizu

I have done steps 1-4.

Step 5:

* Link to a page where the issue can be seen:
hidden link

* I expected to see: a availability checker, just as on the English page:
hidden link

Instead, I got: a widget where only the widget title was translated,
but the widget body with the shortcode, is not parsed/displayed.

March 18, 2019 at 6:52 am #3366289

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Thank you for this.

[mphb_availability id="195"]
- as per this shortcode, where does this 195 come from?
- what is this ID?
- if we want to change this where we have to look to get the another ID?

March 19, 2019 at 12:13 am #3374061

beatrizu

Hi Riffaz,

Thanks also for your help. Much appreciated!

- as per this shortcode, where does this 195 come from?
The 195 comes from the accommodation type in the Motopress hotel booking plugin:
hidden link
(Please note that the plugin is on the official WPML compatiblity list: https://wpml.org/plugin/motopress/)

- what is this ID?
It's the WordPress ID for this accommodation type.

- if we want to change this where we have to look to get the another ID?
I am not sure. Maybe here hidden link

You got me thinking. I did translate the accomodation type.
See: hidden link
The ID of the translated accomodation type is 315.
I changed the shortcode in the widget for Spanish homepage to [mphb_availability id="315"]
But.. that did not fix it yet..

March 19, 2019 at 10:49 am #3378089

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

I've set this to our internal team review.
please be patient till we get back to you.

Regards,

March 19, 2019 at 3:18 pm #3380553

beatrizu

Thank you Riffaz.
I will await the reaction of the internal team.

March 20, 2019 at 10:30 am #3387425

beatrizu

Ok I got it fixed.

1) First part of the solution was to translate the "Accommodation" and use the different id's.

2) Last part of the solution found: turns out that issue was that the "rate" (price) for the accommodation, had not been translated.
I have to thank the guys behind the MotoPress Hotel Booking plugin for helping fixing that part!

I did not think the "Rate" needed to be translated, as I thought a price stays the same in English and Spanish. But this was a mistake. The taxonomy "Rate" also needs to be translated or else it will break the rest. Once that was translated, all is working!

Thanks a lot for your time and assistance guys!

March 21, 2019 at 5:22 am #3395431

Riffaz
Supporter

Languages: English (English )

Timezone: Asia/Colombo (GMT+05:30)

Hi,

Great!

Thank you for posting the solution here.
This will help other users if they face the same issue.

Regards,