Get Region id by region and Country code in Magento 2.

You Can fetch Region id by region code and the country code in Magento 2.

There are many scenarios where you need to get region id to do the process. like Create Customer address programmatically, You need to required Region Id to store region for customer address.

You can get region id by calling the factory method of Region Class.

Get customer id by email address Magento 2.

You can get Customer id by customer email address using CustomerRepositoryInterface interface.

You can get Customer information by Customer email id, You need to use Magento\Customer\Api\CustomerRepositoryInterface to fetch customer id and customer data.

How to show loader widget in ajax call Magento 2?

You can show/hide Ajax Loader in Magento Request using Built-in Magento Widget while working with ajax related stuff in the browser.

You can start the loader once the ajax request is started and you can stop the loader widget after the response is getting or failed.

Its simple to add loader widget icon for an ajax request.