diff --git a/NetoDotNET.Examples/Program.cs b/NetoDotNET.Examples/Program.cs index 9e96740..4556fcb 100644 --- a/NetoDotNET.Examples/Program.cs +++ b/NetoDotNET.Examples/Program.cs @@ -37,11 +37,11 @@ static void Main(string[] args) var neto = new StoreManager(config.GetSection("NETO_STORE_URL").Value, config.GetSection("NETO_API_KEY").Value, config.GetSection("NETO_USERNAME").Value); #region Products - GetItems(neto); + //GetItems(neto); //GetItemsFromDate(neto); // AddItems(neto); - //AddVariableItems(neto); + AddVariableItems(neto); //UpdateItems(neto); #endregion @@ -800,19 +800,51 @@ static void AddVariableItems(StoreManager neto) new NewItem { Name = "Variable Item", SKU = "VAR", - DefaultPrice = 1.00m, + DefaultPrice = 1.00m }, new NewItem { Name = "Variable Item", SKU = "VAR1", DefaultPrice = 1.00m, - ParentSKU = "VAR" + ParentSKU = "VAR", + ItemSpecifics = new ItemSpecifics + { + ItemSpecific = new List + { + new ItemSpecific() + { + Name = "Size", + Value = "1" + }, + new ItemSpecific() + { + Name = "Colour", + Value = "RED" + } + } + } }, new NewItem { Name = "Variable Item", SKU = "VAR2", DefaultPrice = 1.00m, - ParentSKU = "VAR" + ParentSKU = "VAR", + ItemSpecifics = new ItemSpecifics + { + ItemSpecific = new List + { + new ItemSpecific() + { + Name = "Size", + Value = "2" + }, + new ItemSpecific() + { + Name = "Colour", + Value = "RED" + } + } + } } }; diff --git a/NetoDotNET.Examples/appsettings.example.json b/NetoDotNET.Examples/appsettings.example.json index 84c643c..6bdfb55 100644 --- a/NetoDotNET.Examples/appsettings.example.json +++ b/NetoDotNET.Examples/appsettings.example.json @@ -1,5 +1,5 @@ { - "NETO_STORENAME": "", + "NETO_STORE_URL": "", "NETO_API_KEY": "", "NETO_USERNAME": "" } diff --git a/NetoDotNET/Entities/Product/ItemBase.cs b/NetoDotNET/Entities/Product/ItemBase.cs index f0b969e..3b1d63d 100644 --- a/NetoDotNET/Entities/Product/ItemBase.cs +++ b/NetoDotNET/Entities/Product/ItemBase.cs @@ -370,8 +370,8 @@ public class ItemBase [JsonConverter(typeof(SingleOrArrayConverter))] public List Categories { get; set; } - [JsonConverter(typeof(SingleOrArrayConverter))] - public List ItemSpecifics { get; set; } + public ItemSpecifics ItemSpecifics { get; set; } + [JsonConverter(typeof(SingleOrArrayConverter))] public List WarehouseQuantity { get; set; } @@ -382,6 +382,8 @@ public class ItemBase public List RelatedContents { get; set; } } + + public class WarehouseQuantity { public string WarehouseID { get; set; } @@ -430,13 +432,15 @@ public class PriceGroup public class ItemSpecifics { - public ItemSpecific ItemSpecific { get; set; } + [JsonConverter(typeof(SingleOrArrayConverter))] + public List ItemSpecific { get; set; } } public class ItemSpecific { public string Name { get; set; } public string Value { get; set; } + public int SortOrder { get; set; } } diff --git a/NetoDotNET/NetoDotNET.csproj b/NetoDotNET/NetoDotNET.csproj index c425be6..637c94d 100644 --- a/NetoDotNET/NetoDotNET.csproj +++ b/NetoDotNET/NetoDotNET.csproj @@ -17,6 +17,12 @@ 0.2.2 + + DEBUG;TRACE + full + true + +