Quantity 0 for configurable product
-
Hi, I would like to display the sum of the quantity of all variations associated to a configurable product. Actually, within the ProductDataGrid, the prepareQueryBuilder contains this:
DB::raw('SUM(DISTINCT ' . DB::getTablePrefix() . 'product_inventories.qty) as quantity')
is there a way to sum the quantity of all the variations in a configurable product instead of display 0?
-
Hi there,
presently we are not providing the condition to show the sum of all the variants.
-
@Amitk-Webkul said in Quantity 0 for configurable product:
Hi there,
presently we are not providing the condition to show the sum of all the variants.
is there a way to achieve this?
-
Yes, you can do it. You need to do the summation of all the child products. For that we have
product_inventories
.