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

Last updated by Carlos Rojas 1 year ago.

Assigned support staff: Carlos Rojas.

Author Posts
September 26, 2018 at 11:27 am #2766969

Václav

Hello,
I created a custom currency switcher template, which looks like this:

<div class="{{ css_classes }}" >
	<ul>
        {% for currency in currencies %}

            {% if currency != selected_currency %}
				<li>
					<a rel="{{ currency }}">{{ get_formatted_price( currency, format )|raw }}</a>
				</li>
            {% endif %}

        {% endfor %}
	</ul>
</div>

How can I display product prices in each of the currencies in the switcher?

Thanks!
Vaclav

September 27, 2018 at 8:55 pm #2771776

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hello Vaclav,
Thank you for contacting WPML support.

I'm not sure if I understood the issue correctly. Do you desire to show the price of the products in the currency switcher?

Kind regards,
Carlos

October 1, 2018 at 1:59 pm #2778368

Václav

Hello,
yup, exactly, I need to display the product price in the switcher.

Thanks
Vaclav

October 1, 2018 at 8:33 pm #2779457

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hi Vaclav,
Thank you veyr much for your feedback.

I have found this ticket where one of my colleagues gives a solution and I would like to ask you to give it a try: https://wpml.org/forums/topic/get-product-price-for-each-currencies-in-the-back-end/#post-2456115

Also, I would like to ask you to visit this link where you will find WPML's documentated hooks: https://wpml.org/documentation/support/wpml-coding-api/wpml-hooks-reference/

Best regards,
Carlos

October 7, 2018 at 8:10 am #2793559

Václav

Hello,
thanks. This seems to be on a right path, but I don't understand how to access the price in the Twig template?

Thanks
V.

October 8, 2018 at 4:31 pm #2796935

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hi Vaclav,

I'm consulting our specialists about your question. I will get back to you as soon as I get an answer.

Best regards,
Carlos

October 9, 2018 at 4:56 pm #2801269

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hi Vaclav,

I got an answer from our specialists, and unfortunately we don't have this feature. We have subtotal – but it is based on the cart contents and not the current product: https://wpml.org/documentation/related-projects/woocommerce-multilingual/multi-currency-support-woocommerce/#adjusting-the-output-of-the-switcher

To solve this issue you may need to define the custom twig functions for this. At this point I would recommend you to contact one of our certified partners in the following link: https://wpml.org/contractors/

Please let me know if you need further assistance and I will be more than happy to help you.
Best regards,
Carlos

October 9, 2018 at 6:11 pm #2801512

Václav

Hello,
I'm a certified partner myself, no need to contact anyone..;) I hoped there will be some official support for this, if there's not, I'll do that myself..:)

Thanks
V.

October 9, 2018 at 6:55 pm #2801678

Carlos Rojas
Supporter

Languages: English (English ) Spanish (Español )

Timezone: America/Montevideo (GMT-03:00)

Hi Vaclav,
I'm glad to hear that you are a certified partner! 🙂

The fastest way to solve this issue (in our side) is if you create a featured request about this issue, so we can escalate it directly to our developers.

Thank you very much for your understanding!
Best regards,
Carlos