I want to get all the inventory stock for each source in the product grid.
So far, I’ve added the column, with success, by adding to Vendor/Module/etc/adminhtml/di.xml:
- VendorModuleUiDataProviderProductAddStockFieldToCollection
Also created the file and confirmed it’s being executed VendorModuleUiDataProviderProductAddStockFieldToCollection.php with:
< ?php
namespace VendorModuleUiDataProviderProduct;
class AddStockFieldToCollection implements MagentoUiDataProviderAddFieldToCollectionInterface
{
public function addField(MagentoFrameworkDataCollection $collection, $field, $alias = null)
{
/* code */
}
}
In addField, i was able to joinField or joinTable (but only a single one). I want to group_concat inventory source code with corresponding quantity.
I tried using vendormagentomodule-catalogUiComponentListingColumnsWebsites.php as a reference, but this only uses website name.