Jump to content

Edit History

johnrobertson

johnrobertson

PS 1.6 - possibly solved
TB 1.10 - for drop down menus - SOLVED
... for me at least - with an answer on another forum about a free theme called Niara which might not work on PS1.6 but is pretty similar in the template.tpl file.

If the same area about select menus is different in a Prestashop 1.6 theme product.tpl file, you could use an online text comparison tool to find the important change between code snippets below, then guess where to put it in the file.

The theme also needs to have a javascript that reacts to non-existent products being displayed. This theme hides the order button when there's a non-existent product. Maybe other themes do. I doubt I can answer questions about it beyond that, but you can find the original post with a search engine and these scripts. Replace this bit of product.tpl with its long option value...

{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>
{elseif ($group.group_type == 'color')}

...with this replacement that has a shorter option value defined a line further up. It only works on drop-down menus but could probably be adapted.

{if ($group.group_type == 'select')}
  <select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="form-control attribute_select no-print">
    <option value="0" selected="selected" title="{l s='Choose'}">{l s='Choose'}</option>
    {foreach from=$group.attributes key=id_attribute item=group_attribute}
      <option value="{$id_attribute|intval}" title="{$group_attribute|escape:'html':'UTF-8'}">{$group_attribute|escape:'html':'UTF-8'}</option>
    {/foreach}
  </select>
{elseif ($group.group_type == 'color')}

The new attribute is called "choose", which makes sense and can be translated in the back office.

I transcribed this so you can find it with a search engine. Hope it helps someone else as much as it has helped me.

johnrobertson

johnrobertson

SOLVED - for me at least - with an answer on another forum about a free theme called Niara which might not work on PS1.6 but is pretty similar in the template.tpl file.

If the same area about select menus is different in a Prestashop 1.6 theme product.tpl file, you could use an online text comparison tool to find the important change between code snippets below, then guess where to put it.

The theme also needs to have a javascript that reacts to non-existent products being displayed. This theme hides the order button when there's a non-existent product. I doubt I can answer questions about it beyond that, but you can find the original post with a search engine and these scripts. Replace this bit of product.tpl with its long option value...

{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>
{elseif ($group.group_type == 'color')}

...with this replacement that has a shorter option value defined a line further up. It only works on drop-down menus but could probably be adapted.

{if ($group.group_type == 'select')}
  <select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="form-control attribute_select no-print">
    <option value="0" selected="selected" title="{l s='Choose'}">{l s='Choose'}</option>
    {foreach from=$group.attributes key=id_attribute item=group_attribute}
      <option value="{$id_attribute|intval}" title="{$group_attribute|escape:'html':'UTF-8'}">{$group_attribute|escape:'html':'UTF-8'}</option>
    {/foreach}
  </select>
{elseif ($group.group_type == 'color')}

The new attribute is called "choose", which makes sense and can be translated in the back office.

I transcribed this so you can find it with a search engine. Hope it helps someone else as much as it has helped me.

johnrobertson

johnrobertson

SOLVED - for me at least - from an answer on another forum
It's for a free theme called Niara which might not work on PS1.6 but is pretty similar in the template.tpl file. The theme also needs to have a javascript that reacts to non-existent products being displayed. This theme hides the order button when there's a non-existent product. I doubt I can answer questions about it beyond that, but you can find the original post with a search engine and these scripts. Replace this bit of product.tpl with its long option value...

{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>
{elseif ($group.group_type == 'color')}

...with this replacement that has a shorter option value defined a line further up. It only works on drop-down menus but could probably be adapted.

{if ($group.group_type == 'select')}
  <select name="{$groupName}" id="group_{$id_attribute_group|intval}" class="form-control attribute_select no-print">
    <option value="0" selected="selected" title="{l s='Choose'}">{l s='Choose'}</option>
    {foreach from=$group.attributes key=id_attribute item=group_attribute}
      <option value="{$id_attribute|intval}" title="{$group_attribute|escape:'html':'UTF-8'}">{$group_attribute|escape:'html':'UTF-8'}</option>
    {/foreach}
  </select>
{elseif ($group.group_type == 'color')}

The new attribute is called "choose", which makes sense and can be translated in the back office.

I transcribed this so you can find it with a search engine. Hope it helps someone else as much as it has helped me.

×
×
  • Create New...