Skip to main content
deleted 6 characters in body
Source Link
Dinesh Yadav
  • 6.5k
  • 2
  • 23
  • 50

Try this in your product collection

$currentDate = Mage::getModel('core/date')->gmtDate('Y-m-d H:i:s'd');
$plusOneMonth = date('Y-m-d', strtotime($currentDate . "+1 months"));

$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addFieldToFilter('expiry_date', array('from' => $currentDate, 'to' => $plusOneMonth));

Try this in your product collection

$currentDate = Mage::getModel('core/date')->gmtDate('Y-m-d H:i:s');
$plusOneMonth = date('Y-m-d', strtotime($currentDate . "+1 months"));

$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addFieldToFilter('expiry_date', array('from' => $currentDate, 'to' => $plusOneMonth));

Try this in your product collection

$currentDate = Mage::getModel('core/date')->gmtDate('Y-m-d');
$plusOneMonth = date('Y-m-d', strtotime($currentDate . "+1 months"));

$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addFieldToFilter('expiry_date', array('from' => $currentDate, 'to' => $plusOneMonth));
Source Link
Dinesh Yadav
  • 6.5k
  • 2
  • 23
  • 50

Try this in your product collection

$currentDate = Mage::getModel('core/date')->gmtDate('Y-m-d H:i:s');
$plusOneMonth = date('Y-m-d', strtotime($currentDate . "+1 months"));

$collection = Mage::getModel('catalog/product')->getCollection();
$collection->addFieldToFilter('expiry_date', array('from' => $currentDate, 'to' => $plusOneMonth));