0
設定可能なすべての製品のサイズをlist.phtmlグリッド内で取得しようとしています。Magento - 設定可能な製品を入手可能なサイズ
以下のコードでは、すべてのサイズを正常に取得できますが、使用できないサイズも表示されます。
<?php if($_product->isSaleable()): ?>
<div class="taglie">
<?php $cProduct = Mage::getModel('catalog/product')->load($_product->getId());
//check if product is a configurable type or not
if ($cProduct->getData('type_id') == "configurable") {
//get the configurable data from the product
$config = $cProduct->getTypeInstance(true);
//loop through the attributes
foreach($config->getConfigurableAttributesAsArray($cProduct) as $attributes) { ?>
<?php foreach($attributes["values"] as $values) {
echo "<span>".$values["label"]."</span>";
} ?>
<?php
}
} ?>
</div>
<?php else: ?>
<?php echo $this->__('Out of Stock') ?>
<?php endif; ?>
私がしようとしているのは、利用できないサイズのオプションを非表示にすることです。