Collections - aareano/ifshop-wiki GitHub Wiki
The Collection event class contains the following events:
- a collection is created
- a collection's product list changes
- a collection is deleted
The collection drop is the root drop that's defined for this class. Below is an example of the tree of liquid drops available to you.
Example Usage: To access the image of the first variant of the first product in the collection, you would use collection.products[0].variants[0].image.
collection
├── product
│   ├── image
│   ├── image
│   ├── image
│   ├── image
│   ├── image
│   ├── image
│   ├── product_option
│   ├── product_option
│   ├── variant
│   │   └── image
│   ├── variant
│   │   └── image
│   ├── variant
│   │   └── image
│   ├── variant
│   │   └── image
│   ├── variant
│   │   └── image
│   ├── variant
│   │   └── image
│   ├── variant
│   │   └── image
│   └── variant
│       └── image
├── product
│   ├── image
│   ├── image
│   ├── image
│   ├── image
│   ├── image
│   ├── product_option
│   ├── variant
│   │   └── image
│   ├── variant
│   │   └── image
│   └── variant
│       └── image
└── shop
The tree is representative of what you can expect for the following events:
- a collection is created
- a collection's product list changes
The remaining collection event has limited data availability because Shopify deletes the data immediately, before ifshop has access to it:
- a collection is deleted
Note: This tree is an illustrative, but not exhaustive - in theory, it goes on forever! - demonstration of the assemblage and structure of the data available to you.
Warning: The tree of liquid drops you encounter in practice will almost certainly have different dimensions than this. This is merely an example to show structure.