I want to display a specific attribute only when the set time is not passed. Therefore I created the following code:
<?php $dateFrom = Mage::app()->getLocale()->storeTimeStamp(); $dateTo = $_product->getData('actie_datum_eind');?>
<?php if (Mage::app()->getLocale()->isStoreDateInInterval($store, $dateFrom, $dateTo)) : ?>
<div class="product-sale-label custom"><?php echo $this->htmlEscape($_product->getData('actie_label')); ?></div>
<?php endif;?>
But does not work, the label is not displayed.
When I echo both values, I get the following results:
<?php echo $_product->getData('actie_datum_eind')?><br>
<?php echo Mage::app()->getLocale()->storeTimeStamp()?>
That results in the following:
2017-10-04 00:00:00
1505465811
The results of:
<?php echo $dateFrom?><br>
<?php echo $dateTo?>
Are:
1505465811
2017-10-04 00:00:00
What am I missing here?
$dateFrom
,$dateTo
and$store
??