I've been looking for ways to programatically have a "scratch" collection that I could use to access data from various products, depending on dynamic criteria at runtime.
Is there a way to assemble or modify a collection of products based on their GID? Our site uses the bundler app to offer a group of products to be sold as a single product and I want to pull metadata from each product in the bundle. I can get the GID of each product but haven't been able to create an array of product objects to pull info from, so it seemed a temporary/scratch collection (if it can be done) could fit the bill.
Any help would be greatly appreciated!
Ya know, it seems silly that one would need our store URL to answer this theoretical question but it also seems to be the first question anyone asks. What's up with that?
Hi kallenconsult ,
Can you clarify GID in your statement it seems to be product id, whereas I thinking of its unique userid.
Here is the flow,
Seems you want a collection of product which user has visited, or you want to show the group of product which has similar meta info.
In contemporary coding, a "gid" is a uniquely generated identifier for data.
In this context, it is returned from a product object as a unique identifier for that product.
My original goal was to assemble an array of objects based on some criteria and then iterate through the array. But liquid being what it is, that's not quite so simple, One thing is we can't seem to create an object (product or otherwise) on the fly. However, you can iterate through a collection of products and get the product object -- but if I can't modify the collection at runtime, that's a dead end.
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...By Arno Nov 27, 2023
You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...By Skye Nov 8, 2023