Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php $customerSession = Mage::getSingleton('customer/session');
- if($customerSession->isLoggedIn()){
- $groupId = $customerSession->getCustomerGroupId();
- $group = Mage::getModel('customer/group')->load($groupId);
- if ('Wholesale' == $group->getCode()){ //or $group->getCustomerGroupCode()
- foreach ($_product->getTypeInstance(true)->getUsedProducts ( null, $_product) as $simple) {
- $qty = Mage::getModel('cataloginventory/stock_item')->loadByProduct($simple)->getQty();
- echo $simple->getName()." with size ".$simple->getSize()." have a stock of $qty";
- echo '<br/>';
- }
- }
- }?>
Add Comment
Please, Sign In to add comment