1

I need to add the updated_at date column in the Magento search term grid. the field is presented in the search_query table. I'm trying to override layout vendor/magento/module-search/view/adminhtml/layout/search_term_grid_block.xml to add a new column. but failed my attempts please suggest any way for the same. thanks for your help.

0

Just Override search_term_grid_block.xml and use below code in my layout folder. now it's working perfectly

[VENDOR][MODULE]/view/adminhtml/layout/search_term_grid_block.xml

<?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">
    <body>
        <referenceBlock name="adminhtml.catalog.search.grid.columnSet">
            <block class="Magento\Backend\Block\Widget\Grid\Column" name="adminhtml.catalog.search.grid.columnSet.updated_at" as="updated_at">
                <arguments>
                    <argument name="header" xsi:type="string" translate="true">Updated At</argument>
                    <argument name="index" xsi:type="string">updated_at</argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

Please find the attachment for better understanding.

enter image description here

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.