23 if (!empty($elementFields))
25 $result = parent::saveElement($id, $elementFields);
33 $product = ServiceContainer::getProductRepository($this->
getIblockId())->getEntityById($id);
38 $sku = $product->getSkuCollection()->getFirst();
51 $sku = ServiceContainer::getSkuRepository($this->
getIblockId())->getEntityById($id);
76 $priceColumns = $this->getPriceColumns();
77 $productColumns = $this->getProductColumns();
81 if (isset($productColumns[
$name]))
83 if (
$name ===
'PURCHASING_PRICE')
87 if (isset($value[
'PRICE'][
'VALUE']))
90 $value[
'PRICE'][
'VALUE'] ===
''
92 : $value[
'PRICE'][
'VALUE']
94 $productFields[
'PURCHASING_CURRENCY'] = $value[
'CURRENCY'][
'VALUE'] ??
null;
109 $priceTypeId = PriceProvider::parsePriceTypeId(
$name);
110 if (isset($priceTypeId))
113 'PRICE' => $value[
'PRICE'][
'VALUE'] ??
null,
114 'CURRENCY' => $value[
'CURRENCY'][
'VALUE'] ??
null,
120 $elementFields[
$name] = $value;
130 private function getPriceColumns():
array
134 $availableColumnsIds = [];
137 $id = PriceProvider::getPriceTypeColumnId(
$type[
'ID']);
138 $availableColumnsIds[$id] =
true;
143 $id = $column->getId();
144 if (isset($availableColumnsIds[$id]))
156 private function getProductColumns():
array
160 $availableColumnsIds = array_fill_keys([
166 'PURCHASING_CURRENCY',
180 $id = $column->getId();
181 if (isset($availableColumnsIds[$id]))
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)