dannikorsholm Posted December 13, 2016 Share Posted December 13, 2016 (edited) Isn't there a small change in the code that makes one can have color picker as a drop down list? so I have drop down list with texture picture and the text. Instead of the color picker ?? Regards Danni Edited December 13, 2016 by dannikorsholm (see edit history) Link to comment Share on other sites More sharing options...
dannikorsholm Posted December 19, 2016 Author Share Posted December 19, 2016 In product.tpl i found Drop down: {if ($group.group_type == 'select')} <select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="form-control attribute_select no-print"> {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:'html':'UTF-8'}">{$group_attribute|escape:'html':'UTF-8'}</option> {/foreach} </select> And color picker: {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} {assign var='img_color_exists' value=file_exists($col_img_dir|cat:$id_attribute|cat:'.jpg')} <li{if $group.default == $id_attribute} class="selected"{/if}> <a href="{$link->getProductLink($product)|escape:'html':'UTF-8'}" id="color_{$id_attribute|intval}" name="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" class="color_pick{if ($group.default == $id_attribute)} selected{/if}"{if !$img_color_exists && isset($colors.$id_attribute.value) && $colors.$id_attribute.value} style="background:{$colors.$id_attribute.value|escape:'html':'UTF-8'};"{/if} title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}"> {if $img_color_exists} <img src="{$img_col_dir}{$id_attribute|intval}.jpg" alt="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" title="{$colors.$id_attribute.name|escape:'html':'UTF-8'}" width="20" height="20" /> {/if} </a> </li> {if ($group.default == $id_attribute)} {$default_colorpicker = $id_attribute} {/if} {/foreach} </ul> <input type="hidden" class="color_pick_hidden" name="{$groupName|escape:'html':'UTF-8'}" value="{$default_colorpicker|intval}" /> But what to change in color picker to make it a drop down?? Regards Danni. Link to comment Share on other sites More sharing options...
Jignesh.aakoliya Posted December 19, 2016 Share Posted December 19, 2016 Hi,You must need to create new attribute with name color with type ofdropdown than it will show color as dropdown instead of color pickerfrom admin.you dont need to change anything from code.Thanks. Link to comment Share on other sites More sharing options...
dannikorsholm Posted December 19, 2016 Author Share Posted December 19, 2016 When i create a new attribute group and name it color then choose drop down or radio buttons i cant choose a color when i create a new attribute only text. Regards Danni. Link to comment Share on other sites More sharing options...
Holohugo Posted July 13, 2019 Share Posted July 13, 2019 On 12/19/2016 at 12:52 PM, dannikorsholm said: When i create a new attribute group and name it color then choose drop down or radio buttons i cant choose a color when i create a new attribute only text. Regards Danni. Have you ever solved this one? Looking for the same for a long time 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