Hi there,
How can I associate a <div>New </div> to categories products in order to show a "New" Image on this layout?
The idea is have this "New" image on all new products that are added to the store and automatically turn it off after the latest products time set in Administrator is finished.
Thanks in advanced
Hi.
Try to create a customfield: Custom Field Type = Date, ... Layout position = pos-new.
in your template override:
<?php
if(!empty($product->customfields)) {
foreach($product->customfields as $cfield) {
if ($cfield->layout_pos == 'pos-new') {
$_date = explode('-',$cfield->custom_value);
$__date = mktime(0,0,0,$_date[1],$_date[2],$_date[0]);
if ( time() < $__date ) {
echo '<div>NEW</div>';
}
}
}
}
?>