November Happy Hour will be moved to Thursday December 5th.

Overriding Save Method in Mediachase.Commerce.InventoryService.InventoryServiceProvider to restrict single Warehouse selection for one Market

Vote:
 

Hi,

I want to Overriding Save Method in Mediachase.Commerce.InventoryService.InventoryServiceProvider to restrict single Warehouse selection for one Market accross all Variations (Product). As currently multiple stores can be assigned to same Variation with different Stock quantity in Commerce Admin panel.

I have a requirement where I need to restrict user to select single warehouse for same market (in all the products/variations he/she creates), But if user changes the Market then he/she can select same or other Warehouse for first time, but after that same validation for that market also.

I tried to override save method of Mediachase.Commerce.InventoryService.InventoryServiceProvider but could not achieve as there is no example for same & this class has some restrictions also.

Thanks

#216020
Jan 22, 2020 11:11
Vote:
 

You can probably intercept the IInventoryService and do you own validations before saving instead. InventoryServiceProvider is an implementation detail and should not be overrided

#216056
Jan 22, 2020 16:00
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.