Skip to content

Commit bc40b7d

Browse files
authored
Merge pull request #201 from RachBreeze/v13-ShopifyPrice
Improved support for accessibility and added handle
2 parents a5f4a0b + dbae883 commit bc40b7d

File tree

5 files changed

+19
-2
lines changed

5 files changed

+19
-2
lines changed

src/Umbraco.Cms.Integrations.Commerce.Shopify/Editors/ShopifyProductPickerValueConverter.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,11 @@ public override object ConvertIntermediateToObject(IPublishedElement owner, IPub
6060
Id = p.Id,
6161
Title = p.Title,
6262
Body = p.Body,
63-
Image = p.Image?.Src,
63+
ProductImage = p.Image != null ? new ProductImage { Src = p.Image.Src, Alt = p.Image.Alt } : null,
6464
Tags = p.Tags,
6565
ProductType = p.ProductType,
6666
PublishedScope = p.PublishedScope,
67+
Handle = p.Handle,
6768
Status = p.Status,
6869
Variants = from v in p.Variants
6970
select new VariantViewModel

src/Umbraco.Cms.Integrations.Commerce.Shopify/Models/Dtos/ProductDto.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ public class ProductDto
3434

3535
[JsonProperty("published_scope")]
3636
public string PublishedScope { get; set; }
37+
38+
[JsonProperty("handle")]
39+
public string Handle { get; set; }
3740
}
3841

3942

src/Umbraco.Cms.Integrations.Commerce.Shopify/Models/Dtos/ProductImageDto.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@ public class ProductImageDto
66
{
77
[JsonProperty("src")]
88
public string Src { get; set; }
9+
10+
[JsonProperty("alt")]
11+
public string Alt { get; set; }
912
}
1013
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace Umbraco.Cms.Integrations.Commerce.Shopify.Models.ViewModels
2+
{
3+
public class ProductImage
4+
{
5+
public string Src { get; set; }
6+
public string Alt { get; set; }
7+
}
8+
}

src/Umbraco.Cms.Integrations.Commerce.Shopify/Models/ViewModels/ProductViewModel.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,13 @@ public class ProductViewModel
99
public string Title { get; set; }
1010
public string Body { get; set; }
1111

12-
public string Image { get; set; }
12+
public string Image => ProductImage.Src;
13+
public ProductImage ProductImage { get; set; }
1314
public string ProductType { get; set; }
1415
public string Tags { get; set; }
1516
public string Status { get; set; }
1617
public string PublishedScope { get; set; }
18+
public string Handle { get; set; }
1719
public IEnumerable<VariantViewModel> Variants { get; set; }
1820
}
1921
}

0 commit comments

Comments
 (0)