Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCC-186: Product Image #352

Merged
merged 12 commits into from
Sep 23, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
using OrchardCore.ContentManagement.Metadata;
using OrchardCore.ContentManagement.Metadata.Settings;
using OrchardCore.Data.Migration;
using OrchardCore.Media.Fields;
using OrchardCore.Media.Settings;
using YesSql.Sql;

namespace OrchardCore.Commerce.Migrations;
Expand All @@ -21,6 +23,10 @@ public int Create()
{
_contentDefinitionManager
.AlterPartDefinition(nameof(ProductPart), builder => builder
sarahelsaig marked this conversation as resolved.
Show resolved Hide resolved
.WithField("ProductImage", field => field
sarahelsaig marked this conversation as resolved.
Show resolved Hide resolved
sarahelsaig marked this conversation as resolved.
Show resolved Hide resolved
.OfType(nameof(MediaField))
.WithDisplayName("Product Image")
.WithSettings(new MediaFieldSettings { Multiple = false }))
.Attachable()
.WithDescription("Makes a content item into a product."));

Expand Down
7 changes: 7 additions & 0 deletions src/Modules/OrchardCore.Commerce/OrchardCore.Commerce.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@
<ProjectReference Include="..\OrchardCore.Commerce.Tax\OrchardCore.Commerce.Tax.csproj" />
<ProjectReference Include="..\OrchardCore.Commerce.Inventory\OrchardCore.Commerce.Inventory.csproj" />
</ItemGroup>

<ItemGroup>
<None Update="Recipes\Media\**\*.*">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

<PropertyGroup>
<LombiqNodeJsExtensionsPath>..\..\..\..\..\Utilities\Lombiq.NodeJs.Extensions\Lombiq.NodeJs.Extensions</LombiqNodeJsExtensionsPath>
</PropertyGroup>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,15 @@
"ProductSku": "TESTPRODUCTVARIANT"
},
"ProductPart": {
"Sku": "TESTPRODUCTVARIANT"
"Sku": "TESTPRODUCTVARIANT",
"ProductImage": {
"Paths": [
"Product Images/sample-product-image.png"
],
"MediaTexts": [
""
]
}
},
"ContainedPart": {
"ListContentItemId": "mainproductlist00000000000",
Expand Down Expand Up @@ -204,7 +212,15 @@
"Html": ""
},
"ProductPart": {
"Sku": "TESTPRODUCT"
"Sku": "TESTPRODUCT",
"ProductImage": {
"Paths": [
"Product Images/sample-product-image.png"
sarahelsaig marked this conversation as resolved.
Show resolved Hide resolved
],
"MediaTexts": [
""
]
}
},
"PricePart": {
"Price": {
Expand Down Expand Up @@ -269,7 +285,15 @@
"Html": ""
},
"ProductPart": {
"Sku": "TESTFREEPRODUCT"
"Sku": "TESTFREEPRODUCT",
"ProductImage": {
"Paths": [
"Product Images/sample-product-image.png"
],
"MediaTexts": [
""
]
}
},
"PricePart": {
"Price": {
Expand Down Expand Up @@ -334,7 +358,15 @@
"Html": ""
},
"ProductPart": {
"Sku": "TESTDISCOUNTEDPRODUCT"
"Sku": "TESTDISCOUNTEDPRODUCT",
"ProductImage": {
"Paths": [
"Product Images/sample-product-image.png"
],
"MediaTexts": [
""
]
}
},
"PricePart": {
"Price": {
Expand Down Expand Up @@ -414,6 +446,14 @@
},
"ProductPart": {
"Sku": "LOCALIZED",
"ProductImage": {
"Paths": [
"Product Images/sample-product-image.png"
],
"MediaTexts": [
""
]
},
"CanBeBought": {}
},
"PricePart": {
Expand All @@ -435,6 +475,15 @@
}
}
]
},
{
"name": "media",
"Files": [
{
"SourcePath": "Media/Product Images/sample-product-image.png",
"TargetPath": "Product Images/sample-product-image.png"
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Lombiq.Tests.UI.Attributes;
using Lombiq.Tests.UI.Attributes;
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Services;
using OpenQA.Selenium;
Expand Down