@@ -54,15 +54,14 @@ public override StoreArtifact GetArtifact(GuidUdi udi, StoreReadOnly entity)
54
54
if ( entity == null )
55
55
return null ;
56
56
57
- // TODO: Add the "defaults" as dependencies?
58
-
59
57
var dependencies = new ArtifactDependencyCollection ( ) ;
60
58
61
59
#pragma warning disable CS0618 // OrderEditorConfig is obsolete
62
60
var artifact = new StoreArtifact ( udi , dependencies )
63
61
{
64
62
Name = entity . Name ,
65
63
Alias = entity . Alias ,
64
+ MeasurementSystem = entity . MeasurementSystem ,
66
65
PricesIncludeTax = entity . PricesIncludeTax ,
67
66
CookieTimeout = entity . CookieTimeout ,
68
67
CartNumberTemplate = entity . CartNumberTemplate ,
@@ -105,6 +104,15 @@ public override StoreArtifact GetArtifact(GuidUdi udi, StoreReadOnly entity)
105
104
artifact . DefaultTaxClassUdi = depUdi ;
106
105
}
107
106
107
+ // Default location
108
+ if ( entity . DefaultLocationId . HasValue )
109
+ {
110
+ var depUdi = new GuidUdi ( UmbracoCommerceConstants . UdiEntityType . Location , entity . DefaultLocationId . Value ) ;
111
+ var dep = new UmbracoCommerceArtifactDependency ( depUdi ) ;
112
+ dependencies . Add ( dep ) ;
113
+ artifact . DefaultLocationUdi = depUdi ;
114
+ }
115
+
108
116
// Default order status
109
117
if ( entity . DefaultOrderStatusId . HasValue )
110
118
{
@@ -247,6 +255,7 @@ private void Pass1(ArtifactDeployState<StoreArtifact, StoreReadOnly> state, IDep
247
255
248
256
#pragma warning disable CS0618 // SetOrderEditorConfig is obsolete
249
257
entity . SetName ( artifact . Name , artifact . Alias )
258
+ . SetMeasurementSystem ( artifact . MeasurementSystem )
250
259
. SetPriceTaxInclusivity ( artifact . PricesIncludeTax )
251
260
. SetCartNumberTemplate ( artifact . CartNumberTemplate )
252
261
. SetOrderNumberTemplate ( artifact . OrderNumberTemplate )
@@ -341,6 +350,18 @@ private void Pass4(ArtifactDeployState<StoreArtifact, StoreReadOnly> state, IDep
341
350
342
351
entity . SetDefaultTaxClass ( defaultTaxClassId ) ;
343
352
353
+ // DefaultLocation
354
+ Guid ? defaultLocationId = null ;
355
+
356
+ if ( artifact . DefaultLocationUdi != null )
357
+ {
358
+ artifact . DefaultLocationUdi . EnsureType ( UmbracoCommerceConstants . UdiEntityType . Location ) ;
359
+
360
+ defaultLocationId = _umbracoCommerceApi . GetLocation ( artifact . DefaultLocationUdi . Guid ) ? . Id ;
361
+ }
362
+
363
+ entity . SetDefaultLocation ( defaultLocationId ) ;
364
+
344
365
// DefaultOrderStatus
345
366
Guid ? defaultOrderStatusId = null ;
346
367
0 commit comments