Magento-如何回显所选产品属性(颜色)

时间:2011-04-08 20:54:54

标签: magento attributes custom-attributes thumbnails

我正在运行magento 1.4 +。

在产品视图页面上,使用可配置产品,如何获取所选属性以回显其标题。

例如 - 我有彩色缩略图,当你点击它时也会更新我的下拉列表。我想回复文本onclick,而不是更改下拉列表。有小费吗?这是我的代码 -

    <?php
    $_product    = $this->getProduct();
    $_attributes = Mage::helper('core')->decorateArray($this->getAllowAttributes());
?>
<?php if ($_product->isSaleable() && count($_attributes)):?>
    <dl class="product-options-block">
    <?php foreach($_attributes as $_attribute): ?>
        <dt><label class="required"><?php echo $_attribute->getLabel() ?> <em>*</em></label></dt>
        <dd<?php if ($_attribute->decoratedIsLast){?> class="last"<?php }?>>
            <div class="input-box">
                <select <?php if($this->showIcons()):?>style=""<?php endif;?> name="super_attribute[<?php echo $_attribute->getAttributeId() ?>]" id="attribute<?php echo $_attribute->getAttributeId() ?>" class="required-entry super-attribute-select">
                    <option><?php echo $this->__('Choose an Option...') ?></option>
                </select>
                <div style="clear:both;"></div>
            </div>
        </dd>
    <?php endforeach; ?>
    </dl>
    <script type="text/javascript">
        var spConfig = new Product.Config(<?php echo $this->getJsonConfig() ?>, '', optionsPrice, <?php echo $this->showIcons() ?>, '<?php echo $this->getIconsDir() ?>', '<?php echo $this->getIconExt() ?>', <?php echo $this->reloadeImage() ?>);
    </script>
<?php endif;?>

0 个答案:

没有答案