Get Company using Customer ID programmatically Magento 2 B2B

Get Company details by customer id in magento 2 b2b

You can get Company Programmatically by getByCustomerId( ) function from CompanyManagementInterface.

Magento\Company\Api\CompanyManagementInterface Interface will be used to get Company data using the customer id in Magento 2.

You need a Customer ID to achieve this.

You can get company details programmatically by the below way.

Using this way you can get the company object of the company associated with a particular customer id.

I hope this tutorial is helpful. Happy Coding !!

Leave a Reply

Your email address will not be published. Required fields are marked *