Advertisement
Guest User

Untitled

a guest
Feb 7th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. //load parent product "$product"
  2. $childProducts = Mage::getModel('catalog/product_type_configurable')
  3. ->getUsedProducts(null,$product);
  4.  
  5. // now get qty from collection
  6. $qtyModel = Mage::getModel('cataloginventory/stock_item');
  7. foreach($childProducts as $key => $child){
  8. $childQty[$key] = $qtyModel->loadByProduct($child)->getQty();
  9. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement