All things Shopify and commerce
Hi guys i need to detect which gids belong to a variant of the same produtc and then group it like so:
having this array:
const globalIds = [
"gid://shopify/ProductVariant/43293721723032",
"gid://shopify/ProductVariant/43293722214552",
"gid://shopify/ProductVariant/43293722280088",
"gid://shopify/ProductVariant/43293721755800",
"gid://shopify/ProductVariant/43293721788568",
"gid://shopify/ProductVariant/43293721821336",
"gid://shopify/ProductVariant/43293721854104"
];
this 2 are different products:
"gid://shopify/ProductVariant/43293722214552",
"gid://shopify/ProductVariant/43293722280088",
and this 5 are variants of the same product:
"gid://shopify/ProductVariant/43293721723032",
"gid://shopify/ProductVariant/43293721755800",
"gid://shopify/ProductVariant/43293721788568",
"gid://shopify/ProductVariant/43293721821336",
"gid://shopify/ProductVariant/43293721854104"
they share the first 8 digits of the 14 that are after the last / character, the thing is that the 2 above also share it so taking it as way to identify which are part of the same preduct is not viable.
do you guys know any way of doing this ?, I need it to recalc a bundle when it is edited in an app that im doing.
Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025