The label New not displayed on all new products magento 2
-
30-01-2021 - |
Question
I installed the template shop4u and i see that just on one product the label new is displayed despite i set featured = true. Can any one explain to me this code:
if (($newsTo != '' || $newsFrom != '') && $_config->getAdvanced('show_newlabel')) {
if (($newsTo != '' && $newsFrom != '' && $now >= $newsFrom && $now <= $newsTo) || ($newsTo == '' && $now >= $newsFrom) || ($newsFrom == '' && $now <= $newsTo)){ ?>
<div class="label-product label-new">
<span class="new-product-icon">
<?php echo __('New'); ?>
</span>
</div>
<?php }
} ?>
specially getAdvanced('show_newlabel')) because the rest is clear. please any explanation and thanks in advance
Solution
For this code $_config->getAdvanced('show_newlabel'))
. In configuration there will be a field for show new label
or not.
go to store->configuration->your module configuration
and check for new label field .Its used for display new label or not.
OTHER TIPS
if (($newsTo != '' || $newsFrom != ''))
means newsfromdate or newstodate not be blank. You can set date from particular product.
$_config->getAdvanced('show_newlabel')
this one like configuration to check label will be display on frontend or not. You can check it by System->Configuration