Created
June 6, 2013 21:08
-
-
Save anonymous/5724967 to your computer and use it in GitHub Desktop.
LSC Release Calendar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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