What's New
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic.
Ok fixed it by changing file /modules/stattributelist/views/templates/hook/front.tpl
From:
{if isset($st_att_list_groups)}
<div class="st_attr_list_container {if $st_att_list_center} st_attr_list_text_center{/if}">
{foreach from=$st_att_list_groups key=id_attribute_group item=group}
{if $group.attributes|@count && ($st_att_list_show==1 || array_sum($group.attributes_quantity)>0)}
<div class="st_attr_list_item">
<strong>{$group.name} :</strong>
{if ($group.group_type == 'color' && $st_att_list_color)}
{foreach from=$group.attributes key=id_attribute item=group_attribute}
{if $st_att_list_show==1 || $group.attributes_quantity[$id_attribute]>0}
<span class="st_attr_list_swatch" title="{$group_attribute}" style="{if $group.colors[$id_attribute]['type']}background-image: url('{$group.colors[$id_attribute]['value']}');{else}background-color:{$group.colors[$id_attribute]['value']};{/if}"></span>
{/if}
{/foreach}
{else}
{foreach from=$group.attributes key=id_attribute item=group_attribute}
{if $st_att_list_show==1 || $group.attributes_quantity[$id_attribute]>0}
<span class="st_attr_list_text">{$group_attribute}</span>
{/if}
{/foreach}
{/if}
</div>
{/if}
{/foreach}
</div>
{/if}
To:
{if isset($st_att_list_groups)}
<div class="st_attr_list_container {if $st_att_list_center} st_attr_list_text_center{/if}">
{foreach from=$st_att_list_groups key=id_attribute_group item=group}
{if $group.attributes|@count && ($st_att_list_show==1 || array_sum($group.attributes_quantity)>0)}
<div class="st_attr_list_item">
<strong>{$group.name} :</strong>
{foreach from=$group.attributes key=id_attribute item=attribute}
{if $st_att_list_show==1 || $group.attributes_quantity[$id_attribute]>0}
<span class="st_attr_list_text{$attribute.class}">{$attribute.name}</span>
{/if}
{/foreach}
</div>
{/if}
{/foreach}
</div>
{/if}
And file:
modules/stattributelist/stattributelist.php
Added line:
foreach ($groups as $group_id => $group) {
foreach ($group['attributes'] as $attribute_id => $attribute_name) {
$class = '';
if ($group['attributes_quantity'][$attribute_id] <= 0) {
$class = ' attribute-not-in-stock';
}
$groups[$group_id]['attributes'][$attribute_id] = array(
'name' => $attribute_name,
'class' => $class,
);
}
}
if (Tools::isEmpty($row['attribute_color']) && @filemtime(_PS_COL_IMG_DIR_.$row['id_attribute'].'.jpg')) {
$texture = $this->context->link->getMediaLink(_THEME_COL_DIR_.$row['id_attribute'].'.jpg');
}
$groups[$row['id_attribute_group']]['colors'][$row['id_attribute']] = array(
'type' => $texture ? 1 : 0,
'value' => $texture?:$row['attribute_color'],
);
}
}
!!! HERE ADDED LINE !!!
$this->context->smarty->assign(array(
'st_att_list_groups' => $groups,
'st_att_list_show' => $show,
'st_att_list_color' => Configuration::get($this->_prefix_st.'COLOR'),
'st_att_list_center' => Configuration::get($this->_prefix_st.'CENTER'),
You must be logged in to reply to this topic.