Magento 2.1:如何从块中删除参数和/或参数项?


9

我需要在捆绑产品页面中删除“从-到”价格。

那么问题是如何从参数中删除项目?

块创建于

magento2 / vendor / magento / module-bundle / view / base / layout / catalog_product_prices.xml

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
<referenceBlock name="render.product.prices">
    <arguments>
        <argument name="bundle" xsi:type="array">
            <item name="prices" xsi:type="array">
                <item name="tier_price" xsi:type="array">
                    <item name="render_template" xsi:type="string">Magento_Bundle::product/price/tier_prices.phtml</item>
                </item>

                <!-- start: this should be removed -->
                <item name="final_price" xsi:type="array">
                    <item name="render_class" xsi:type="string">Magento\Bundle\Pricing\Render\FinalPriceBox</item>
                    <item name="render_template" xsi:type="string">Magento_Bundle::product/price/final_price.phtml</item>
                </item>
                <!-- end: this should be removed -->

                <item name="bundle_option" xsi:type="array">
                    <item name="amount_render_template" xsi:type="string">Magento_Bundle::product/price/selection/amount.phtml</item>
                </item>
            </item>
        </argument>
    </arguments>
</referenceBlock>

另一种可能性是,如果我可以覆盖孔catalog_product_prices.xml

我尝试使用方法http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/layouts/layout-override.html


Answers:


2

您可以隐藏,并使用CSS标签

.page-product-bundle .product-info-price .price-label {
    display: none;
}

**

要么

**

在主题中复制以下文件

/vendor/magento/module-bundle/view/base/templates/product/price/final_price.phtml

查找行号 47

'display_label'     => __('From'),

并且找到行号 65岁

'display_label'     => __('To'),

删除上面的代码。


那对你有用吗?
hweb87
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.