Guest User

Untitled

a guest
Aug 3rd, 2014
372
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $bikini_size        = array();
  3. $m_flip_flops_size  = array();
  4. $m_shorts_size      = array();
  5. $m_tshirt_size      = array();
  6. $w_flip_flops_size  = array();
  7. $w_shorts_size      = array();
  8. if($_product->isConfigurable()){
  9.     $allProducts = $_product->getTypeInstance(true)->getUsedProducts(null, $_product);
  10.     foreach ($allProducts as $subproduct) {
  11.         if ($subproduct->isSaleable() && floor($subproduct->getStockItem()->getQty()) > 0 ) {
  12.             $bikini_size[]          = $subproduct->getAttributeText('bikini_size');
  13.             $m_flip_flops_size[]    = $subproduct->getAttributeText('m_flip_flops_size');
  14.             $m_shorts_size[]        = $subproduct->getAttributeText('m_shorts_size');
  15.             $m_tshirt_size[]        = $subproduct->getAttributeText('m_tshirt_size');
  16.             $w_flip_flops_size[]    = $subproduct->getAttributeText('w_flip_flops_size');
  17.             $w_shorts_size[]        = $subproduct->getAttributeText('w_shorts_size');
  18.         }
  19.     }
  20.     if(count($bikini_size)>0) {
  21.         sort($bikini_size);
  22.         ?>
  23.         <div class="desc std bikini_size">
  24.         Sizes: <? echo implode(", ", $bikini_size); ?>
  25.         </div>
  26.         <?
  27.     }
  28.     if(count($m_flip_flops_size)>0) {
  29.         sort($m_flip_flops_size);
  30.         ?>
  31.         <div class="desc std m_flip_flops_size">
  32.         Sizes: <? echo implode(", ", $m_flip_flops_size); ?>
  33.         </div>
  34.         <?
  35.     }
  36.     if(count($m_shorts_size)>0) {
  37.         sort($m_shorts_size);
  38.         ?>
  39.         <div class="desc std m_shorts_size">
  40.         Sizes: <? echo implode(", ", $m_shorts_size); ?>
  41.         </div>
  42.         <?
  43.     }
  44.     if(count($m_tshirt_size)>0) {
  45.         sort($m_tshirt_size);
  46.         ?>
  47.         <div class="desc std m_tshirt_size">
  48.         Sizes: <? echo implode(", ", $m_tshirt_size); ?>
  49.         </div>
  50.         <?
  51.     }
  52.     if(count($w_flip_flops_size)>0) {
  53.         sort($w_flip_flops_size);
  54.         ?>
  55.         <div class="desc std w_flip_flops_size">
  56.         Sizes: <? echo implode(", ", $w_flip_flops_size); ?>
  57.         </div>
  58.         <?
  59.     }
  60.     if(count($w_shorts_size)>0) {
  61.         sort($w_shorts_size);
  62.         ?>
  63.         <div class="desc std w_shorts_size">
  64.         Sizes: <? echo implode(", ", $w_shorts_size); ?>
  65.         </div>
  66.         <?
  67.     }
  68. }
  69. ?>
RAW Paste Data