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'); ?>
        <?php }
    } ?>

specially getAdvanced('show_newlabel')) because the rest is clear. please any explanation and thanks in advance

2 Answers 2


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.

  • yes it's "is featured" but why not displayed when i choose a date grater than to day to start the new product : just product news from today are highlited with this label Commented Oct 10, 2018 at 10:05
  • 1
    @DevelopperMagento just echo these two variable $newsTo and $newsFrom and check which dates are you getting . Then just check condition Commented Oct 10, 2018 at 10:27

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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.