0

I want to to add custom columns values in export option in customer grid, but only heading are showing in csv file not values.

here is my customer grid custom columns.

Vendor\Module/view/adminhtml/ui_component/customer_listing.xml

<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="customer_columns" class="Magento\Customer\Ui\Component\Listing\Columns">
        <column name="loyal_member_since" class="Vendor\Module\Ui\Component\Listing\Column\LoyalMemberSince">
            <settings>
                <filter>dateRange</filter>
                <label translate="true">Loyal Member Since</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>date</dataType>
            </settings>
        </column>
        <column name="loyalty_tier" class="Vendor\Module\Ui\Component\Listing\Column\Tier">
            <settings>
                <filter>textRange</filter>
                <label translate="true">Tier</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>text</dataType>
            </settings>
        </column>
        <column name="loyalty_welcome" class="Vendor\Module\Ui\Component\Listing\Column\Welcome">
            <settings>
                <filter>boolean</filter>
                <label translate="true">Welcome</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>select</dataType>
            </settings>
        </column>
        <column name="devices_registered" class="Vendor\Module\Ui\Component\Listing\Column\DeviceRegistration">
            <settings>
                <filter>number</filter>
                <label translate="true">Device registration</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>text</dataType>
            </settings>
        </column>
        <column name="new_neo_subscription" class="Vendor\Module\Ui\Component\Listing\Column\NewNeoSubscription">
            <settings>
                <filter>boolean</filter>
                <label translate="true">New neo subscription</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>select</dataType>
            </settings>
        </column>
        <column name="loyalty_happy_birthday" class="Vendor\Module\Ui\Component\Listing\Column\HappyBirthday">
            <settings>
                <filter>boolean</filter>
                <label translate="true">Happy birthday</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>select</dataType>
            </settings>
        </column>
        <column name="loyalty_purchases" class="Vendor\Module\Ui\Component\Listing\Column\PurchasesId">
            <settings>
                <filter>textRange</filter>
                <label translate="true">Purchases</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>text</dataType>
            </settings>
        </column>
        <column name="premium_accessories" class="Vendor\Module\Ui\Component\Listing\Column\PremiumAccessories">
            <settings>
                <filter>boolean</filter>
                <label translate="true">Premium accessories</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>select</dataType>
            </settings>
        </column>
        <column name="free_device" class="Vendor\Module\Ui\Component\Listing\Column\FreeDevice">
            <settings>
                <filter>boolean</filter>
                <label translate="true">Free device</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>select</dataType>
            </settings>
        </column>
        <column name="warranty_extension" class="Vendor\Module\Ui\Component\Listing\Column\WarrantyExtension">
            <settings>
                <filter>boolean</filter>
                <label translate="true">Warranty extension</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>select</dataType>
            </settings>
        </column>
        <column name="redeemed_points" class="Vendor\Module\Ui\Component\Listing\Column\RedeemPoints">
            <settings>
                <filter>textRange</filter>
                <label translate="true">Redeem points</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>text</dataType>
            </settings>
        </column>
        <column name="unsubscription_date" class="Vendor\Module\Ui\Component\Listing\Column\Unsubscription">
            <settings>
                <filter>dateRange</filter>
                <label translate="true">Unsubscription</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>date</dataType>
            </settings>
        </column>
        <column name="deals_redeemed" class="Vendor\Module\Ui\Component\Listing\Column\Deals">
            <settings>
                <filter>textRange</filter>
                <label translate="true">Deals</label>
                <sortable>true</sortable>
                <sorting>asc</sorting>
                <dataType>select</dataType>
            </settings>
        </column>
    </columns>
</listing>

but when i export csv this is what i get enter image description here enter image description here

i only get default columns values but custom columns just heading no values

  • any idea how to do this?
4

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy