Skip to content

Magento 2 Emulate Customer Group from Command Console

I need to cache product pricing in my custom module via a console command. Product price can vary depending on the customer group.

When I fetch product data using my module and the console command line I can only get the default customer group 0 pricing.

Is it possible to emulate or programmatically set the customer group from the command line in order to retrieve the correct product pricing for each group?