Advertisement
Guest User

Untitled

a guest
Feb 20th, 2013
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement