Forum

Thread tagged as: Question, Runway, Shop

How can I relate or link a collection to shop items?

I'm using Collections in Runway to hold venue and event information for a theatre company. Some of those events require a ticket or tickets. I'd like to be able to show ticket purchase buttons for the shop app on individual event pages.

In Collections I use a perch:related region to join up collections of events, venues (these have serveral events a year in any given venue) and shows (there are two shows a year showing in about seventy venues each). Can I do a similar thing somehow with shop items? Or do I need to use a slug or category to dynamically connect them? Or are they just separate?

What's my best course of action?

Robert Sinclair

Robert Sinclair 4 points

  • 5 years ago

Okay, I had a mull and a play with this.

Perch lets me use <perch:related> in the product template.

So for this example I can hold the date/time of an event with the metadata, it retains that info correctly in the back end. I can't figure out how to output it onto the page.

CORRECTION - It doesn't hold the date/time, it holds the id of the collection item and in the Select box one sees whatever the designated title of that item is. No other info is useable here.

It holds the itemID of the collection item.

Is there a way of getting at that to filter by?

I guess this isn't really possible.

It surprises me that two central features of Perch - Collections and Shop (which is essentially another collection of something) - can't interrelate.

I was looking at this for tickets but won't users want to relate articles to items for sale, etc.?

Ho hum.

The workaround I did to get the ticket products to output via perch_collection() as part of a collection item (event details in this case) is to return the _id of the collection item and then use that _id to outsort via perch_shop_products() the ticket products with that itemID stored in the perch:related field in the product.

I'd be more than glad to hear of a less cludgy way of doing it.

Or I might just keep using the events app for another year.

Better the cludge you know.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, I think you should be able to add a relationship between the product and the collection by adding the relationship to the product's master template.

Otherwise you'll need to wait for the Shop product field type to be ready. Shop is still pretty new, and the functionality is very broad.

Okay, thanks.

Yes, I can get it to accept the relationship via the master template but at the moment it's not much use without some php shuffles.

As I say, being able to interrelate those two major features forward and back seems very useful.