Skip to content

Instantly share code, notes, and snippets.

@tuanphpvn
Last active August 4, 2016 01:46
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 tuanphpvn/88553fec6de141c73696 to your computer and use it in GitHub Desktop.
Save tuanphpvn/88553fec6de141c73696 to your computer and use it in GitHub Desktop.
Get list product have option #Magento #Product #Option
<?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