S
S
sergeyviktorovich2021-05-27 16:07:03
1C-Bitrix
sergeyviktorovich, 2021-05-27 16:07:03

How to display new products that have been active for less than a month?

New items include products that are less than a month old (from the moment of activation).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton, 2021-05-27
@anton99zel

global $arrFilter;
$date = date('m,d,Y', time() - 86400 * 30);
$arrFilter = Array(
">=DATE_CREATE"=>date($DB->DateFormatToPHP(CLang::GetDateFormat("SHORT")), mktime(0,0,0,$date))
);

For labels, just compare dates and output label

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question