/** * @param Total $totalInstance * @param array $output * @return array */ protected function merge($totalInstance, $output) { if (array_key_exists($totalInstance->getCode(), $output)) { $output[$totalInstance->getCode()] = $output[$totalInstance->getCode()]->addData($totalInstance->getData()); } else { $output[$totalInstance->getCode()] = $totalInstance; } return $output; }
/** * Merge numeric total values * * @param \Magento\Quote\Model\Quote\Address\Total $total * @return $this */ public function merge(\Magento\Quote\Model\Quote\Address\Total $total) { $newData = $total->getData(); foreach ($newData as $key => $value) { if (is_numeric($value)) { $this->setData($key, $this->_getData($key) + $value); } } return $this; }