Skip to content

Commit 1a478cd

Browse files
committed
chore: address comment
1 parent a0fba5f commit 1a478cd

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/templates/json/JSONTemplate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class JSONTemplate {
7474
constructMPN(variant) {
7575
return variant
7676
? variant.attributes.find((attr) => attr.name.toLowerCase() === 'mpn')?.value ?? this.constructMPN()
77-
: this.product.attributes.find((attr) => attr.name.toLowerCase() === 'mpn')?.value ?? this.product.sku;
77+
: this.product.attributes.find((attr) => attr.name.toLowerCase() === 'mpn')?.value ?? undefined;
7878
}
7979

8080
renderBrand() {

src/templates/json/overrides/wilson-ecommerce--wilson.js

+7
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,11 @@ export default class extends JSONTemplate {
2424
},
2525
};
2626
}
27+
28+
/**
29+
* @param {Variant} [variant]
30+
*/
31+
constructMPN(variant) {
32+
return variant ? variant.sku : this.product.sku;
33+
}
2734
}

0 commit comments

Comments
 (0)