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:
In category:
In product detail: