Skip to content

Commit 8214957

Browse files
committed
More quantity unit changes
1 parent 0fa2559 commit 8214957

5 files changed

Lines changed: 9 additions & 4 deletions

File tree

src/Libraries/SmartStore.Core/Domain/Catalog/Product.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ public int? DeliveryTimeId
699699
public virtual DeliveryTime DeliveryTime { get; set; }
700700

701701
/// <summary>
702-
/// Gets or sets the delivery time identifier
702+
/// Gets or sets the quantity unit identifier
703703
/// </summary>
704704
[DataMember]
705705
public int? QuantityUnitId

src/Libraries/SmartStore.Data/Migrations/201501291135374_QuantityUnits.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ public void MigrateLocaleResources(LocaleResourcesBuilder builder)
9797

9898
builder.AddOrUpdate("Admin.Configuration.Settings.Catalog.ShowDefaultQuantityUnit",
9999
"Show default quantity unit",
100-
"Zeige die Standard-Verpackungseinheit");
100+
"Zeige die Standard-Verpackungseinheit",
101+
"Show default quantity unit if the product has no quantity unit set.",
102+
"Zeige die Standard-Verpackungseinheit, falls für das Produkt keine Verpackungseinheit festgelegt ist.");
101103

102104
}
103105
}

src/Libraries/SmartStore.Services/Catalog/ProductExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ public static void MergeWithCombination(this Product product, ProductVariantAttr
7171
if (combination.DeliveryTimeId.HasValue && combination.DeliveryTimeId.Value > 0)
7272
product.MergedDataValues.Add("DeliveryTimeId", combination.DeliveryTimeId);
7373

74+
if (combination.QuantityUnitId.HasValue && combination.QuantityUnitId.Value > 0)
75+
product.MergedDataValues.Add("QuantityUnitId", combination.QuantityUnitId);
76+
7477
if (combination.Length.HasValue)
7578
product.MergedDataValues.Add("Length", combination.Length.Value);
7679
if (combination.Width.HasValue)

src/Libraries/SmartStore.Services/Directory/QuantityService.cs renamed to src/Libraries/SmartStore.Services/Directory/QuantityUnitService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ from p in _productRepository.Table
108108
/// <returns>QuantityUnit</returns>
109109
public virtual QuantityUnit GetQuantityUnitById(int? quantityUnitId)
110110
{
111-
if (quantityUnitId == 0 || quantityUnitId == null)
111+
if (quantityUnitId == null || quantityUnitId == 0)
112112
{
113113
if(_catalogSettings.ShowDefaultQuantityUnit)
114114
{

src/Libraries/SmartStore.Services/SmartStore.Services.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@
151151
<Compile Include="..\..\AssemblyVersionInfo.cs">
152152
<Link>Properties\AssemblyVersionInfo.cs</Link>
153153
</Compile>
154-
<Compile Include="Directory\QuantityService.cs" />
154+
<Compile Include="Directory\QuantityUnitService.cs" />
155155
<Compile Include="Directory\IQuantityUnitService.cs" />
156156
<Compile Include="Hooks\StoreMappingEntityPostDeleteHook.cs" />
157157
<Compile Include="Pdf\Content\PdfHtmlContent.cs" />

0 commit comments

Comments
 (0)