walidon Posted May 15, 2014 Share Posted May 15, 2014 (edited) Hi, I want to add a link in front of the word "sizes" so that if the customers want to know the size they click on that link which will lead them a cms page that I created containing all the sizes in cm here is the image att1: size.jpg and make it like this att2; sizess.jpg Please bear in mind that I have 3 languages, so I want that depending on the language! Update: of course the size is an attribute. Thank you very much in advance.. Walid Edited May 17, 2014 by walidon (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 15, 2014 Share Posted May 15, 2014 you can use code: <a href="{$Link->getCMSLink($cms,null,null,$id_lang)}">{l s='sizes'}</a> where the $cms is an ID of cms page and $id_lang is an ID of language 1 Link to comment Share on other sites More sharing options...
Whispar1 Posted May 15, 2014 Share Posted May 15, 2014 (edited) I am not sure if this will work the way you want but I also have a similar setup with my shop. For me, I added the sizing file as an attachment. Clicking this opens a cms page with the sizing information. See example of this here: http://www.whispardesign.com/duvet-bedding/17-belgravia-duvet-set-white Another options is to imbed a link in your product.tpl file but know that it will be there for all products, not just products that have sizes. EDIT. I like Vekia's idea better - he posted before I could post Edited May 15, 2014 by Whispar1 (see edit history) 1 Link to comment Share on other sites More sharing options...
vekia Posted May 15, 2014 Share Posted May 15, 2014 i think that ideal solution is a nice fancybox popup with CMS page contents Link to comment Share on other sites More sharing options...
walidon Posted May 15, 2014 Author Share Posted May 15, 2014 i think that ideal solution is a nice fancybox popup with CMS page contents Thank you Vekia Where shall I put the code? in product-list.tpl in themes/mytheme? and should I replace something in the code? how can the cms link be recognized and according to the language! it has been two days without succeeding:) it turned my head up/down! what is the story of the fancybox? how it can be achieved? In worse case if i didn't succeed can I upload the file which you will tell me to put the code in, in case i failed:) what is the story of Link to comment Share on other sites More sharing options...
walidon Posted May 15, 2014 Author Share Posted May 15, 2014 I am not sure if this will work the way you want but I also have a similar setup with my shop. For me, I added the sizing file as an attachment. Clicking this opens a cms page with the sizing information. See example of this here: http://www.whispardesign.com/duvet-bedding/17-belgravia-duvet-set-white Another options is to imbed a link in your product.tpl file but know that it will be there for all products, not just products that have sizes. EDIT. I like Vekia's idea better - he posted before I could post thank you. Yes what I want is similar to yours, just I want the link as mentioned in the picture! how can i link that to the size? in my product-list.tpl i can't find the path to the size or something similar:) Link to comment Share on other sites More sharing options...
walidon Posted May 17, 2014 Author Share Posted May 17, 2014 any help please? Thank you Link to comment Share on other sites More sharing options...
vekia Posted May 17, 2014 Share Posted May 17, 2014 Thank you Vekia Where shall I put the code? in product-list.tpl in themes/mytheme? and should I replace something in the code? how can the cms link be recognized and according to the language! it has been two days without succeeding:) it turned my head up/down! you have to use this code in tpl file. if you want to display it on product listing page - use it in product-list.tpl file. don't worry about language - code will create proper link automatically. Link to comment Share on other sites More sharing options...
walidon Posted May 17, 2014 Author Share Posted May 17, 2014 here is the attributes part of the product.tpl <div class="product_attributes"> {if isset($groups)} <!-- attributes --> <div id="attributes"> {foreach from=$groups key=id_attribute_group item=group} {if $group.attributes|@count} <fieldset class="attribute_fieldset"> <label class="attribute_label" for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label> {assign var="groupName" value="group_$id_attribute_group"} <div class="attribute_list"> {if ($group.group_type == 'select')} <select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="attribute_select" onchange="findCombination();getProductAttribute();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if};"> {foreach from=$group.attributes key=id_attribute item=group_attribute} <option value="{$id_attribute|intval}"{if (isset($smarty.get.$groupName) && $smarty.get.$groupName|intval == $id_attribute) || $group.default == $id_attribute} selected="selected"{/if} title="{$group_attribute|escape:'htmlall':'UTF-8'}">{$group_attribute|escape:'htmlall':'UTF-8'}</option> {/foreach} </select> {elseif ($group.group_type == 'color')} <ul id="color_to_pick_list" class="clearfix"> {assign var="default_colorpicker" value=""} {foreach from=$group.attributes key=id_attribute item=group_attribute} <li{if $group.default == $id_attribute} class="selected"{/if}> <a id="color_{$id_attribute|intval}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}" style="background: {$colors.$id_attribute.value};" title="{$colors.$id_attribute.name}" onclick="colorPickerClick(this);getProductAttribute();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if}"> {if file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')} <img src="{$img_col_dir}{$id_attribute}.jpg" alt="{$colors.$id_attribute.name}" width="20" height="20" /><br> {/if} </a> </li> {if ($group.default == $id_attribute)} {$default_colorpicker = $id_attribute} {/if} {/foreach} </ul> <input type="hidden" class="color_pick_hidden" name="{$groupName}" value="{$default_colorpicker}" /> {elseif ($group.group_type == 'radio')} {foreach from=$group.attributes key=id_attribute item=group_attribute} <input type="radio" class="attribute_radio" name="{$groupName}" value="{$id_attribute}" {if ($group.default == $id_attribute)} checked="checked"{/if} onclick="findCombination();getProductAttribute();{if $colors|@count > 0}$('#wrapResetImages').show('slow');{/if}"> {$group_attribute|escape:'htmlall':'UTF-8'}<br/> {/foreach} {/if} </div> </fieldset> {/if} {/foreach} </div> where shall I put it? or shall I replicate something for the attribute sizes! Link to comment Share on other sites More sharing options...
vekia Posted May 17, 2014 Share Posted May 17, 2014 but i have no idea where you want to display it, so... where exactly? Link to comment Share on other sites More sharing options...
walidon Posted May 18, 2014 Author Share Posted May 18, 2014 (edited) I have an attribute called sizes. in my website i have this: label class="attribute_label" for="group_3">Sizes :</label> where 3 is the ID of the attributes "sizes". I tried to make a special code for it but didn't work. there is a solution that can be elaborated here: http://www.prestashop.com/forums/topic/240356-solved-show-text-link-when-selected-attributes/ it works for the selector with this code, $('div#attributes select').change(function(){ if($(this).val() == 6) { alert('I am an alert box!'); } }); which is added to product.js. so maybe that will give you more idea:) and sorry for bothering and thank you for your help Edited May 18, 2014 by walidon (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 18, 2014 Share Posted May 18, 2014 sorry i missed images that you attached. change code: <label class="attribute_label" {if $group.group_type != 'color' && $group.group_type != 'radio'}for="group_{$id_attribute_group|intval}"{/if}>{$group.name|escape:'html':'UTF-8'} : </label> to: <label class="attribute_label" {if $group.group_type != 'color' && $group.group_type != 'radio'}for="group_{$id_attribute_group|intval}"{/if}>{$group.name|escape:'html':'UTF-8'} : {if $group.name=="Size"}(<a class="iframe" href="{$link->getCMSLink(4)}">{l s='sizes'}</a>){/if}</label> note that i added there if condition to check what is the group name, so if your group name is "Sizes" change "size" to "Sizes" you can add there many conditions to support other languages: {if $group.name=="Size" || $group.name=="Rozmiar" } 1 Link to comment Share on other sites More sharing options...
walidon Posted May 18, 2014 Author Share Posted May 18, 2014 (edited) worked like a charm:) ouf.. just tw more things:) - it worked like a charm for the english version. now for french and german; how to change the name {l s='sizes'}; so that in german it becomes {l s='Grösse '} (grosse) and in french {l s='Mesures '} (mesures) 2. how to make the color blue of the sizes:) so it will appear like a link:) thank you is no enough, but it is the least I can say:) you saved my life:) Edited May 18, 2014 by walidon (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted May 18, 2014 Share Posted May 18, 2014 you dont have to use separate condition for each language, just use this: {if $group.name=="Size" || $group.name=="Grösse" || $group.name=="Mesures"}(<a class="iframe" href="{$link->getCMSLink(4)}">{l s='Grösse '}</a>){/if} Link to comment Share on other sites More sharing options...
walidon Posted May 18, 2014 Author Share Posted May 18, 2014 yes I did that... but it will be Grösse for all languages:) I want that the name Grösse too changes according to the language! Link to comment Share on other sites More sharing options...
vekia Posted May 18, 2014 Share Posted May 18, 2014 so just translate it? under localization > translations > front office translations it will work like other translations. Link to comment Share on other sites More sharing options...
Recommended Posts