9

I need to remove "from - to" price in bundle product page.

So the question is how to remove item from argument?

Block is created in

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>

other possibility is that if i could override hole catalog_product_prices.xml

I tried using method http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/layouts/layout-override.html

2

You can hide from and to label using CSS

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

**

OR

**

Copy below file in your theme

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

Find Line no. 47

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

AND Find Line no. 65

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

Remove above code.

  • Is that working for you ? – hweb87 May 4 '18 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.