【问题标题】:hide tier prices on magento product page [closed]在magento产品页面上隐藏等级价格[关闭]
【发布时间】:2013-03-07 19:33:33
【问题描述】:

我试图在 magento 产品页面上隐藏等级定价,但未能成功,我关注了 Display Price Once on Magento Product Page 之后的帖子,任何人都可以提供帮助吗?

【问题讨论】:

    标签: magento magento-1.7 magento-1.6


    【解决方案1】:

    复制price.phtml

    app/design/frontend/base/default/template/catalog/product/price.phtml

    app/design/frontend/default/your-theme/template/catalog/product/

    找到以下几行

    <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-->
    

    您的等级价格已隐藏。

    干杯:)

    【讨论】:

    • 也许创建一个自己的设计覆盖默认设计并在那里禁用输出是一个更好的主意....考虑以后的升级
    • 隐藏默认/原始价格怎么样?
    【解决方案2】:

    供应商\模块\视图\前端\布局\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 ?>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-09-20
      • 2014-08-05
      相关资源
      最近更新 更多