Browse Source

feat(core): Use variant featuredAsset in OrderLine if available

Relates to #1488. This might technically be viewed as a breaking change, but in another sense it is
finally implementing what seems to be the expected behaviour per an
informal poll I conducted on Slack where 7 of 7 responded that it should
work this way. To me it seems that this is OK to put in a minor release and should not wait until
v2.
Michael Bromley 3 years ago
parent
commit
0c308e2cfc

+ 1 - 1
packages/core/src/service/helpers/order-modifier/order-modifier.ts

@@ -133,7 +133,7 @@ export class OrderModifier {
             new OrderLine({
                 productVariant,
                 taxCategory: productVariant.taxCategory,
-                featuredAsset: productVariant.product.featuredAsset,
+                featuredAsset: productVariant.featuredAsset ?? productVariant.product.featuredAsset,
                 customFields,
             }),
         );