How to create customer attribute for specific website level Magento 2?

You can create user-defined customer attributes using Patch Data in Magento 2.

If you have some requirement to show customer attributes to only a given website in multi website setup.
This article displays customer attributes for specific website levels.

Let’s hope you have created a simple module,
Just create a new Data Patch file under the path, app/code/<Vendor>/<Modulename>/Setup/Patch/Data/CustomerAttributes.php

We have to create a new attribute called ‘mobile’ and display it on the customer registration page, and customer edit page. Continue reading “How to create customer attribute for specific website level Magento 2?”

How to display newest to oldest customer orders in Graphql response Magento 2?

While you working with the Magento Customer Order GraphQl, You will fetch the order by GraphQl query customerOrders.

type Query {
    customerOrders: CustomerOrders @resolver(class: "Magento\\SalesGraphQl\\Model\\Resolver\\Orders")
}

By Default, The Result of the customer orders will be displayed from the Older order to the newest order. Continue reading “How to display newest to oldest customer orders in Graphql response Magento 2?”

Magento 2 Exception Invalid method Magento\Eav\Model\Entity\Attribute::canBeFilterableInGrid.

I recently worked on a Magento project and faced an exception on Magento backend Customer Dashboard while accessing the customer grid on the admin panel.

Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid method Magento\Eav\Model\Entity\Attribute::canBeFilterableInGrid

Continue reading “Magento 2 Exception Invalid method Magento\Eav\Model\Entity\Attribute::canBeFilterableInGrid.”