if product badge if time strtotime product create_datetime 60 60 24 30

1
2
3
4
5
6
7
8
{if !$product.badge}
{if (((time() - strtotime($product.create_datetime)) / (60*60*24)) < 30)}
{$product.badge = 'new'}
{/if}
{if $product.compare_price && ($product.compare_price > $product.price)}
{$product.badge = 'lowprice'}
{/if}
{/if}