alexgm07 Posted July 5, 2014 Share Posted July 5, 2014 I want change the color-pick list when the product have atribbutes of color, for " Availabe on more colours" and link to the product. I think that I have to modify product-list-color.tpl, but I don't know how. <ul class="color_to_pick_list clearfix"> {foreach from=$colors_list item='color'} {assign var='img_color_exists' value=file_exists($col_img_dir|cat:$color.id_attribute|cat:'.jpg')} <li> <a href="{$link->getProductLink($color.id_product, null, null, null, null, null, $color.id_product_attribute)|escape:'html':'UTF-8'}" id="color_{$color.id_product_attribute|intval}" class="color_pick"{if !$img_color_exists && isset($color.color) && $color.color} style="background:{$color.color};"{/if}> {if $img_color_exists} <img src="{$img_col_dir}{$color.id_attribute|intval}.jpg" alt="{$color.name|escape:'html':'UTF-8'}" title="{$color.name|escape:'html':'UTF-8'}" width="20" height="20" /> {/if} </a> </li> {/foreach} </ul> Link to comment Share on other sites More sharing options...
PSfever.com Posted July 5, 2014 Share Posted July 5, 2014 Hi, could you give us link to your site? I don't have a site where I could test the attributes as you have them in your store. Link to comment Share on other sites More sharing options...
alexgm07 Posted July 5, 2014 Author Share Posted July 5, 2014 Hi, could you give us link to your site? I don't have a site where I could test the attributes as you have them in your store. sorry, www.fiorella.es Link to comment Share on other sites More sharing options...
PSfever.com Posted July 5, 2014 Share Posted July 5, 2014 Also, could you give me link precisely to where the "problem" is occuring? Link to comment Share on other sites More sharing options...
alexgm07 Posted July 5, 2014 Author Share Posted July 5, 2014 Not a problem as such, it is a modification. I would like to make Rather than display all the colors of the attributes, replace it with a text that reads "Available in more colors." I think that there must create a function that indicates if there are attributes of color, showing the link of the product. Like the photo. http://fiorella.es/12-Turbantes Link to comment Share on other sites More sharing options...
PSfever.com Posted July 6, 2014 Share Posted July 6, 2014 Ok, so you want to disable all the colors in the product-list view and replace it with a sentance that the product is "available in more colors"? Is that right? Link to comment Share on other sites More sharing options...
alexgm07 Posted July 6, 2014 Author Share Posted July 6, 2014 Exactly Link to comment Share on other sites More sharing options...
vekia Posted July 6, 2014 Share Posted July 6, 2014 so just instead of whole <ul></ul> code there inserty a text where you will inform about that {l s='available in more colors'} Link to comment Share on other sites More sharing options...
alexgm07 Posted July 6, 2014 Author Share Posted July 6, 2014 so just instead of whole <ul></ul> code there inserty a text where you will inform about that {l s='available in more colors'} The problem is then always would appear regardless if have color attributes right? Link to comment Share on other sites More sharing options...
PSfever.com Posted July 6, 2014 Share Posted July 6, 2014 The problem is then always would appear regardless if have color attributes right? No, there is a condition inside product-list.tpl that would only show the string if the product has colors. This <ul></ul> list that you have pasted only shows up, if there are colors combinations within your product. So as Vekia said, comment it out and add the string to the product-list-color.tpl file. It will in the end look like this: {* <ul class="color_to_pick_list clearfix"> {foreach from=$colors_list item='color'} <li> <a href="{$link->getProductLink($color.id_product, null, null, null, null, null, $color.id_product_attribute)|escape:'html':'UTF-8'}" id="color_{$color.id_product_attribute|intval}" class="color_pick" style="background: {$color.color};"> </a> </li> {/foreach} </ul> *} {l s='available in more colors'} Link to comment Share on other sites More sharing options...
vekia Posted July 6, 2014 Share Posted July 6, 2014 product-list-colors.tpl file is included to product-list.tpl file only if product has got color attribute Link to comment Share on other sites More sharing options...
alexgm07 Posted July 6, 2014 Author Share Posted July 6, 2014 Thank you very much to both. I am a newbie in this world, and I do not know a lot of things. Finally, I would like if possible, add to the text the link of the product. Link to comment Share on other sites More sharing options...
PSfever.com Posted July 6, 2014 Share Posted July 6, 2014 Thank you very much to both. I am a newbie in this world, and I do not know a lot of things. Finally, I would like if possible, add to the text the link of the product. Try this...leave out the entire product-list-color.tpl file as it is: <ul class="color_to_pick_list clearfix"> {foreach from=$colors_list item='color'} <li> <a href="{$link->getProductLink($color.id_product, null, null, null, null, null, $color.id_product_attribute)|escape:'html':'UTF-8'}" id="color_{$color.id_product_attribute|intval}" class="color_pick" style="background: {$color.color};"> </a> </li> {/foreach} </ul> in product-list.tpl change this {if isset($product.color_list)} <div class="color-list-container">{$product.color_list} </div> {/if} to this: {if isset($product.color_list)} {* <div class="color-list-container">{$product.color_list} </div> *} <a href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url"> {l s='available in more colors'} </a> {/if} Link to comment Share on other sites More sharing options...
alexgm07 Posted July 6, 2014 Author Share Posted July 6, 2014 Try this...leave out the entire product-list-color.tpl file as it is: <ul class="color_to_pick_list clearfix"> {foreach from=$colors_list item='color'} <li> <a href="{$link->getProductLink($color.id_product, null, null, null, null, null, $color.id_product_attribute)|escape:'html':'UTF-8'}" id="color_{$color.id_product_attribute|intval}" class="color_pick" style="background: {$color.color};"> </a> </li> {/foreach} </ul> in product-list.tpl change this {if isset($product.color_list)} <div class="color-list-container">{$product.color_list} </div> {/if} to this: {if isset($product.color_list)} {* <div class="color-list-container">{$product.color_list} </div> *} <a href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url"> {l s='available in more colors'} </a> {/if} I tried this, but now is in all products, whether or not color attributes Link to comment Share on other sites More sharing options...
PSfever.com Posted July 6, 2014 Share Posted July 6, 2014 I tried this, but now is in all products, whether or not color attributes Do you have the IF statement in place? It should not do this, as I've simply replaced the colours with this link. Nothing else. Link to comment Share on other sites More sharing options...
alexgm07 Posted July 6, 2014 Author Share Posted July 6, 2014 (edited) Do you have the IF statement in place? It should not do this, as I've simply replaced the colours with this link. Nothing else. {if isset($product.color_list)} {*<div class="color-list-container">{$product.color_list} </div>*} <a href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">{l s='available in more colors'} </a> {/if} <div class="product-flags"> That's how I got in product-list.tpl Edited July 6, 2014 by alexgm07 (see edit history) Link to comment Share on other sites More sharing options...
PSfever.com Posted July 6, 2014 Share Posted July 6, 2014 Are you sure that you're looking into a category, which contains products that do not have colours? Because I can't understand why it would show up... Link to comment Share on other sites More sharing options...
alexgm07 Posted July 6, 2014 Author Share Posted July 6, 2014 Are you sure that you're looking into a category, which contains products that do not have colours? Because I can't understand why it would show up... Yes, I'm sure. For example http://fiorella.es/14-Bolsos this is the category and the products don't have colours, if you click in one product, you can see. I don't understand because it's happen..Something I did wrong.. Link to comment Share on other sites More sharing options...
PSfever.com Posted July 6, 2014 Share Posted July 6, 2014 Yes, I'm sure. For example http://fiorella.es/14-Bolsos this is the category and the products don't have colours, if you click in one product, you can see. I don't understand because it's happen..Something I did wrong.. That's odd. Can you try commenting out the product-list-color.tpl file again and place this line of code in? <a href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">{l s='available in more colors'} </a> And make the product-list as it was before again. I am however not sure if the link is going to work or not. That's why I chose the other solution first. Link to comment Share on other sites More sharing options...
alexgm07 Posted July 6, 2014 Author Share Posted July 6, 2014 That's odd. Can you try commenting out the product-list-color.tpl file again and place this line of code in? <a href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">{l s='available in more colors'} </a> And make the product-list as it was before again. I am however not sure if the link is going to work or not. That's why I chose the other solution first. W That's odd. Can you try commenting out the product-list-color.tpl file again and place this line of code in? <a href="{$product.link|escape:'html':'UTF-8'}" title="{$product.name|escape:'html':'UTF-8'}" itemprop="url">{l s='available in more colors'} </a> And make the product-list as it was before again. I am however not sure if the link is going to work or not. That's why I chose the other solution first. The last option also I had tried, and fails in the link. Link to the category,not the product. Maybe, I have committed any error by placing the code above, if you want, I upload the files to check if it's my mistake, because I also think it is very strange.. Link to comment Share on other sites More sharing options...
PSfever.com Posted July 6, 2014 Share Posted July 6, 2014 W The last option also I had tried, and fails in the link. Link to the category,not the product. Maybe, I have committed any error by placing the code above, if you want, I upload the files to check if it's my mistake, because I also think it is very strange.. Well, that's what I was afraid of - it does not lead to category, it simply does not lead anywhere and it redirects you to the same page. The first plan was probably the best I could do under these conditions. Link to comment Share on other sites More sharing options...
alexgm07 Posted July 6, 2014 Author Share Posted July 6, 2014 Well, that's what I was afraid of - it does not lead to category, it simply does not lead anywhere and it redirects you to the same page. The first plan was probably the best I could do under these conditions. I'm going back to try the first option, with special care, to see if I can make it work. If don't work, I don't put the link Link to comment Share on other sites More sharing options...
PSfever.com Posted July 6, 2014 Share Posted July 6, 2014 I'm going back to try the first option, with special care, to see if I can make it work. If don't work, I don't put the link Ok, please let me know how it goes, I'd like to know if you manage to solve this problem. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now