Jump to content

Advertising block - working with languages


Recommended Posts

Has anyone managed to make it so that the blockadvertising that comes default with Prestashop is language sensitive?

I mean, I have an image with English text on it. I'd like when visitors change their language to French, another image (containing the French ad) to be displayed. Can anyone help? I think it's something a lot of users would appreciate.

Link to comment
Share on other sites

  • 11 months later...

Here's the solution specifically for the Advertising module:

 

in modules/blockadvertising/blockadvertising.tpl change:

img src="{$image}"

 

to

img src="{$img_ps_dir}advertising_custom_{$lang_iso}.jpg"

 

in the /img folder upload different images for each language and name them using the 2 letters iso code from each language you are using, for example:

 

advertising_custom_en.jpg

advertising_custom_nl.jpg

advertising_custom_fr.jpg

Link to comment
Share on other sites

And if you want to change the language of the title of the image, you can change the alt and title it in the .tpl file to:

 

alt="{l s='Your text here' mod='blockadvertising'}"

 

and translate it in the Back Office (Translations>Modules)

Link to comment
Share on other sites

  • 6 months later...
×
×
  • Create New...