Personalized checkout and custom promotions with Shopify Scripts
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!
Hi,
Can you provide your store url
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.
Please clarify?
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.
Can you share your logic you want.
May be we could suggest something around it.
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024