问题描述
我想在前端表中显示产品尺寸,但我不确定如何将后端的产品尺寸回显到表格中。下面是我的编码,我尝试添加大小列并写入 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>
实际上,我想要如下图所示的结果表:
希望有人能指导我如何显示大小值问题。谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)