Skip to content

Instantly share code, notes, and snippets.

Created June 6, 2013 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5724967 to your computer and use it in GitHub Desktop.
Save anonymous/5724967 to your computer and use it in GitHub Desktop.
LSC Release Calendar
<?php
class LSC_ReleaseCalendar_Block_Calendar extends Mage_Core_Block_Template
{
public function getReleasesCollection()
{
$preorderAttribute = 'preorder';
$preorderValue = 'yes';
$products = Mage::getModel('catalog/product')->getCollection()
->addAttributeToSelect('*')
->addFieldToFilter(
$preorderAttribute,
array(
'eq' => Mage::getResourceModel('catalog/product')
->getAttribute($preorderAttribute)
->getSource()
->getOptionId($preorderValue)
)
);
foreach ($products as $product) {
echo $product->getName();
echo $product->getReleaseDate();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment