1

I want to remove tier_price from vendor/magento/module-configurable-product/view/base/layout/catalog_product_prices.xml:

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<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="configurable" xsi:type="array">
            <item name="prices" xsi:type="array">
                <item name="tier_price" xsi:type="array">
                    <item name="render_class" xsi:type="string">Magento\ConfigurableProduct\Pricing\Render\TierPriceBox</item>
                    <item name="render_template" xsi:type="string">Magento_ConfigurableProduct::product/price/tier_price.phtml</item>
                </item>
                <item name="final_price" xsi:type="array">
                    <item name="render_class" xsi:type="string">Magento\ConfigurableProduct\Pricing\Render\FinalPriceBox</item>
                    <item name="render_template" xsi:type="string">Magento_ConfigurableProduct::product/price/final_price.phtml</item>
                </item>
            </item>
        </argument>
    </arguments>
</referenceBlock>

Since the <remove> layout instruction doesn't work on elements other than blocks or containers, I have no choice but to override the whole layout file in my theme.

Documentation says:

Override base layouts

To add an overriding base layout file (to override a base layout provided by the module):

Put a layout file with the same name in the following location:

<theme_dir>/Namespace_Module/layout/override/base/<layout1>.xml

This file override the following layouts:

/view/frontend/layout/<layout1>.xml

The above assumes the layout file to override is in the frontend folder. Mine is not. Where do I put my override layout? I could not find anything in the documentation.

I tried app/design/frontend/<theme_name>/default/Magento_ConfigurableProduct/layout/override/base/catalog_product_prices.xml that returns an error of course, as it tries to find the original in frontend:

Exception #0 (LogicException): Overriding view file '/var/www/vhosts/sitename/local/app/design/frontend//default/Magento_ConfigurableProduct/layout/override/base/catalog_product_prices.xml' does not match to any of the files.
0

Try this..

Create file in your theme as below :

app/design/frontend/[VendorName]/[theme]/Magento_ConfigurableProduct/layout/catalog_product_prices.xml.

  • unfortunately, that doesn't work — copied the core file to the path you suggested, removed the <code>tier_price</code> item, flushed all caches, but the tier price is still present on the configurable product details page. That path works for layout files in "frontend" only, mine is in "base", hence the question. – krisztianf Mar 14 '18 at 14:27
  • base folder it's default fallback for all arias and used to share resources across of areas..you can override this using the above path.. – SUBIN CHANDRAN Mar 15 '18 at 6:52

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.