在magento产品页面上隐藏层级价格

时间:2013-03-19 07:58:47

标签: magento magento-1.7 magento-1.6

我正在尝试隐藏magento产品页面上的等级定价,但我无法成功跟随帖子Display Price Once on Magento Product Page任何机构可以提供帮助吗?

2 个答案:

答案 0 :(得分:1)

复制 price.phtml
  

应用程序/设计/前端/碱/默认/模板/目录/产品/ price.phtml

  

应用程序/设计/前端/缺省的/你的主题/模板/目录/产品/

找到以下行

<span class="label"><?php echo $this->__('As low as:') ?></span>
<span class="price" id="product-minimal-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
      <?php echo $_coreHelper->currency($_minimalPriceDisplayValue,true,false) ?>
</span>

评论这些内容:

<!--span class="label"><?php echo $this->__('As low as:') ?></span>
<span class="price" id="product-minimal-price-<?php echo $_id ?><?php echo $this->getIdSuffix() ?>">
      <?php echo $_coreHelper->currency($_minimalPriceDisplayValue,true,false) ?>
</span-->

您的等级价格已隐藏。

干杯:)

答案 1 :(得分:0)

供应商\模块\视图\前端\布局\catalog_product_prices.phtml

<?xml version="1.0"?>                                                 
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
<block class="Magento\Framework\Pricing\Render\RendererPool" name="render.product.prices">
    <arguments>
        <argument name="default" xsi:type="array">
            <item name="default_render_class" xsi:type="string">Magento\Catalog\Pricing\Render\PriceBox</item>
            <item name="default_render_template" xsi:type="string">Magento_Catalog::product/price/default.phtml</item>
            <item name="default_amount_render_class" xsi:type="string">Magento\Framework\Pricing\Render\Amount</item>
            <item name="default_amount_render_template" xsi:type="string">**Magento_Catalog**::product/price/amount/default.phtml</item>
            <item name="prices" xsi:type="array">
                <item name="special_price" xsi:type="array">
                    <item name="render_template" xsi:type="string">Magento_Catalog::product/price/special_price.phtml</item>
                </item>
                <item name="tier_price" xsi:type="array">
                    <item name="render_template" xsi:type="string">Vendor_Module::custom_tierprice.phtml</item>
                </item>
                <item name="final_price" xsi:type="array">
                    <item name="render_class" xsi:type="string">Magento\Catalog\Pricing\Render\FinalPriceBox</item>
                    <item name="render_template" xsi:type="string">Magento_Catalog::product/price/final_price.phtml</item>
                </item>
                <item name="custom_option_price" xsi:type="array">
                    <item name="amount_render_template" xsi:type="string">Magento_Catalog::product/price/amount/default.phtml</item>
                </item>
                <item name="configured_price" xsi:type="array">
                    <item name="render_class" xsi:type="string">Magento\Catalog\Pricing\Render\ConfiguredPriceBox</item>
                    <item name="render_template" xsi:type="string">Magento_Catalog::product/price/configured_price.phtml</item>
                </item>
            </item>
            <!--<item name="adjustments" xsi:type="array"></item>-->
        </argument>
    </arguments>
</block>                                                        
</layout>

供应商\模块\视图\前端\模板\custom_tierprice.phtml

<?php @var \Magento\Catalog\Pricing\Render\PriceBox $block @var \Magento\Catalog\Pricing\Price\TierPrice $tierPriceModel ?>