1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-02-19 19:44:28 +02:00
This commit is contained in:
Anton 2024-10-15 20:32:39 +03:00
commit 6e32c85ba9
53 changed files with 7488 additions and 5136 deletions

View File

@ -1,5 +1,5 @@
 ClientID = "2128753";  ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Result = OPI_Ozon.ArchiveProducts(ClientID, APIKey, ProductID); Result = OPI_Ozon.ArchiveProducts(ClientID, APIKey, ProductID);

View File

@ -1,5 +1,5 @@
 ClientID = "2128753";  ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Result = OPI_Ozon.CheckProductsImagesUpload(ClientID, APIKey, ProductID); Result = OPI_Ozon.CheckProductsImagesUpload(ClientID, APIKey, ProductID);

View File

@ -1,5 +1,5 @@
 ClientID = "2128753";  ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Result = OPI_Ozon.CreateBarcodes(ClientID, APIKey, ProductID); Result = OPI_Ozon.CreateBarcodes(ClientID, APIKey, ProductID);

View File

@ -2,7 +2,7 @@
ClientID = "2128753"; ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Result = OPI_Ozon.ArchiveProducts(ClientID, APIKey, ProductID); Result = OPI_Ozon.ArchiveProducts(ClientID, APIKey, ProductID);

View File

@ -1,5 +1,5 @@
 ClientID = "2128753";  ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
TaskID = "1352681806"; TaskID = "1357826533";
Result = OPI_Ozon.GetProductCreationStatus(ClientID, APIKey, TaskID); Result = OPI_Ozon.GetProductCreationStatus(ClientID, APIKey, TaskID);

View File

@ -1,5 +1,5 @@
 ClientID = "2128753";  ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Result = OPI_Ozon.UnarchiveProducts(ClientID, APIKey, ProductID); Result = OPI_Ozon.UnarchiveProducts(ClientID, APIKey, ProductID);

View File

@ -1,6 +1,6 @@
 ClientID = "2128753";  ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Image1 = "https://api.athenaeum.digital/test_data/picture.jpg"; Image1 = "https://api.athenaeum.digital/test_data/picture.jpg";
Image2 = "https://api.athenaeum.digital/test_data/picture2.jpg"; Image2 = "https://api.athenaeum.digital/test_data/picture2.jpg";

View File

@ -1,6 +1,6 @@
 ClientID = "2128753";  ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Prices = New Structure; Prices = New Structure;
Prices.Insert("auto_action_enabled" , "DISABLED"); Prices.Insert("auto_action_enabled" , "DISABLED");

View File

@ -1,6 +1,6 @@
 ClientID = "2128753";  ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Stocks = New Structure; Stocks = New Structure;
Stocks.Insert("offer_id" , "143210610"); Stocks.Insert("offer_id" , "143210610");

View File

@ -1,6 +1,6 @@
 ClientID = "2128753";  ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Codes = New Array; Codes = New Array;
Codes.Add("11111111"); Codes.Add("11111111");

View File

@ -36,7 +36,7 @@ You can create barcodes for a maximum of 100 products per request
```bsl title="Code example" ```bsl title="Code example"
ClientID = "2128753"; ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Result = OPI_Ozon.CreateBarcodes(ClientID, APIKey, ProductID); Result = OPI_Ozon.CreateBarcodes(ClientID, APIKey, ProductID);
``` ```

View File

@ -32,7 +32,7 @@ Method at API documentation: [post /v1/product/import/prices](https://docs.ozon.
```bsl title="Code example" ```bsl title="Code example"
ClientID = "2128753"; ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Prices = New Structure; Prices = New Structure;
Prices.Insert("auto_action_enabled" , "DISABLED"); Prices.Insert("auto_action_enabled" , "DISABLED");

View File

@ -38,7 +38,7 @@ You can change availability for 100 products per request. You can send up to 80
```bsl title="Code example" ```bsl title="Code example"
ClientID = "2128753"; ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Stocks = New Structure; Stocks = New Structure;
Stocks.Insert("offer_id" , "143210610"); Stocks.Insert("offer_id" , "143210610");

View File

@ -34,7 +34,7 @@ You can pass up to 100 identifiers at a time
```bsl title="Code example" ```bsl title="Code example"
ClientID = "2128753"; ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Result = OPI_Ozon.ArchiveProducts(ClientID, APIKey, ProductID); Result = OPI_Ozon.ArchiveProducts(ClientID, APIKey, ProductID);
``` ```

View File

@ -32,7 +32,7 @@ Method at API documentation: [post /v1/product/pictures/info](https://docs.ozon.
```bsl title="Code example" ```bsl title="Code example"
ClientID = "2128753"; ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Result = OPI_Ozon.CheckProductsImagesUpload(ClientID, APIKey, ProductID); Result = OPI_Ozon.CheckProductsImagesUpload(ClientID, APIKey, ProductID);
``` ```

View File

@ -38,7 +38,7 @@ The product must be pre-archived (see ArchiveProducts)
ClientID = "2128753"; ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Result = OPI_Ozon.ArchiveProducts(ClientID, APIKey, ProductID); Result = OPI_Ozon.ArchiveProducts(ClientID, APIKey, ProductID);

View File

@ -32,7 +32,7 @@ Method at API documentation: [post /v1/product/import/info](https://docs.ozon.ru
```bsl title="Code example" ```bsl title="Code example"
ClientID = "2128753"; ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
TaskID = "1352681806"; TaskID = "1357826533";
Result = OPI_Ozon.GetProductCreationStatus(ClientID, APIKey, TaskID); Result = OPI_Ozon.GetProductCreationStatus(ClientID, APIKey, TaskID);
``` ```

View File

@ -34,7 +34,7 @@ You can restore from the archive no more than 10 products that were automaticall
```bsl title="Code example" ```bsl title="Code example"
ClientID = "2128753"; ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Result = OPI_Ozon.UnarchiveProducts(ClientID, APIKey, ProductID); Result = OPI_Ozon.UnarchiveProducts(ClientID, APIKey, ProductID);
``` ```

View File

@ -41,7 +41,7 @@ On each method call, send all the images that should be on the product card
```bsl title="Code example" ```bsl title="Code example"
ClientID = "2128753"; ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Image1 = "https://api.athenaeum.digital/test_data/picture.jpg"; Image1 = "https://api.athenaeum.digital/test_data/picture.jpg";
Image2 = "https://api.athenaeum.digital/test_data/picture2.jpg"; Image2 = "https://api.athenaeum.digital/test_data/picture2.jpg";

View File

@ -37,7 +37,7 @@ The activation code is linked to the digital product card
```bsl title="Code example" ```bsl title="Code example"
ClientID = "2128753"; ClientID = "2128753";
APIKey = "7cc90d26-33e4-499b..."; APIKey = "7cc90d26-33e4-499b...";
ProductID = "1220696576"; ProductID = "1224992624";
Codes = New Array; Codes = New Array;
Codes.Add("11111111"); Codes.Add("11111111");

View File

@ -1,5 +1,5 @@
 IDКлиента = "2128753";  IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Результат = OPI_Ozon.АрхивироватьТовары(IDКлиента, КлючAPI, IDТовара); Результат = OPI_Ozon.АрхивироватьТовары(IDКлиента, КлючAPI, IDТовара);

View File

@ -1,6 +1,6 @@
 IDКлиента = "2128753";  IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Коды = Новый Массив; Коды = Новый Массив;
Коды.Добавить("11111111"); Коды.Добавить("11111111");

View File

@ -1,6 +1,6 @@
 IDКлиента = "2128753";  IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Картинка1 = "https://api.athenaeum.digital/test_data/picture.jpg"; Картинка1 = "https://api.athenaeum.digital/test_data/picture.jpg";
Картинка2 = "https://api.athenaeum.digital/test_data/picture2.jpg"; Картинка2 = "https://api.athenaeum.digital/test_data/picture2.jpg";

View File

@ -1,6 +1,6 @@
 IDКлиента = "2128753";  IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Остатки = Новый Структура; Остатки = Новый Структура;
Остатки.Вставить("offer_id" , "143210610"); Остатки.Вставить("offer_id" , "143210610");

View File

@ -1,6 +1,6 @@
 IDКлиента = "2128753";  IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Цены = Новый Структура; Цены = Новый Структура;
Цены.Вставить("auto_action_enabled" , "DISABLED"); Цены.Вставить("auto_action_enabled" , "DISABLED");

View File

@ -1,5 +1,5 @@
 IDКлиента = "2128753";  IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDЗадачи = "1352681806"; IDЗадачи = "1357826533";
Результат = OPI_Ozon.ПолучитьСтатусДобавленияТовара(IDКлиента, КлючAPI, IDЗадачи); Результат = OPI_Ozon.ПолучитьСтатусДобавленияТовара(IDКлиента, КлючAPI, IDЗадачи);

View File

@ -1,5 +1,5 @@
 IDКлиента = "2128753";  IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Результат = OPI_Ozon.ПроверитьЗагрузкуИзображенийТоваров(IDКлиента, КлючAPI, IDТовара); Результат = OPI_Ozon.ПроверитьЗагрузкуИзображенийТоваров(IDКлиента, КлючAPI, IDТовара);

View File

@ -1,5 +1,5 @@
 IDКлиента = "2128753";  IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Результат = OPI_Ozon.РазархивироватьТовары(IDКлиента, КлючAPI, IDТовара); Результат = OPI_Ozon.РазархивироватьТовары(IDКлиента, КлючAPI, IDТовара);

View File

@ -1,5 +1,5 @@
 IDКлиента = "2128753";  IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Результат = OPI_Ozon.СоздатьШтрихкоды(IDКлиента, КлючAPI, IDТовара); Результат = OPI_Ozon.СоздатьШтрихкоды(IDКлиента, КлючAPI, IDТовара);

View File

@ -2,7 +2,7 @@
IDКлиента = "2128753"; IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Результат = OPI_Ozon.АрхивироватьТовары(IDКлиента, КлючAPI, IDТовара); Результат = OPI_Ozon.АрхивироватьТовары(IDКлиента, КлючAPI, IDТовара);

View File

@ -36,7 +36,7 @@ import TabItem from '@theme/TabItem';
```bsl title="Пример кода" ```bsl title="Пример кода"
IDКлиента = "2128753"; IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Результат = OPI_Ozon.СоздатьШтрихкоды(IDКлиента, КлючAPI, IDТовара); Результат = OPI_Ozon.СоздатьШтрихкоды(IDКлиента, КлючAPI, IDТовара);
``` ```

View File

@ -32,7 +32,7 @@ import TabItem from '@theme/TabItem';
```bsl title="Пример кода" ```bsl title="Пример кода"
IDКлиента = "2128753"; IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Цены = Новый Структура; Цены = Новый Структура;
Цены.Вставить("auto_action_enabled" , "DISABLED"); Цены.Вставить("auto_action_enabled" , "DISABLED");

View File

@ -38,7 +38,7 @@ import TabItem from '@theme/TabItem';
```bsl title="Пример кода" ```bsl title="Пример кода"
IDКлиента = "2128753"; IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Остатки = Новый Структура; Остатки = Новый Структура;
Остатки.Вставить("offer_id" , "143210610"); Остатки.Вставить("offer_id" , "143210610");

View File

@ -34,7 +34,7 @@ import TabItem from '@theme/TabItem';
```bsl title="Пример кода" ```bsl title="Пример кода"
IDКлиента = "2128753"; IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Результат = OPI_Ozon.АрхивироватьТовары(IDКлиента, КлючAPI, IDТовара); Результат = OPI_Ozon.АрхивироватьТовары(IDКлиента, КлючAPI, IDТовара);
``` ```

View File

@ -32,7 +32,7 @@ import TabItem from '@theme/TabItem';
```bsl title="Пример кода" ```bsl title="Пример кода"
IDКлиента = "2128753"; IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Результат = OPI_Ozon.ПроверитьЗагрузкуИзображенийТоваров(IDКлиента, КлючAPI, IDТовара); Результат = OPI_Ozon.ПроверитьЗагрузкуИзображенийТоваров(IDКлиента, КлючAPI, IDТовара);
``` ```

View File

@ -38,7 +38,7 @@ import TabItem from '@theme/TabItem';
IDКлиента = "2128753"; IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Результат = OPI_Ozon.АрхивироватьТовары(IDКлиента, КлючAPI, IDТовара); Результат = OPI_Ozon.АрхивироватьТовары(IDКлиента, КлючAPI, IDТовара);

View File

@ -32,7 +32,7 @@ import TabItem from '@theme/TabItem';
```bsl title="Пример кода" ```bsl title="Пример кода"
IDКлиента = "2128753"; IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDЗадачи = "1352681806"; IDЗадачи = "1357826533";
Результат = OPI_Ozon.ПолучитьСтатусДобавленияТовара(IDКлиента, КлючAPI, IDЗадачи); Результат = OPI_Ozon.ПолучитьСтатусДобавленияТовара(IDКлиента, КлючAPI, IDЗадачи);
``` ```

View File

@ -34,7 +34,7 @@ import TabItem from '@theme/TabItem';
```bsl title="Пример кода" ```bsl title="Пример кода"
IDКлиента = "2128753"; IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Результат = OPI_Ozon.РазархивироватьТовары(IDКлиента, КлючAPI, IDТовара); Результат = OPI_Ozon.РазархивироватьТовары(IDКлиента, КлючAPI, IDТовара);
``` ```

View File

@ -41,7 +41,7 @@ import TabItem from '@theme/TabItem';
```bsl title="Пример кода" ```bsl title="Пример кода"
IDКлиента = "2128753"; IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Картинка1 = "https://api.athenaeum.digital/test_data/picture.jpg"; Картинка1 = "https://api.athenaeum.digital/test_data/picture.jpg";
Картинка2 = "https://api.athenaeum.digital/test_data/picture2.jpg"; Картинка2 = "https://api.athenaeum.digital/test_data/picture2.jpg";

View File

@ -37,7 +37,7 @@ import TabItem from '@theme/TabItem';
```bsl title="Пример кода" ```bsl title="Пример кода"
IDКлиента = "2128753"; IDКлиента = "2128753";
КлючAPI = "7cc90d26-33e4-499b..."; КлючAPI = "7cc90d26-33e4-499b...";
IDТовара = "1220696576"; IDТовара = "1224992624";
Коды = Новый Массив; Коды = Новый Массив;
Коды.Добавить("11111111"); Коды.Добавить("11111111");

File diff suppressed because it is too large Load Diff

View File

@ -995,7 +995,7 @@ Function AddProductVideo(ItemStructure, Val URL, Val Name) Export
CompleteComplexAttribute(VideoObject, 21841, 100001, URLStructure); CompleteComplexAttribute(VideoObject, 21841, 100001, URLStructure);
CompleteComplexAttribute(VideoObject, 21837, 100001, NameStructure); CompleteComplexAttribute(VideoObject, 21837, 100001, NameStructure);
If Not ItemStructure.Property("complex_attributes") Then If Not OPI_Tools.CollectionFieldExist(ItemStructure, "complex_attributes") Then
ItemStructure.Insert("complex_attributes", New Array); ItemStructure.Insert("complex_attributes", New Array);
EndIf; EndIf;
@ -1028,7 +1028,7 @@ Function AddProductVideoCover(ItemStructure, Val URL) Export
CompleteComplexAttribute(CoverObject, 21845, 100002, URLStructure); CompleteComplexAttribute(CoverObject, 21845, 100002, URLStructure);
If Not ItemStructure.Property("complex_attributes") Then If Not OPI_Tools.CollectionFieldExist(ItemStructure, "complex_attributes") Then
ItemStructure.Insert("complex_attributes", New Array); ItemStructure.Insert("complex_attributes", New Array);
EndIf; EndIf;
@ -1056,10 +1056,11 @@ EndFunction
Function CompleteComplexAttribute(Collection, Val AttributeID, Val ComplexID, Val Values) Export Function CompleteComplexAttribute(Collection, Val AttributeID, Val ComplexID, Val Values) Export
OPI_TypeConversion.GetArray(Values); OPI_TypeConversion.GetArray(Values);
OPI_TypeConversion.GetCollection(Collection);
AttributeStructure = New Structure("id,complex_id,values", AttributeID, ComplexID, Values); AttributeStructure = New Structure("id,complex_id,values", AttributeID, ComplexID, Values);
If Not Collection.Property("attributes") Then If Not OPI_Tools.CollectionFieldExist(Collection, "attributes") Then
Collection.Insert("attributes", New Array); Collection.Insert("attributes", New Array);
EndIf; EndIf;

File diff suppressed because it is too large Load Diff

View File

@ -427,6 +427,26 @@ Function ConvertDataWithSizeRetrieval(Data, Val MinimumStreamSize = 0) Export
EndFunction EndFunction
Function CollectionFieldExist(Val Collection, Val Field) Export
CollectionType = TypeOf(Collection);
If CollectionType = Type("Structure") Then
Return Collection.Property(Field);
ElsIf CollectionType = Type("Map") Then
Return Collection["Field"] <> Undefined;
Else
Raise "The specified value is not a valid collection!";
EndIf;
EndFunction
Function ClearCollectionRecursively(Val Collection) Export Function ClearCollectionRecursively(Val Collection) Export
ValeType = TypeOf(Collection); ValeType = TypeOf(Collection);

View File

@ -995,7 +995,7 @@ Function AddProductVideo(ItemStructure, Val URL, Val Name) Export
CompleteComplexAttribute(VideoObject, 21841, 100001, URLStructure); CompleteComplexAttribute(VideoObject, 21841, 100001, URLStructure);
CompleteComplexAttribute(VideoObject, 21837, 100001, NameStructure); CompleteComplexAttribute(VideoObject, 21837, 100001, NameStructure);
If Not ItemStructure.Property("complex_attributes") Then If Not OPI_Tools.CollectionFieldExists(ItemStructure, "complex_attributes") Then
ItemStructure.Insert("complex_attributes", New Array); ItemStructure.Insert("complex_attributes", New Array);
EndIf; EndIf;
@ -1028,7 +1028,7 @@ Function AddProductVideoCover(ItemStructure, Val URL) Export
CompleteComplexAttribute(CoverObject, 21845, 100002, URLStructure); CompleteComplexAttribute(CoverObject, 21845, 100002, URLStructure);
If Not ItemStructure.Property("complex_attributes") Then If Not OPI_Tools.CollectionFieldExists(ItemStructure, "complex_attributes") Then
ItemStructure.Insert("complex_attributes", New Array); ItemStructure.Insert("complex_attributes", New Array);
EndIf; EndIf;
@ -1056,10 +1056,11 @@ EndFunction
Function CompleteComplexAttribute(Collection, Val AttributeID, Val ComplexID, Val Values) Export Function CompleteComplexAttribute(Collection, Val AttributeID, Val ComplexID, Val Values) Export
OPI_TypeConversion.GetArray(Values); OPI_TypeConversion.GetArray(Values);
OPI_TypeConversion.GetCollection(Collection);
AttributeStructure = New Structure("id,complex_id,values", AttributeID, ComplexID, Values); AttributeStructure = New Structure("id,complex_id,values", AttributeID, ComplexID, Values);
If Not Collection.Property("attributes") Then If Not OPI_Tools.CollectionFieldExists(Collection, "attributes") Then
Collection.Insert("attributes", New Array); Collection.Insert("attributes", New Array);
EndIf; EndIf;

File diff suppressed because it is too large Load Diff

View File

@ -427,6 +427,26 @@ Function ConvertDataWithSizeRetrieval(Data, Val MinimumStreamSize = 0) Export
EndFunction EndFunction
Function CollectionFieldExists(Val Collection, Val Field) Export
CollectionType = TypeOf(Collection);
If CollectionType = Type("Structure") Then
Return Collection.Property(Field);
ElsIf CollectionType = Type("Map") Then
Return Collection["Field"] <> Undefined;
Else
Raise "The specified value is not a valid collection!";
EndIf;
EndFunction
Function ClearCollectionRecursively(Val Collection) Export Function ClearCollectionRecursively(Val Collection) Export
ValeType = TypeOf(Collection); ValeType = TypeOf(Collection);

View File

@ -1,4 +1,4 @@
// OneScript: ./OInt/core/Modules/OPI_Ozon.os // OneScript: ./OInt/core/Modules/OPI_Ozon.os
// Lib: Ozon // Lib: Ozon
// CLI: ozon // CLI: ozon

View File

@ -1,4 +1,4 @@
// OneScript: ./OInt/tools/Modules/internal/Modules/OPI_Инструменты.os // OneScript: ./OInt/tools/Modules/internal/Modules/OPI_Инструменты.os
// MIT License // MIT License