This is original file in code
dir of a third part module:
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="head.additional">
<block class="Amasty\Checkout\Block\Onepage\Head" name="amasty.checkout.head" template="Amasty_Checkout::onepage/head.phtml" after="-"/>
</referenceBlock>
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
<item name="component" xsi:type="string">Amasty_Checkout/js/view/onepage</item>
<item name="children" xsi:type="array">
<item name="sidebar" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item>
<item name="displayArea" xsi:type="string">sidebar</item>
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">Amasty_Checkout/onepage/sidebar-summary</item>
</item>
<item name="children" xsi:type="array">
<item name="additional" xsi:type="array">
<item name="component" xsi:type="string">Amasty_Checkout/js/view/additional/fieldset</item>
<item name="provider" xsi:type="string">checkoutProvider</item>
<item name="config" xsi:type="array">
<item name="deps" xsi:type="array">
<item name="0" xsi:type="string">checkoutProvider</item>
</item>
</item>
<item name="children" xsi:type="array">
<item name="subscribe" xsi:type="array">
<item name="component" xsi:type="string">Amasty_Checkout/js/view/additional/subscribe</item>
<item name="description" xsi:type="string" translate="true">Sign Up for Our Newsletter</item>
<item name="dataScope" xsi:type="string">amcheckout.additional.subscribe</item>
<item name="provider" xsi:type="string">checkoutProvider</item>
<item name="checked" xsi:type="boolean">false</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>
I want to hide the element but extending the XML layout file in my custom theme. This is my extended XML file, however, I can't get it to work... Element is still visible on the frontend.
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="checkout.root">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="components" xsi:type="array">
<item name="checkout" xsi:type="array">
<item name="component" xsi:type="string">Amasty_Checkout/js/view/onepage</item>
<item name="children" xsi:type="array">
<item name="sidebar" xsi:type="array">
<item name="children" xsi:type="array">
<item name="additional" xsi:type="array">
<item name="children" xsi:type="array">
<item name="subscribe" xsi:type="array">
<item name="visible" xsi:type="boolean">false</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</referenceBlock>
</body>
</page>
Is it even possible to hide the element by extending the XML file or do I have to create a custom module and set up a preference for it?