Create a Custom REST API for Bulk product update in Magento 2.

Native Magento comes with a lot of REST APIs for different Entities like Product, Order, Customer, and other APIs.

I want to give a demo for updating bulk products using rest API in Magento 2.

By Default Native Magento doesn’t provide Bulk Product Update API. You need to call REST API to iterate over a loop. At a time you can update only a single product. Continue reading “Create a Custom REST API for Bulk product update in Magento 2.”

How to get all Regions of Country by country code in magento 2?

In Magento 2 we can get all the regions list by country code. We can get all the regions of the specific country by Country code.

Magento\Directory\Model\Country is used to getting all the regions list by the country code. Continue reading “How to get all Regions of Country by country code in magento 2?”

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.