Last active
August 4, 2016 01:46
-
-
Save tuanphpvn/88553fec6de141c73696 to your computer and use it in GitHub Desktop.
Get list product have option #Magento #Product #Option
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 | |
$checkProductHaveOption = function() { | |
$productIds = Mage::getModel('catalog/product')->getCollection()->getAllIds(); | |
$productModel = Mage::getModel('catalog/product'); | |
$arrProductIdHaveOption = array(); | |
foreach ($productIds as $key =>$productId ) { | |
$productObj = $productModel->load($productId); | |
if($productObj->getHasOptions()) { | |
$arrProductIdHaveOption[] = $productObj->getId(); | |
} | |
} | |
return $arrProductIdHaveOption; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment