-
multi lingual banners
Hi,
Is this possible to set up banners that will only display in a certain language. Fro instance I have my site in Anglish and French, I want to display the banner in French for french and in english for other nationalities.
Can we do it?
How can I have several banners running in parallele.
Cordialement,
/rs, A
-
Re: multi lingual banners
You could build multiple banner groups and then where each banner group appears have it utilize a different group based on language ...
Right now, it pulls based only on the banner group name ...
With a bit of thought you could have the banner sidebox that uses:
SHOW_BANNERS_GROUP_SET7
Actually utilize an more customized method such as:
PHP Code:
$banner_box_group= SHOW_BANNERS_GROUP_SET7 . $_SESSION['languages_id'];
This would alter the name of the banner group based on the language so if you had a group called:
fred1 for english
fred2 for french
etc. etc.
depending on how your languages are setup, you could build language oriented banners ...
-
Re: multi lingual banners
Hi,
i made your changes in the php-file, but what i have to do with fred1, fred2?
Could you be so kind and give me any hint?
Thank you very match
Gerd
-
Re: multi lingual banners
If you were to enter in the Configuration ... Layout Settings ... the word:
fred
for the setting on:
Quote:
Banner Display Groups - Side Box banner_box
The Banner Display Groups can be from 1 Banner Group or Multiple Banner Groups
For Multiple Banner Groups enter the Banner Group Name separated by a colon :
Example: Wide-Banners:SideBox-Banners
Default Group is SideBox-Banners
What Banner Group(s) do you want to use in the Side Box - banner_box?
Leave blank for none
This should produce fred1 fred2 fred3 etc. for the languages ...
-
Re: multi lingual banners
Hi Ajeh,
i wrote this:
$banner_box_group= SHOW_BANNERS_GROUP_SET7 . $_SESSION['languages_id'];
to the /httpdocs/includes/modules/sideboxes/banner_box.php
I leave this in the Layout Settings unchanged:
Banner Display Groups - Side Box banner_box SideBox-Banners
(I understood this will produce fred1, fred2 etc.)
What a name for the banner group now i have to use in the Banner Manager ?
just fred1 or fred2 or
SideBox-Banners-fred1 etc.
After i changed the php-file the the banner disapeares
I am sure it is easy, but...
Could you one nore try to help http://www.zen-cart.com/forum/images/smilies/mellow.gif
:mellow:
many thanks
Gerd
-
Re: multi lingual banners
Hi Ajeh,
could you be so kind and give me a bit more information?
Thank you very much...
Gerd
-
Re: multi lingual banners
Quote:
Originally Posted by
Ajeh
You could build multiple banner groups and then where each banner group appears have it utilize a different group based on language ...
Right now, it pulls based only on the banner group name ....
Nice, thx
Quote:
Originally Posted by
Ajeh
With a bit of thought you could have the banner sidebox that uses:
SHOW_BANNERS_GROUP_SET7
Actually utilize an more customized method such as:
PHP Code:
$banner_box_group= SHOW_BANNERS_GROUP_SET7 . $_SESSION['languages_id'];
About the explanation above, how can I use it also for the wide banner at the top of the page (not for the sidebox) ? :bangin:
Thanks in advance for your answer.
Sincerly
-
Re: multi lingual banners
I've found it.
Assume you want the 'multilingual process' for the wide banner, find in the header file the follow condition :
PHP Code:
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))
and transform it into :
PHP Code:
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2 . $_SESSION['languages_id']))
... it works for me...
Thank you a lot with these explanations guys, you save me a lot of mone... oups time !!!
-
Re: multi lingual banners
Could anyone explain more, what is the next step after this parse is changed?
-
Re: multi lingual banners
hello, I change the file / public_html / zencart / includes / templates / classic / templates / tpl_header.php with
" if (SHOW_BANNERS_GROUP_SET2! =''& & $ banner = zen_banner_exists ( 'dynamic', SHOW_BANNERS_GROUP_SET2. $ _SESSION [ 'languages_id']) )"
but I really do not know how to put that banner in two languages English and espaņol.
much appreciate the help..... thanks !!
-
Re: multi lingual banners
I really would appreciate the help. some tips to configure multilenguage banner. nobody knows?
-
Re: multi lingual banners
Quote:
Originally Posted by
andreahd
I really would appreciate the help. some tips to configure multilenguage banner. nobody knows?
goto
admin -> tools -> banner manager
click the "new banner" button
enter your Banner Title:
enter your Banner URL:
create your new Banner Group: (do this by entering the information in the text box which is below the dropdown menu.
for your english language version name it mybanner1
for your other language version name it mybanner2
click the insert button to save your new banner.
goto
admin -> configuration -> layout settings -> Banner Display Groups - Side Box banner_box
click the edit button
enter your new banner group designations in the text box
SideBox-Banners:mybanner1:mybanner2
click the update button
follow the instructions provided at the beginning of this thread in order to change the appropriate sidebox.
-
Re: multi lingual banners
thank you very much for responding!!.
I did that which you say. then i change file banner_box.php
$banner_box_group= SHOW_BANNERS_GROUP_SET7 . $_SESSION['languages_id']; and not do it! I'm doing wrong?
-
Re: multi lingual banners
thanks ! works now. thank you very much!
-
Re: multi lingual banners
I realy don' t understand, how should be done.
I have 3 different languages. (eng,it, sl)
Can you please explain step by step.
1. I should rewrite the /sideboxes/my_template/banner_box.php
PHP Code:
$banner_box_group= SHOW_BANNERS_GROUP_SET7 . $_SESSION['languages_id'];
or
$banner_box_group= SHOW_BANNERS_GROUP_SET7 . $_SESSION['en'];
?
If I wish to create this banners in flash?
Thank you for your help!
-
Re: multi lingual banners
The banner change every time I klick the languages flag, but is not compatible with the language selected. If I klick few time the english flag it displayed every time a different language.
1.
I rewrite the /sideboxes/my_template/banner_box.php to
PHP Code:
$banner_box_group= SHOW_BANNERS_GROUP_SET7 . $_SESSION['languages_id'];
2.
I changed in the layout settings for:
Banner Display Groups - Side Box banner_box, to: mybanner1:mybanner2:mybanner3
3. For every language I set the banner to different group.
For english to: mybanner1 , for italian to: mybanner2, for slovene to: mybanner3
What I'm doing wrong?
Thank's for your help!
-
Re: multi lingual banners
I need that for the english language only the english banner version appears. And so on for the other language.
Right now, when I access to the english language it appears one time the italian banner version, one time the slovenian....
I hope I explain my situation.
Thank's for your help!
-
Re: multi lingual banners
hello I did and it worked very well but I can not make me work for bannersAll. has anyone tried it?
-
Re: multi lingual banners
Can't get this to work for me.
I have 2 flashbanners. One in dutch and one in english.
Created 2 banners (betaal veilig, pay secure). I attached each banner to a new group I created, paysecure1 and paysecure2.
I changed Configuration->Layout Settings->Banner Display Groups - Side Box banner_box to SideBox-Banners:paysecure1:paysecure2
I changes the following line in /includes/modules/sideboxes/banner_box.php:
$banner_box_group= SHOW_BANNERS_GROUP_SET7;
to
$banner_box_group= SHOW_BANNERS_GROUP_SET7 . $_SESSION['languages_id'];
This doesn't work for me. I also don't understand how this could work :(
-
Re: multi lingual banners
Quote:
Originally Posted by
ferid
Can't get this to work for me.
I have 2 flashbanners. One in dutch and one in english.
Created 2 banners (betaal veilig, pay secure). I attached each banner to a new group I created, paysecure1 and paysecure2.
I changed Configuration->Layout Settings->Banner Display Groups - Side Box banner_box to SideBox-Banners:paysecure1:paysecure2
I changes the following line in /includes/modules/sideboxes/banner_box.php:
$banner_box_group= SHOW_BANNERS_GROUP_SET7;
to
$banner_box_group= SHOW_BANNERS_GROUP_SET7 . $_SESSION['languages_id'];
This doesn't work for me. I also don't understand how this could work :(
Thats right! How should the shopping cart know: is now fred1 assigned to German or English language
Have searched a lot for this without results :(
The only thing i could find was a turtorial for template monster multi language banner
info.template-help.com/files/eoc/oscommerce/th/04_how_to_define_a_different_banner_per_language.htm
-
Re: multi lingual banners
Same issue for me... How could the language know which banner to get?
Really need help with this, I followed this tutorial and read it 4-5 times, but dont get any wiser.
What are we missing?
-
Re: multi lingual banners
OK, been working on this for a few hours :frusty: until i realised how simple it is... I wanted my header's Wide-Banners to be multi-lingual.
So, for all those still looking for the answer, here we go:
1. Locate your tpl_header.php file and find this line:
Code:
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))
and replace it with
Code:
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2 . $_SESSION['languages_id']))
2. Go to Configuration->Layout Settings and change Banner Display Groups - Header Position 2 to show Wide-Banners (write that in the field)
3. Go to Tools->Banner Manager. Edit your banner and manually assign it to banner group Wide-Banners1. Notice the number 1 - this number represents your language id. Therefore, if you have english (1), german (2) etc, Wide-Banners1 will show when english language is selected and Wide-Banners2 when german is selected. Note: language ids are related to your installed languages, not a general code - if you don't know what id you want to use, simply try different numbers 1,2,3,4,5...
And that's it! If you want to use it on a different position, change the GROUP_SET number accordingly.
Could it be any easier? :smile:
This also works with Flash banners (if you previously set up Flash to run). If you want a Flash banner, use the HTML banner version...
All thanks go to Ajeh!
-
Re: multi lingual banners
thank you for your modification, but it is not always working as it should.
When i refresh the page it sometimes loads the wrong banner. Do ou have this problem as well?
-
Re: multi lingual banners
after running some more tests, it seems like it is using the different language banners randomly and not by the languagenumber ID
-
Re: multi lingual banners
Well, I'm very new to Zen Cart but I did it in a different way and it seems to work fine.
My site is in English and Greek. I installed the Greek language pack and now have two header.php files:
/includes/languages/english/my_template/header.php
/includes/languages/greek/my_template/header.php
I created two banners, placed them in /includes/templates/my_template/images and named them logo_english.gif and logo_greek.gif.
In the /includes/languages/english/my_template/header.php file I changed the line
define('HEADER_LOGO_IMAGE', 'logo.gif'); to
define('HEADER_LOGO_IMAGE', 'logo_english.gif');
and in the /includes/languages/greek/my_template/header.php file I changed the line
define('HEADER_LOGO_IMAGE', 'logo.gif'); to
define('HEADER_LOGO_IMAGE', 'logo_greek.gif');
That was all. You can see it in action at http://athenscollectibles.info (the text on the right side of the logo changes with the language).
As I said at the beginning, I'm very new to Zen Cart and I'm still not confident. If one of the many experts reads this, I would appreciate an advice if this was correctly done or whether I should expect something nasty to happen.
-
Re: multi lingual banners
What you did has nothing to do with banners. You just changed your logo image.
Under Admin, you can go to your Tools->Banner Manager to see what banners are about. :smile:
-
Re: multi lingual banners
:oops: Thank you Balihr, that was really my intention. Being new at Zen Cart, I thought that this was the discussion about. Where I come from (an ecommerce hosting site), we called the top logo "banner".
Now I see that banners in Zen Cart are something different. I have already used the Tools > Banner Manager to get rid of the advertising banners appearing at the bottom of the page when I installed Zen Cart. Obviously, I need to do a lot more reading! :bangin:
Your understanding will be much appreciated. :rolleyes:
-
Re: multi lingual banners
I don't know what is wrong, but I can't receive banner for second language.
OK, been working on this for a few hours until i realised how simple it is... I wanted my header's Wide-Banners to be multi-lingual.
What I did:
1. Changed tpl_header.php file for my template
/public_html/includes/templates/my_template/common/tpl_header.php
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))
was changed to
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2 . $_SESSION['languages_id']))
2. Go to Configuration->Layout Settings and changed Banner Display Groups - Header Position 2 to
"Wide-Banners:Wide-Banners1:Wide-Banners10" ( I have 2 language_id, which is 1 and 10).
3. Go to Tools->Banner Manager. Manually assigned name banner group Wide-Banners1 and Wide-Banners10
Nothing happening. Site still show only banner for language_id 1.
-
Re: multi lingual banners
Quote:
Originally Posted by
vadimzven
2. Go to Configuration->Layout Settings and changed Banner Display Groups - Header Position 2 to
"Wide-Banners:Wide-Banners1:Wide-Banners10" ( I have 2 language_id, which is 1 and 10).
No! Set this field to Wide-Banners - don't add any numbers or anything.
Quote:
3. Go to Tools->Banner Manager. Manually assigned name banner group Wide-Banners1 and Wide-Banners10
Nothing happening. Site still show only banner for language_id 1.
How do you know your language_id is 1 and 10? How did you determine the ids? Maybe a silly question, but humor me... :smile:
-
Re: multi lingual banners
I found language_id in MySQL database.
-
Re: multi lingual banners
I got it. Thank you very much.
-
Re: multi lingual banners
Thank you for letting us now you got it.
However, for the benefit of those who might do the same mistake as you did, it would be nice if you told us what you did wrong in the first place... :smile:
-
Re: multi lingual banners
Yes! I've been waiting for a continuation on this thread for a while.. I have my banners in place and working only they do the whole random thing discussed here earlier so I disenabled them and I'm currently only using english but could you please specify, where to put the language id no? What script and whhere, please be as precise as possible with paths / aswell!
Thanks a lot in advance..
-
Re: multi lingual banners
Well, all the instructions you need are on the previous page... :smile:
I described it step by step here so take a look.
Language ID numbers are assigned automatically by ZenCart. You can take a look in your database to determine the ids, but you only need it for defining banner group under Banner Management.
Good luck and let us know if you got it running!
-
Re: multi lingual banners
Thanks for the response!
Yes I did follow the instructions and the banners are working except like someone else pointed out, it only works randomly so, once it's right, load page again and a banner from another language rolls and load again it's back again, load again it's the third language and.. you get it.. so there has to be a bug in that script or another way to write so that it gets it right each time, don't there? Don't want to confuse the customers..
Thanks again.. I'll wait for a response,,
-
Re: multi lingual banners
I'm sure you missed something...
Can you provide the site URL? It might help...
-
Re: multi lingual banners
Well I actually deactivated the other banners except the english ones, have them in spanish and swedish aswell.
I'll activate them again for a while so you can see for yourself..
http://www.bodymindelements.com
Thanks!
-
Re: multi lingual banners
OK, go to your includes/templates/premium7b/common/tpl_header.php
Follow steps 1 & 2 from my previous post.
Go to phpMyAdmin and locate languages table on the left. When you click on it, you will see a table on the right with language ids shown.
Now, go to step 3 from my post.
This really should work - I used it on several sites so far and never had any problems.
BTW, are you talking about the Flash banner or the one bellow Flash?
Added: just an advice - install Image Handler 2 asap. :smile:
-
Re: multi lingual banners
Ok, thanks for the quick response and extra tip! I'll let you know how it went! :smile:
-
Re: multi lingual banners
Sorry, also it actually revolves both but only actived the flash banner right now..
-
Re: multi lingual banners
All right, back to normal again.. would you like to share the phpmyadmin id's cause I couldn't find them.. thanks
-
Re: multi lingual banners
what do you mean by "share phpmyadmin ids" ??? these ids are unique to your install... And I don't understand why you couldn't find the ids??? Can you access your database from phpmyadmin?
-
Re: multi lingual banners
Maybe somebody knows, how to show different product images depending from language? Thanks.
-
Re: multi lingual banners
Quote:
Originally Posted by
clydejones
goto
admin -> tools -> banner manager
click the "new banner" button
enter your Banner Title:
enter your Banner URL:
create your new Banner Group: (do this by entering the information in the text box which is below the dropdown menu.
for your english language version name it mybanner1
for your other language version name it mybanner2
click the insert button to save your new banner.
goto
admin -> configuration -> layout settings -> Banner Display Groups - Side Box banner_box
click the edit button
enter your new banner group designations in the text box
SideBox-Banners:mybanner1:mybanner2
click the update button
follow the instructions provided at the beginning of this thread in order to change the appropriate sidebox.
In my case for making my main banner changeable the only thing I need to do is to set Multiple Banner Group:
Banner Display Groups - Header Position 2 to Wide-Banners2:Wide-Banners3
...that is it !!! nothing else.. no need of replacing:
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))
with:
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2 . $_SESSION['languages_id']))
...but I still have a problem with making it compatible with the language selected. If I klick few time the english flag it displayed almost every time a different language...
somebody needs to explain clearly step by step how to fix it, PLEASE !!! :blink:
Thank you in advance!!!
-
Re: multi lingual banners
In my case for making my main banner changeable the only thing I need to do is to set Multiple Banner Group:
Banner Display Groups - Header Position 2 to Wide-Banners2:Wide-Banners3
...that is it !!! nothing else.. no need of replacing:
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))
with:
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2 . $_SESSION['languages_id']))
...but I still have a problem with making it compatible with the language selected. If I klick few time the english flag it displayed almost every time a different language...
somebody needs to explain clearly step by step how to fix it, PLEASE !!! :blink:
Thank you in advance!!!
-
Re: multi lingual banners
I followed all instructions in this thread, no success. Still getting different language banners randomly and not ordered on language id.
Can someone post the right solution for this, because i think many people have this problem and dont know how to fix this.
Thanks in advance!
-
Re: multi lingual banners
For me it did not work either. Would it be possible to show the steps with screenprints?
This would be very helpful.
Thanks in advance!
-
Re: multi lingual banners
After strugling for over 2 hours with the convoluted suggestions for multilingual banners I think I got a better solution:
In my English/Spanish site:
Assign includes/modules/your_template/banner_box.php to language 1 (English by Default) by changing the following code:
// test if box should display
$show_banner_box = true;
to
// test if box should display
if ($_SESSION['languages_id'] == 1) {
$show_banner_box = true;
}
then do the same for banner_box2.php but now
// test if box should display
if ($_SESSION['languages_id'] == 2) {
$show_banner_box = true;
}
Now in Banner Manager Assign your english banners to SideBox-Banners
Leave Layout Banner Display Group Side box banner_box as SideBox-Banners (the default)
Change:
Layout Banner Display Group Side box banner_box2 to WHATEVER
In Banner Manager assign your new banners with language id 2 to the same WHATEVER name you assign to banner_box2 in Layout.
Good luck
-
Re: multi lingual banners
:clap:
Quote:
Originally Posted by
27gerd27
Hi,
i made your changes in the php-file, but what i have to do with fred1, fred2?
Could you be so kind and give me any hint?
Thank you very match
Gerd
See post #48 in this thread, I think I found an easier method to display multilingual banners.
Good luck!
-
Re: multi lingual banners
That will work fine for two languages, but not for more.
Balihr's directions in post 22 are the correct answer, if followed exactly. I reproduce them here, with red highlighting on the points that people seem to be missing:
I wanted my header's Wide-Banners to be multi-lingual.
So, for all those still looking for the answer, here we go:
1. Locate your tpl_header.php file and find this line:
Code:
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))
and replace it with
Code:
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2 . $_SESSION['languages_id']))
2. Go to Configuration->Layout Settings and change Banner Display Groups - Header Position 2 to show Wide-Banners (write that in the field)
3. Go to Tools->Banner Manager. Edit your banner for your first language and manually assign it to banner group Wide-Banners1. Edit your banner for your second language and manually assign it to banner group Wide-Banners2. Notice the number 1 - this number represents your language id. Therefore, if you have english (1), german (2) etc, Wide-Banners1 will show when english language is selected and Wide-Banners2 when german is selected. Note: language ids are related to your installed languages, not a general code - if you don't know what id you want to use, simply try different numbers 1,2,3,4,5...
And that's it! If you want to use it on a different position, change the GROUP_SET number accordingly.
Could it be any easier?
This also works with Flash banners (if you previously set up Flash to run). If you want a Flash banner, use the HTML banner version...
All thanks go to Ajeh!
(end of balihr's instructions)
-
Re: multi lingual banners
thanks!
on my site it works fine for one banner!
but i have three!
Banner Display Groups - Header Position 1 banner-1
Banner Display Groups - Header Position 2 banner-2
Banner Display Groups - Header Position 3 Wide-Banners (now called)
so i have tested out different ways, but with no success.
when i am doing the same steps with the other banners they are mixed.
any suggestions?
thanks.
-
Re: multi lingual banners
i think it could be very helpful for all users, so does anyone have the answer?
-
Re: multi lingual banners
problem solved.
the same staps works sure also for three banners!
:clap:
-
Re: multi lingual banners
damn, i don't know what has happenend, but i have a new problem with my three multilanguage-banners.
everything worked fine, but when i am now in the english version of my shop, only the banners in the middle and right are fine, the left banner is smaller then the others!
when i am in the german version all three german banners are too small! where is the problem???
i have checked the tpl_header.php, the bannermanager and the layout settings, but havent found anything...
can anyone help please???
here are my settings:
layout settings:
Banner Display Groups - Header Position 1 Links-Banners
Banner Display Groups - Header Position 2 Mitte-Banners
Banner Display Groups - Header Position 3 Wide-Banners
bannergroups:
Links-Banners4
Links-Banners1
Wide-Banners1
Mitte-Banners1
Mitte-Banners4
Wide-Banners4
and here the part of the tpl_header.php:
<div class="banners">
<!-- BOF- BANNER #1 display -->
<?php
if (SHOW_BANNERS_GROUP_SET1 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1 . $_SESSION['languages_id']))
{
if ($banner->RecordCount() > 0) {
?>
<div id="bannerOne"><?php echo zen_display_banner('static', $banner); ?></div>
<?php
}
}
?>
<!-- EOF- BANNER #1 display -->
<!-- BOF- BANNER #2 display -->
<?php
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2 . $_SESSION['languages_id']))
{
if ($banner->RecordCount() > 0) {
?>
<div id="bannerTwo"><?php echo zen_display_banner('static', $banner);?></div>
<?php
}
}
?>
<!-- EOF- BANNER #2 display -->
<!-- BOF- BANNER #3 display -->
<?php
if (SHOW_BANNERS_GROUP_SET3 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET3 . $_SESSION['languages_id']))
{
if ($banner->RecordCount() > 0) {
?>
<div id="bannerThree"><?php echo zen_display_banner('static', $banner);?></div>
<?php
}
}
?>
<!-- EOF- BANNER #3 display -->
</div>
<?php
if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) {
if (HEADER_SALES_TEXT != '') {
?>
<div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
<?php
}
}
?>
-
Re: multi lingual banners
Quote:
Originally Posted by
gjh42
That will work fine for two languages, but not for more.
Balihr's directions in post 22 are the correct answer, if followed exactly. I reproduce them here, with red highlighting on the points that people seem to be missing:
All thanks go to Ajeh!
(end of balihr's instructions)
Hi I am looking for having multilingual banner in the side boxes.
Therefore coupling the above concept I mod the tpl_banner_box_all.php and set the layout to show in side banner box all, the group bannersAll.
Code:
$banner_cnt = 0;
while (!$banners_all->EOF) {
$banner_cnt++;
$banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET_ALL . $_SESSION['languages_id']);
$content .= zen_display_banner('static', $banners_all->fields['banners_id'] . $_SESSION['languages_id']);
I found in the db the languages id of my languages that are 2 for italian and 4 for english. I then assigned the localized banners to bannersAll2 and bannersAll4 but, unfortunately the result is no banners shown!
I am stuck now, because my knowledge is limited.
Can someone help?
Thanks
Enzo
-
Re: multi lingual banners
Hi all zenners;
I´m trying to display banners, according to language as it its a essencial feature for a multilanguage ecommerce, and i´m not getting the expected results.
I did exactly as zen cart forum instructions on post 22 on this thread.
I edited the tpl_header.php under the template_default, and not my template32900 root, as no such code appeared on 32900. Could this be the problem?
I emailed my tech help and this was the answer;
Please note that the template that you are using (template32900) might not be compatible with the changes that you wish to apply. However, we are sorry to inform you that this is not a hosting-related issue and the best option for you is to contact a local web developer as he might be able to help you fixing this issue. You can also contact the template's developers as they might be able to assist you further with editing their product.
Any idea if this template is compatible?
Thanks in advance
-
Re: multi lingual banners
As you have a Template Monster template, the answer is "probably not". TM is known for disabling stock Zen Cart functionality if they think you don't need it for their template layout.
Quote:
I edited the tpl_header.php under the template_default, and not my template32900 root, as no such code appeared on 32900. Could this be the problem?
This will definitely not work. When there is a custom template version of a /template_default/ file, that will be used and the default version ignored.
-
Re: multi lingual banners
I have this problem, when i have this on mytpl_header
<?php
if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) {
if (HEADER_SALES_TEXT != '') {
?>
if i add the language id ..... not show nothing in my website !!
why?
-
Re: multi lingual banners
Quote:
Originally Posted by
wookie
I have this problem, when i have this on mytpl_header
<?php
if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) {
if (HEADER_SALES_TEXT != '') {
?>
if i add the language id ..... not show nothing in my website !!
why?
Are you getting a blank page or you're not seeing any banners?
-
Re: multi lingual banners
Hi there,
I've followed the steps listed in post #22
and it works fine,
But I've got 4 banners in a row and as you can see on my site here
the second one doesn't show, it copies the first one. If I activate the 4 of them they will be all same as the first one.
I think it is because in configuration/layout settings I put 4 times wide-banners, but how else could I name them. If I try to number them there it doesn't work!
Any idea how to solve this?
Thanks
-
Re: multi lingual banners
Quote:
Originally Posted by
cinziapdl
Hi there,
I've followed the steps listed in post
#22
and it works fine,
But I've got 4 banners in a row and as you can see on my site
here
the second one doesn't show, it copies the first one. If I activate the 4 of them they will be all same as the first one.
I think it is because in configuration/layout settings I put 4 times wide-banners, but how else could I name them. If I try to number them there it doesn't work!
Any idea how to solve this?
Thanks
Make the appropriate settings under Configuration->Layout Setting.
Banner Display Groups - Header Position 1 = Banner1
Banner Display Groups - Header Position 2 = Banner2
Banner Display Groups - Header Position 3 = Banner3
etc.
Now, I can see your first and second banner are using Header Position 2 and header Position 3.
Do the following:
Banner Display Groups - Header Position 2 = Left
Banner Display Groups - Header Position 3 = MidLeft
Go to Banner Manager and set your first banner to group Left1 (Left2, Left3 - depending on your language IDs)
Next, set your second banner to group MidLeft1 (MidLeft2, Midleft3...)
That should do the trick.
-
Re: multi lingual banners
Quote:
Originally Posted by
balihr
Make the appropriate settings under Configuration->Layout Setting.
Banner Display Groups - Header Position 1 = Banner1
Banner Display Groups - Header Position 2 = Banner2
Banner Display Groups - Header Position 3 = Banner3
etc.
Now, I can see your first and second banner are using Header Position 2 and header Position 3.
Do the following:
Banner Display Groups - Header Position 2 = Left
Banner Display Groups - Header Position 3 = MidLeft
Go to Banner Manager and set your first banner to group Left1 (Left2, Left3 - depending on your language IDs)
Next, set your second banner to group MidLeft1 (MidLeft2, Midleft3...)
That should do the trick.
Thanks Balihr! It works perfectly!
I guessed the other 2 Right and MidRight and it works...
I just can't guess Header Position 1
(the one at the top)
But thanks so much for your help!!!!
-
Re: multi lingual banners
Quote:
Originally Posted by
cinziapdl
I just can't guess Header Position 1
(the one at the top)
The slideshow? That's not controlled as banners, in your case it's hard-coded and not controlled via admin so the code we used here can't be used.
However, you can use
PHP Code:
<?php if ($_SESSION['languages_id']==1) {
//your lang-1 slider here
}
and so on for each language... :smile:
-
Re: multi lingual banners
Thanks Balihr, too advanced for me, I'll leave it in one language ;)
-
Re: multi lingual banners
Did you install the slider you now have by yourself? If so, just repeat that process for the other languages with balihr's if test wrapped around each one. (It can be done a bit more elegantly for multiple languages, but that will work fine.)
-
Re: multi lingual banners
Quote:
Originally Posted by
gjh42
Did you install the slider you now have by yourself? If so, just repeat that process for the other languages with balihr's if test wrapped around each one. (It can be done a bit more elegantly for multiple languages, but that will work fine.)
No, I did not install it myself. It came with the template. I can change the images from the backoffice in Banner Manager, They are under Banner-1 that is why I thought I could manage different languages from there. I've tried to rename the header group to Wide-Banners in Config. Layout Settings and in Banner Manager Wide-Banners1, Wide-Banners2. But it doesn't work. the images disappear.
So i probably need to add some code next to the slider code, I will try Balihr suggestion and see what happens.
Thanks guys.
-
Re: multi lingual banners
Quote:
It came with the template. I can change the images from the backoffice in Banner Manager, ... But it doesn't work. the images disappear.
Template Monster apparently hacked into the admin function and appropriated some of it for their slider, so there is no telling exactly what it will take to use it for multiple languages. You can easily duplicate the slider code inside if() tests, but you will probably need to change some bit of code inside the duplicated slider to reference the different banner groups. We can't help with that because we don't know what they did.
-
Re: multi lingual banners
Quote:
Originally Posted by
gjh42
Template Monster apparently hacked into the admin function...(CUT) ...we don't know what they did.
Gotta luv that TemplateMonster... :P And the best part is, they could have just as easily utilized the banner management system without any hacks and use it for the slider.
-
Re: multi lingual banners
Quote:
Originally Posted by
balihr
Gotta luv that TemplateMonster... :P And the best part is, they could have just as easily utilized the banner management system without any hacks and use it for the slider.
The only thing I am grateful to TM is the fact that they introduced me to ZenCart, I knew nothing about ecommerce before. Anyway...
This is the part of code where the slider appear, where exactly should I try to insert the code given above? My languages are Italian (id 2) Portuguese (id 6) and English (id 1).
Thanks for your help.
PHP Code:
<!-- ========== HEADER ========== -->
<?php
/* prepares and displays header output */
if (CUSTOMERS_APPROVAL_AUTHORIZATION == 1 && CUSTOMERS_AUTHORIZATION_HEADER_OFF == 'true' and ($_SESSION['customers_authorization'] != 0 or $_SESSION['customer_id'] == '')) {
$flag_disable_header = true;
}
require($template->get_template_dir('tpl_header.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_header.php');
?>
<!-- ============================ -->
<div class="wrapp">
<div class="main-width">
<?php
if($this_is_home_page){
?>
<div class="slider">
<div id="faded">
<div>
<?php
$new_banner_search = zen_build_banners_group(SHOW_BANNERS_GROUP_SET1);
// secure pages
switch ($request_type) {
case ('SSL'):
$my_banner_filter=" and banners_on_ssl= " . "1 ";
break;
case ('NONSSL'):
$my_banner_filter='';
break;
}
$sql = "select banners_id from " . TABLE_BANNERS . " where status = 1 " . $new_banner_search . $my_banner_filter . " order by banners_sort_order";
$banners_all = $db->Execute($sql);
// if no active banner in the specified banner group then the box will not show
$banner_cnt = 0;
while (!$banners_all->EOF) {
$banner_cnt++;
$banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET1 . $_SESSION['languages_id']);
echo '<div>'.zen_display_banner('static', $banners_all->fields['banners_id']).'</div>';
// add spacing between banners
if ($banner_cnt < $banners_all->RecordCount()) {
}
$banners_all->MoveNext();
}
?>
</div>
</div>
</div>
<div class="bot-banners">
<!-- BOF- BANNER #2 display -->
<?php
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2 . $_SESSION['languages_id'])) {
if ($banner->RecordCount() > 0) {
?>
<div id="bannerTwo"><?php echo zen_display_banner('static', $banner);?></div>
<?php
}
}
?>
<!-- EOF- BANNER #2 display -->
-
Re: multi lingual banners
Quote:
Originally Posted by
balihr
OK, been working on this for a few hours :frusty: until i realised how simple it is... I wanted my header's Wide-Banners to be multi-lingual.
So, for all those still looking for the answer, here we go:
1. Locate your tpl_header.php file and find this line:
Code:
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))
and replace it with
Code:
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2 . $_SESSION['languages_id']))
2. Go to Configuration->Layout Settings and change Banner Display Groups - Header Position 2 to show Wide-Banners (write that in the field)
3. Go to Tools->Banner Manager. Edit your banner and manually assign it to banner group Wide-Banners1. Notice the number 1 - this number represents your language id. Therefore, if you have english (1), german (2) etc, Wide-Banners1 will show when english language is selected and Wide-Banners2 when german is selected. Note: language ids are related to your installed languages, not a general code - if you don't know what id you want to use, simply try different numbers 1,2,3,4,5...
And that's it! If you want to use it on a different position, change the GROUP_SET number accordingly.
Could it be any easier? :smile:
This also works with Flash banners (if you previously set up Flash to run). If you want a Flash banner, use the HTML banner version...
All thanks go to Ajeh!
also works great on 1.5.5, can it be done for banner boxes? thank you