I am assembling a product array drop-down for an extension I am building. I was curious if it is possible to pull a few more attributes into the following code so that I can reference them elsewhere in my code at the same time.
Currently, I am pulling all product SKUs from Magento using the following:
$products = array();
$productCollection = Mage::getResourceModel('catalog/product_collection')->addAttributeToSort('sku', 'asc');
$i = 1;
$items = $productCollection->getData();
foreach($items as $item) {
$products[$i]['value'] = $item['sku'];
$products[$i]['label'] = $item['sku'];
$i++;
}
I would like to also include the product's entity_id, created_at & updated_at fields into this array.
ADDITIONAL NOTES: Currently I just reference the SKUs using the following code in my admin HTML:
$products = array();
$productCollection = Mage::getResourceModel('catalog/product_collection')->addAttributeToSort('sku', 'asc');
$i = 1;
$items = $productCollection->getData();
foreach($items as $item) {
$products[$i]['value'] = $item['sku'];
$products[$i]['label'] = $item['sku'];
$i++;
}