Guest User

Untitled

a guest
May 27th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php $customerSession = Mage::getSingleton('customer/session');
  2. if($customerSession->isLoggedIn()){
  3. $groupId = $customerSession->getCustomerGroupId();
  4. $group = Mage::getModel('customer/group')->load($groupId);
  5. if ('Wholesale' == $group->getCode()){ //or $group->getCustomerGroupCode()
  6. foreach ($_product->getTypeInstance(true)->getUsedProducts ( null, $_product) as $simple) {
  7. $qty = Mage::getModel('cataloginventory/stock_item')->loadByProduct($simple)->getQty();
  8. echo $simple->getName()." with size ".$simple->getSize()." have a stock of $qty";
  9. echo '<br/>';
  10. }
  11.  
  12. }
  13. }?>
Add Comment
Please, Sign In to add comment