I'm using Magento 2.3.5. I have a label attribute for products in which you can add labels like 'popular', 'must have', 'our choice' etc.

There is an attribute called 'Set Product as New From' and I want it to show a 'new' label on the productpage if 'Set Product as New From' is active. How can I achieve this?

Thank you in advance!

1 Answer 1


$fromDate = $_product->getNewsFromDate();

$toDate = $_product->getNewsToDate();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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