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