• Модуль: catalogmobile
  • Путь к файлу: ~/bitrix/modules/catalogmobile/lib/ProductWizard/SaveProductCommand.php
  • Класс: BitrixCatalogMobileProductWizardSaveProductCommand
  • Вызов: SaveProductCommand::finalize
private function finalize(int $variationId): Result
{
	$result = new Result();

	$variation = $this->getVariation($variationId);
	if (!$variation)
	{
		return $result;
	}

	$parentProduct = $variation->getParent();
	if (!$parentProduct)
	{
		return $result;
	}

	$name = $this->fields['NAME'];
	if (isset($name) && $parentProduct->getField('NAME') !== $name)
	{
		$parentProduct->setField('NAME', $name);
		$result = $parentProduct->save();
	}

	if ($result->isSuccess())
	{
		$result->setData($this->getProductData($variation));
	}

	return $result;
}