Last active
January 12, 2019 01:26
-
-
Save anthuanvasquez/a4a311a3dc410f975df5e5b3306a6867 to your computer and use it in GitHub Desktop.
Magento Get Products by Category ID
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 | |
$_categoryId = 123; | |
$_limit = 10; | |
$_categoryModel = Mage::getModel('catalog/category'); | |
$_category = $_categoryModel->load($_categoryId); | |
$_productCollection = $_category->getProductCollection() | |
->addAttributeToSelect('*') | |
->setPage(1, $_limit); | |
if ($_products->getSize()) { | |
foreach ($_products as $_product) { | |
var_dump($_product->getData()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment