Last active
August 29, 2015 14:24
-
-
Save Vernonmac/c2b1bf1b35ee4d687df2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? $sizetext = 'available sizes:'; ?> | |
<?php if (36 == $_product->getAttributeSetId()) { //if has attribute set id?> | |
<?php | |
$sizes = array(); if($_product->isConfigurable()){ $allProducts = $_product->getTypeInstance(true)->getUsedProducts(null, $_product); foreach ($allProducts as $subproduct) { if ($subproduct->isSaleable() && floor($subproduct->getStockItem()->getQty()) > 0 ) { $sizes[] = $subproduct->getAttributeText('SMLXL'); | |
} | |
} | |
if($sizes) { ?> | |
<div class="sizes"> | |
<p><?echo $sizetext?> <? echo implode(", ", $sizes); ?></p> | |
</div> | |
<?}?> | |
<?}?> | |
<? } ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment