Force product field output in a certaing language

  • Posts: 634
  • Thank you received: 16
10 years 1 month ago #170143

-- Joomla version -- : newest
-- PHP version -- : newest

While I get a fix for my problems with Acyba mulitlingual managing that I requested in another post...

IS THERE a way that I can force a field output in a certain language no matter in which language I am browsing the site?

I have this code:

<?php echo '<a class="pagina_producto_precio_oferta">'.$product->precio_oferta.' €</a>';?>

How can I sai to $product->precio_oferta to show in english always independently of my browser language?

I use falang.

Please Log in or Create an account to join the conversation.

  • Posts: 82726
  • Thank you received: 13342
  • MODERATOR
10 years 1 month ago #170197

Hi,

Before that code, you have some code which loads the data of the product and mainly one SQL query on the hikashop_product table.
That query is probably processed automatically by Falang/JoomFish to translate the data of the product in the current language.
And in that case, it's possible to deactivate the processing of Falang/JoomFish by adding a few parameters in the function running the SQL query, but in that case no information of the product will be translated and so you would need to run two queries, one with the translation process activated and another with it turned off, and merge the data between them appropriately.
Otherwise, in some cases (like in the backend where Falang/JoomFish doesn't process the queries), there is additional code to do a query on the table jf_content or falang_content to load the translations manually and replace the data in the product object.
In that case, it's possible to alter a bit the query to not load the translations for the custom field.

In both cases, I can't answer precisely as I don't know the code that you have before that line of code of your message and I don't know the context of where you're trying to do that.

Please Log in or Create an account to join the conversation.

Time to create page: 0.050 seconds
Powered by Kunena Forum