protected function getPreparedRecord($row, $displayedColumns) { $records = parent::getPreparedRecord($row, $displayedColumns); $currencies = $this->application->getCurrencyArray(); if (!empty($row['children'])) { foreach ($row['children'] as $child) { $priceSetting = $child['childSettings']['price']; foreach ($currencies as $currency) { $priceField = 'price_' . $currency; if (Product::CHILD_ADD == $priceSetting) { $child[$priceField] = '+' . ($child[$priceField] - $row[$priceField]); } else { if (Product::CHILD_SUBSTRACT == $priceSetting) { $child[$priceField] = $child[$priceField] - $row[$priceField]; } } if (empty($child[$priceField])) { $child[$priceField] = ''; } } $weightSetting = $child['childSettings']['weight']; if (Product::CHILD_ADD == $weightSetting) { $child['shippingWeight'] = '+' . ($child['shippingWeight'] + $row['shippingWeight']); } else { if (Product::CHILD_SUBSTRACT == $weightSetting) { $child['shippingWeight'] = $row['shippingWeight'] - $child['shippingWeight']; } } $records = array_merge($records, $this->getPreparedRecord($child, $displayedColumns)); } } return $records; }