Jump to content

Edit History

ps8modules

ps8modules

Oh, I wrote this from my mobile phone.

Now I'm at the computer and I'm giving you the example with multiple categories.

You can only leave one category there.

{block name='product_flags'}
    <ul class="product-flags js-product-flags">
        {if $page.page_name == 'category' && isset($category['id']) && in_array($category.id, ['3', '138'])}
            <li class="product-flag new">{l s='discountinued' d='Shop.Theme.Catalog'}</li>
        {else if in_array($page.page_name,['product', 'index']) && in_array($product.id_category_default, ['3', '138'])}
            <li class="product-flag new">{l s='discountinued' d='Shop.Theme.Catalog'}</li>
        {/if}
        {foreach from=$product.flags item=flag}
            <li class="product-flag {$flag.type}">{$flag.label}</li>
        {/foreach}
    </ul>
{/block}

 

In Home:

obrazek.thumb.png.3172033be5ec69e4eacb461fc2702f6b.png

 

In category:

obrazek.png.f8ce514ebbab14154e85602a3f23bf05.png

In product detail:

obrazek.png.bfaef89878d1cc8b91ed7e3cf8bffa39.png

ps8modules

ps8modules

Oh, I wrote this from my mobile phone.

Now I'm at the computer and I'm giving you the example with multiple categories.

You can only leave one category there.

{block name='product_flags'}
    <ul class="product-flags js-product-flags">
        {if $page.page_name == 'category' && isset($category['id']) && in_array($category.id, ['3', '138'])}
            <li class="product-flag new">{l s='discountinued' d='Shop.Theme.Catalog'}</li>
        {else if in_array($page.page_name,['product', 'index']) && in_array($product.id_category_default, ['3', '138'])}
            <li class="product-flag new">{l s='discountinued' d='Shop.Theme.Catalog'}</li>
        {/if}
        {foreach from=$product.flags item=flag}
            <li class="product-flag {$flag.type}">{$flag.label}</li>
        {/foreach}
    </ul>
{/block}

 

×
×
  • Create New...