@scayle/storefront-core
Version:
Collection of essential utilities to work with the Storefront API
133 lines (132 loc) • 2.57 kB
JavaScript
const DEFAULT_WITH_LISTING = {
items: {
product: {
attributes: "all",
advancedAttributes: "all",
variants: {
attributes: "all",
advancedAttributes: "all"
},
images: "all",
categories: {
properties: "all"
},
priceRange: true
},
variant: {
attributes: "all"
}
}
};
const MIN_WITH_PARAMS_SEARCH = {
products: {
attributes: {
withKey: ["brand", "color", "colorDetail", "name"]
},
variants: {
attributes: {
withKey: ["price", "size"]
}
},
categories: {
properties: "all"
}
}
};
const MIN_WITH_PARAMS_PRODUCT = {
attributes: {
withKey: ["color", "brand", "name", "material", "careSymbol"]
},
variants: {
attributes: { withKey: ["price", "size"] }
},
images: {
attributes: {
withKey: ["imageBackground"]
}
},
categories: {
properties: "all"
},
siblings: {
images: {
attributes: {
withKey: ["imageBackground"]
}
},
attributes: {
withKey: ["color", "brand", "name"]
}
}
};
const MIN_WITH_PARAMS_BASKET = {
items: {
product: {
attributes: {
withKey: ["brand", "name", "color"]
},
variants: {
attributes: {
withKey: ["brand", "name", "price", "size", "shopSize", "vendorSize"]
}
},
images: {
attributes: {
withKey: ["imageBackground"]
}
},
categories: {
properties: "all"
},
priceRange: true,
lowestPriorPrice: true
},
variant: {
attributes: {
withKey: ["size", "shopSize", "vendorSize"]
}
}
}
};
const MIN_WITH_PARAMS_WISHLIST = {
items: {
product: {
attributes: {
withKey: ["brand", "name", "color"]
},
variants: {
attributes: {
withKey: ["brand", "name", "price", "size", "shopSize", "vendorSize"]
}
},
images: {
attributes: {
withKey: ["imageBackground"]
}
},
categories: {
properties: "all"
},
priceRange: true,
lowestPriorPrice: true
},
variant: {
attributes: {
withKey: ["size", "shopSize", "vendorSize"]
}
}
}
};
const MIN_WITH_PARAMS_VARIANT = {
attributes: {
withKey: ["size", "shopSize", "vendorSize"]
}
};
export {
DEFAULT_WITH_LISTING,
MIN_WITH_PARAMS_BASKET,
MIN_WITH_PARAMS_SEARCH,
MIN_WITH_PARAMS_PRODUCT,
MIN_WITH_PARAMS_WISHLIST,
MIN_WITH_PARAMS_VARIANT
};