0

I have override Wishlist layout file in the frontend theme.

app/design/frontend/Custom/default/Magento_Wishlist/layout/wishlist_index_index.xml

And made below change to update the layout handle.

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <update handle="default"/>
</page>

But it's not working and still rendering the customer_account layout.

Thanks

Mohammad Bharmal
  • 594
  • 3
  • 14

1 Answers1

0

Magento will merge all layout XML files, which is why the Wishlist page still updates the customer_account handle.

There are 2 solutions to remove the customer_account handle from the wishlist_index_index.xml layout file of the Magento_Wishlist module:

  1. Remove all content within the customer_account layout, including blocks, containers, the class attribute, changing the title, etc. by using referenceBlock, referenceContainer, etc. in your layout XML file.
  2. Remove the customer_account handle directly in the wishlist_index_index.xml layout file using the Composer patches plugin.

Because there are many customer_account layout files (customer_account.xml) in several modules, solution 1 is difficult to implement and maintain. Therefore, solution 2 is recommended.

For instructions on how to create a custom composer patch, refer to the topic How to create a Magento 2 Patch?

To apply a custom composer patch, I recommend using the Vaimo Composer Patches plugin.
You also can use the Cweagans Composer Patches plugin

There is a Magento official document on how to apply a custom composer patch: https://experienceleague.adobe.com/docs/commerce-operations/upgrade-guide/patches/apply.html

Tu Van
  • 6,868
  • 2
  • 11
  • 22