@reactionary/provider-commercetools 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@reactionary/provider-commercetools",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "main": "index.js",
5
5
  "types": "src/index.d.ts",
6
6
  "dependencies": {
7
- "@reactionary/core": "0.1.3",
7
+ "@reactionary/core": "0.1.5",
8
8
  "debug": "^4.4.3",
9
9
  "zod": "4.1.9",
10
10
  "@commercetools/ts-client": "^4.2.1",
@@ -82,6 +82,12 @@ class CommercetoolsProductProvider extends ProductProvider {
82
82
  ...variantLevelAttributes
83
83
  ];
84
84
  const mainVariant = this.parseVariant(data.masterVariant, data);
85
+ const otherVariants = [];
86
+ for (const variant of data.variants || []) {
87
+ if (variant.id !== data.masterVariant.id) {
88
+ otherVariants.push(this.parseVariant(variant, data));
89
+ }
90
+ }
85
91
  const meta = {
86
92
  cache: { hit: false, key: this.generateCacheKeySingle(identifier) },
87
93
  placeholder: false
@@ -99,7 +105,8 @@ class CommercetoolsProductProvider extends ProductProvider {
99
105
  manufacturer: "",
100
106
  options: [],
101
107
  parentCategories: [],
102
- published: true
108
+ published: true,
109
+ variants: otherVariants
103
110
  };
104
111
  return result;
105
112
  }
@@ -151,7 +158,7 @@ class CommercetoolsProductProvider extends ProductProvider {
151
158
  barcode: "",
152
159
  ean: "",
153
160
  gtin: "",
154
- name: "",
161
+ name: product.name[this.context.languageContext.locale],
155
162
  options,
156
163
  upc: ""
157
164
  };