Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 20th, 2013  |  syntax: None  |  size: 0.82 KB  |  views: 24  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. $skuArray = array();
  2. $categoryCollection = Mage::getModel('catalog/category')->getCollection();
  3. foreach ($categoryCollection as $category) {
  4.     $skuArray[$category->getId()] = $category->getProductCollection()->getColumnValues('sku');
  5. }
  6.        
  7. $categoryCollection = Mage::getModel('catalog/category')->getCollection();
  8. foreach ($categoryCollection as $category) {
  9.     $skus = $category->getProductCollection()->getColumnValues('sku');
  10.     $category->setData('skus', $skus);
  11. }
  12.        
  13. foreach($categoryCollection as $category) {
  14.     $categorySkus = $category->getData('skus');
  15. }
  16.        
  17. $categories = Mage::getResourceModel('catalog/category_collection');
  18. foreach ($categories as $category) {
  19.     $products = $category->getProductCollection();
  20.     foreach ($products as $product) {
  21.         $sku[$product->getId()] = $product->getSku();
  22.     }
  23. }
clone this paste RAW Paste Data