@porulle/adapter-shopify 0.62.0 → 0.64.0
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/dist/index.js +7 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/index.ts +9 -1
package/dist/index.js
CHANGED
|
@@ -324,7 +324,13 @@ export function shopifyConnector(options = {}) {
|
|
|
324
324
|
...(variant.barcode ? { barcode: variant.barcode } : {}),
|
|
325
325
|
...(Object.keys(optionValues).length > 0 ? { optionValues } : {}),
|
|
326
326
|
...(prices ? { prices } : {}),
|
|
327
|
-
|
|
327
|
+
// The inventory item id lets a stock webhook, which names only the item, find this variant.
|
|
328
|
+
...(weightGrams !== undefined || (variant.inventory_item_id !== undefined && variant.inventory_item_id !== null)
|
|
329
|
+
? { metadata: {
|
|
330
|
+
...(weightGrams !== undefined ? { weightGrams } : {}),
|
|
331
|
+
...(variant.inventory_item_id !== undefined && variant.inventory_item_id !== null ? { inventoryItemId: String(variant.inventory_item_id) } : {}),
|
|
332
|
+
} }
|
|
333
|
+
: {}),
|
|
328
334
|
};
|
|
329
335
|
});
|
|
330
336
|
const category = product.product_type ? slugify(product.product_type) : "";
|