【问题标题】:Checkbox is missing in related products in magentomagento的相关产品中缺少复选框
【发布时间】:2014-03-06 15:40:35
【问题描述】:

我正在使用 magento C.E 1.7。我的产品视图页面来自easytabs,因为我使用的是easy tabs插件。相关产品也在easytabs中查看。

问题是,大多数产品在相关产品列表中没有复选框。我在管理员中检查了他们的库存情况、所需选项等。产品设置没有问题。我的代码如下

<div class="box-collateral box-description">
<?php if($this->getItems()->getSize()): ?>
        <p class="test"><strong><?php echo $this->__('Check items to add to the cart or') ?>&nbsp;<a href="#" onclick="selectAllRelated(this);return false;"><?php echo $this->__('select all') ?></a></strong></p>
        <ol class="tabsrelated">
        <?php foreach($this->getItems() as $_item): ?>
            <li <?php if($_item->isComposite() || !$_item->isSaleable()): ?> class="super-products"<?php endif; ?> id="tabsheight">
                <div class="product-images">
                <?php if(!$_item->isComposite() && $_item->isSaleable()): ?>
                    <span class="checkbox-container">
                    <?php if (!$_item->getRequiredOptions()): ?>
                        <input type="checkbox" class="related-checkbox left" id="related-checkbox<?php echo $_item->getId() ?>" name="related_products[]" value="<?php echo $_item->getId() ?>" />
                    <?php endif; ?>
                    </span>
                <?php else: ?>
                    <span class="checkbox-container">&nbsp;</span>
                <?php endif; ?>
                <a href="<?php echo $_item->getProductUrl() ?>"><img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(150) ?>" alt="<?php echo $this->htmlEscape($_item->getName()) ?>" width="150" height="150" /></a>
                </div>
                <div class="product-details">
                    <a href="<?php echo $_item->getProductUrl() ?>"><?php echo $this->htmlEscape($_item->getName()) ?></a>
                    <div style="clear:both;">
                        <div class="related-price">
                            <?php echo $this->getPriceHtml($_item, true) ?>
                        </div>
                        <div class="related-shipping" style="line-height:25.5px">&nbsp;
                        + Free Shipping
                        </div>
                    </div>
                    <?php if ($this->helper('wishlist')->isAllow()) : ?>
                    <div>
                        <a href="<?php echo $this->getAddToWishlistUrl($_item) ?>" class="link-cart"><?php echo $this->__('Add to Wishlist') ?></a>
                    </div>
                    <?php endif; ?>
            </div>
        </li>
        <?php endforeach ?>
        </ol>

如何使用复选框查看所有相关产品?有人可以帮忙吗?

【问题讨论】:

    标签: php magento checkbox magento-1.7


    【解决方案1】:

    您的产品有自定义选项吗?如果是这样,我认为不会显示复选框,因为在这种情况下您必须转到产品并选择那些自定义选项,并且无法在相关产品区域中直接选择它。

    【讨论】:

    • 是的,你是对的。产品具有作为必填字段的自定义选项。这就是为什么此类产品没有提供复选框的原因。谢谢!
    猜你喜欢
    • 2013-06-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-07
    • 1970-01-01
    相关资源
    最近更新 更多