Jump to content

Adding a link to product list page


Recommended Posts

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


post-723372-0-04375700-1400174372_thumb.jpg

post-723372-0-55128000-1400174372_thumb.jpg

Edited by walidon (see edit history)
Link to comment
Share on other sites

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 by Whispar1 (see edit history)
  • Like 1
Link to comment
Share on other sites

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

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

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

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

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 by walidon (see edit history)
Link to comment
Share on other sites

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" }

  • Like 1
Link to comment
Share on other sites

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 by walidon (see edit history)
Link to comment
Share on other sites

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

×
×
  • Create New...