我计划允许客人用户能够查看产品目录。但是我希望他们不要看到价格。有没有办法做到这一点?

有帮助吗?

解决方案

您有一些选择:

自己做

应用程序/设计/前端/默认/默认/模板/目录/product/Price.phtml

插入文件的开始时:

<?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { ?>

在文件末尾插入

<?php } ?>

隐藏添加到购物车:

app/design/frontend/default/default/template/catalog/product/list.phtml

<?php if($_product->isSaleable()): ?>
                    <button class="form-button" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><?php echo $this->__('Add to Cart') ?></span></button>
                <?php else: ?>
                <div class="out-of-stock"><?php echo $this->__('Out of stock') ?></div>
                <?php endif; ?>

在该代码插入之前:

<?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { ?>

在该代码插入之后:

<?php } ?>

您将在文件中找到两次。(一个用于网格模式的列表模式一个!)

应用/设计/frontend/default/default/template/catalog/product/view.phtml

<div class="add-to-holder">
                    <?php if($_product->isSaleable()): ?>
                        <?php echo $this->getChildHtml('addtocart') ?>
                        <?php if( $this->helper('wishlist')->isAllow() || $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product)): ?>
                            <span class="add-or"><?php // echo $this->__('OR') ?></span>
                        <?php endif; ?>
                    <?php endif; ?>
                    <?php echo $this->getChildHtml('addto') ?>
                </div>

在该代码插入之前:

<?php if (Mage::getSingleton('customer/session')->isLoggedIn()) { ?>

在该代码插入之后:

<?php } ?>

如果您的价格等等。您必须在其他文件中使用相同的技巧。您可以在文件夹中的一个文件中找到它们:

应用程序/设计/前端/默认/默认/template/catalog/product/product/

资源: http://www.magentocommerce.com/boards/viewthread/22673/


安装一个模块

有几个可用:

GitHub上的免费B2B插件,列出了其功能的隐藏价格:

https://github.com/sitewards/b2bprofessional

或者,您可以购买:

http://www.magentocommerce.com/magento-connect/bolasevich/extension/2096/hide-product-price-price-for-for-non-register--users-

最后,一个更昂贵的人:

http://www.magentocommerce.com/magento-connect/cart2quote/extension/5905/not2order_hide_hide_price_price_disable_ordering


资源: https://stackoverflow.com/questions/6299366/hide-prices-and-prices-and-disable-checkout-for-guests

许可以下: CC-BY-SA归因
scroll top