微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在分组产品表中显示产品尺寸 - Magento

如何解决在分组产品表中显示产品尺寸 - Magento

我想在前端表中显示产品尺寸,但我不确定如何将后端的产品尺寸回显到表格中。下面是我的编码,我尝试添加大小列并写入 echo $this->getSizeHtml($_item,true) 以显示大小值,但无法工作。

<table class="table table-bordered responsive-table" id="super-product-table">
    <col />
    <col />
    <col width="1" />
    <thead>
        <tr>
            <th><?PHP echo $this->__('Product Name') ?></th>
            <th><?PHP echo $this->__('Size') ?></th>
            <?PHP if ($this->getCanShowProductPrice($_product)): ?>
            <th><?PHP echo $this->__('Price') ?></th>
            <?PHP endif; ?>
            <?PHP if ($_product->isSaleable()): ?>
            <th><?PHP echo $this->__('Qty') ?></th>
            <?PHP endif; ?>
        </tr>
    </thead>
    <tbody>
    <?PHP if ($_hasAssociatedProducts): ?>
    <?PHP foreach ($_associatedProducts as $_item): ?>
        <?PHP $_finalPriceInclTax = $this->helper('tax')->getPrice($_item,$_item->getFinalPrice(),true) ?>
        <tr>
            <td><?PHP echo $this->escapeHtml($_item->getName()) ?></td>
            <td><?PHP echo $this->getSizeHtml($_item,true) ?></td>
            <?PHP if ($this->getCanShowProductPrice($_product)): ?>
            <td>
                <?PHP if ($this->getCanShowProductPrice($_item)): ?>
                <?PHP echo $this->getPriceHtml($_item,true) ?>
                <?PHP echo $this->getTierPriceHtml($_item) ?>
                <?PHP endif; ?>
            </td>
            <?PHP endif; ?>
            <?PHP if ($_product->isSaleable()): ?>
            <td>
            <?PHP if ($_item->isSaleable()) : ?>
                <div class="quantity-wrapper clearfix">
                    <?PHP  $random = rand(5,1500); ?>
                    <div class="quantity-decrease btn-qty" onclick="qtyDown(<?PHP echo $random; ?>)"><i class="meigee-arrow-left"></i></div>
                    <input type="text" id="qty_<?PHP echo $random; ?>" name="super_group[<?PHP echo $_item->getId() ?>]" maxlength="12" value="<?PHP echo $_item->getQty()*1 ?>" title="<?PHP echo Mage::helper('core')->quoteEscape($this->__('Qty')); ?>" class="form-control qty" />
                    <div class="quantity-increase btn-qty" onclick="qtyUp(<?PHP echo $random; ?>)"><i class="meigee-arrow-right"></i></div>
                </div>
            <?PHP else: ?>
                <p class="availability out-of-stock"><span><?PHP echo $this->__('Out of stock') ?></span></p>
            <?PHP endif; ?>
            </td>
            <?PHP endif; ?>
        </tr>
    <?PHP endforeach; ?>
    <?PHP else: ?>
       <tr>
           <td colspan="<?PHP if ($_product->isSaleable()): ?>4<?PHP else : ?>3<?PHP endif; ?>"><?PHP echo $this->__('No options of this product are available.') ?></td>
       </tr>
    <?PHP endif; ?>
    </tbody>
</table>

实际上,我想要如下图所示的结果表:

output8

希望有人能指导我如何显示大小值问题。谢谢。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。