Created
April 22, 2011 00:55
-
-
Save dragoonis/935797 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
function compare() { | |
$sLevel = $this->get(__FUNCTION__, ''); | |
$iCatID = $this->get($sLevel, 0); | |
if(empty($sLevel)) { | |
throw new PPI_Exception('Unable to locate compare function\'s category level.'); | |
} | |
if(empty($iCatID) || $iCatID < 1) { | |
throw new PPI_Exception('Unable to locate category ID'); | |
} | |
switch($sLevel) { | |
case 'topcat': | |
$sLevel = 'topcat_id'; | |
break; | |
case 'catzero': | |
$sLevel = 'catzero_id'; | |
break; | |
case 'page': | |
$sLevel = 'page_id'; | |
break; | |
default: | |
throw new PPI_Exception('Invalid Category Specified'); | |
break; | |
} | |
$oProduct = new APP_Model_Product(); | |
$aProducts = $oProduct->getProducts(array( | |
'level' => $sLevel, | |
'cat_id' => $iCatID, | |
'get_spec' => 2, | |
'get_offers' => 1, | |
'get_reviews' => 1, | |
'max_items' => 5 | |
)); | |
$this->addStylesheet('compare.css'); | |
$this->load('product/compare', compact('aProducts')); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment