Jump to content

When using colour picker, the drop down to be removed!!!


robkwal

Recommended Posts

Hi all,

I would like to know if it is possible when using the colour picker, to remove/disable the drop down option for colour. It seems unnecessary/messy if the colour picker is in use. Would like to know your thoughts on how this can be achieved, and weather you could create a similar selector for size. Eventually removing the drop down menus completely, allowing for a better shopping experience allowing the web site to be more interactive?

Link to comment
Share on other sites

To hide the colour dropdown when the colour picker is activated, change the attributes section on line 236-253 (in PrestaShop v1.3.1) of product.tpl in your theme's directory from:

 

{if isset($groups)}
<!-- attributes -->
<div id="attributes">
{foreach from=$groups key=id_attribute_group item=group}
<p>
   <label for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label>
   {assign var='groupName' value='group_'|cat:$id_attribute_group}
   <select name="{$groupName}" id="group_{$id_attribute_group|intval}"> 0}$('#resetImages').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>
</p>
{/foreach}
</div>
{/if}

 

to:

 

{if isset($groups)}
<!-- attributes -->
<div id="attributes">
{foreach from=$groups key=id_attribute_group item=group}
   <p{if $id_attribute_group == $product->id_color_default} class="hidden"{/if}>
   <label for="group_{$id_attribute_group|intval}">{$group.name|escape:'htmlall':'UTF-8'} :</label>
   {assign var='groupName' value='group_'|cat:$id_attribute_group}
   <select name="{$groupName}" id="group_{$id_attribute_group|intval}"> 0}$('#resetImages').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>
</p>
{/foreach}
</div>
{/if}

Link to comment
Share on other sites

  • 4 months later...
Helpful as ever... Any ideas on how to get the available colours to appear within the product list, to notify the customers there is more that one colour available?


Did you find the way to do it? there is the same question on the French forum

thanks in advance !

Edit: have a look at the link above, they explain how to do.
Link to comment
Share on other sites

  • 1 year later...
  • 1 month later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...