Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $bikini_size = array();
- $m_flip_flops_size = array();
- $m_shorts_size = array();
- $m_tshirt_size = array();
- $w_flip_flops_size = array();
- $w_shorts_size = array();
- if($_product->isConfigurable()){
- $allProducts = $_product->getTypeInstance(true)->getUsedProducts(null, $_product);
- foreach ($allProducts as $subproduct) {
- if ($subproduct->isSaleable() && floor($subproduct->getStockItem()->getQty()) > 0 ) {
- $bikini_size[] = trim( $subproduct->getAttributeText('bikini_size') );
- $m_flip_flops_size[] = trim( $subproduct->getAttributeText('m_flip_flops_size') );
- $m_shorts_size[] = trim( $subproduct->getAttributeText('m_shorts_size') );
- $m_tshirt_size[] = trim( $subproduct->getAttributeText('m_tshirt_size') );
- $w_flip_flops_size[] = trim( $subproduct->getAttributeText('w_flip_flops_size') );
- $w_shorts_size[] = trim( $subproduct->getAttributeText('w_shorts_size') );
- }
- }
- $bikini_size = array_filter( $bikini_size );
- $m_flip_flops_size = array_filter( $m_flip_flops_size );
- $m_shorts_size = array_filter( $m_shorts_size );
- $m_tshirt_size = array_filter( $m_tshirt_size );
- $w_flip_flops_size = array_filter( $w_flip_flops_size );
- $w_shorts_size = array_filter( $w_shorts_size );
- if(count($bikini_size)>0) {
- sort($bikini_size);
- ?>
- <div class="desc std bikini_size">
- Sizes: <? echo implode(", ", $bikini_size); ?>
- </div>
- <?
- }
- if(count($m_flip_flops_size)>0) {
- sort($m_flip_flops_size);
- ?>
- <div class="desc std m_flip_flops_size">
- Sizes: <? echo implode(", ", $m_flip_flops_size); ?>
- </div>
- <?
- }
- if(count($m_shorts_size)>0) {
- sort($m_shorts_size);
- ?>
- <div class="desc std m_shorts_size">
- Sizes: <? echo implode(", ", $m_shorts_size); ?>
- </div>
- <?
- }
- if(count($m_tshirt_size)>0) {
- sort($m_tshirt_size);
- ?>
- <div class="desc std m_tshirt_size">
- Sizes: <? echo implode(", ", $m_tshirt_size); ?>
- </div>
- <?
- }
- if(count($w_flip_flops_size)>0) {
- sort($w_flip_flops_size);
- ?>
- <div class="desc std w_flip_flops_size">
- Sizes: <? echo implode(", ", $w_flip_flops_size); ?>
- </div>
- <?
- }
- if(count($w_shorts_size)>0) {
- sort($w_shorts_size);
- ?>
- <div class="desc std w_shorts_size">
- Sizes: <? echo implode(", ", $w_shorts_size); ?>
- </div>
- <?
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement