Get Customer Custom attribute value in Magento 2.

We can get custom attribute value of Customer in magento 2 by simple way. If we have created any customer attribute in Magento 2 and we need to get that value in any place in code you can just get custom attribute value by below way,

Let’s we consider Mobile attribute value is custom attribute value created for Customer, attribute code for Mobile is mobile.

You can get customer custom_attribute value by,

$customer = $CUSTOMER_OBJECT; // GET customer object
$customer->getCustomAttribute('mobile')->getValue();

return will be your customer custom_attribute mobile value.

How to disable Company field from Checkout page in Magento 2?

You can disable Company field from Checkout page using Magento 2. Company field came with Native Magento in the checkout page.

Sometimes the client doesn’t want to display extra field like company name, fax or any other unnecessary field from the checkout page.

In Magento 2 You can disable extra field like Company using XML file or by creating a plugin. Continue reading “How to disable Company field from Checkout page in Magento 2?”

Magento 2 Get All Shipping Methods list.

Get all the shipping methods in Magento 2 by native Magento class, Magento\Shipping\Model\Config\Source\Allmethods

Using above class you can get all the shipping method in Magento. Shipping method Continue reading “Magento 2 Get All Shipping Methods list.”