Cart Transform
Merge cart lines into bundles, expand bundle SKUs into components, and update line presentation with JavaScript.
var ops = [];
var bundleLines = input.cart.lines.filter(function (line) {
var product = line.merchandise && line.merchandise.product;
return product && product.hasTags && product.hasTags.some(function (t) { return t.hasTag; });
});
if (bundleLines.length >= 2) {
ops.push({
linesMerge: {
cartLines: bundleLines.map(function (l) { return { cartLineId: l.id, quantity: l.quantity }; }),
parentVariantId: 'gid://shopify/ProductVariant/…',
title: 'Bundle',
price: { percentageDecrease: { value: 10 } },
},
});
}
return { operations: ops };Operations
Operation
Shape
Effect
The input
How DataJet manages the transform
Example: expand a bundle SKU
Notes
Last updated