Option collections
An option collection is a reusable selection of option values, from one or more options, in a fixed order. This chapter explains when to use one and every field of its form.
When to use a collection
A step of type Option always offers every value of the OpenCart option, and you disable in the tree the values that do not belong to a path. A collection is useful when:
- several templates use only part of the values of a large option, for example the twelve fabrics of one supplier out of a list of eighty;
- the same group of questions, such as fabric followed by colour, is repeated in several templates;
- you want to create a new option value while you prepare the selection, without leaving the module.
In a template, a step of type Option collection becomes one step for each option the collection contains, ordered by Depth level. Each of those steps offers only the values selected in the collection.
The collection list
The Option collections section of the main screen lists your collections with their Name and Status, and the buttons Edit and Delete. Press Add collection to create one.
The collection form
| Field | What it does |
|---|---|
| Collection name | The name shown in the list and in the template form, as Option Collection - Name. Required. |
| Option values | Every option of your store with its values. Tick the values that belong to the collection. |
| Collection tree preview | The resulting order of the options and the selected values, level by level. |
| Extension status | Enabled or Disabled, shown in the collection list. |
Press Save at the top to store the collection, or Cancel to go back.
Selecting values
For each option, the form shows:
| Element | What it does |
|---|---|
| Depth level | The position of this option inside the collection: 0 first, then 1, 2 and so on. Each option with selected values must have its own level. |
| Select all and Unselect all | Tick or untick all the values of the option that are visible after the search. |
| Live search field | Filters the values of this option by name or internal label. |
| Quick add | Opens a small form to create a new value for this option. See below. |
| Value list | The values, with their internal label in bold before the name when they have one. See Helpers and value labels. |
The search field at the top, Search option or option value..., filters all options and values at once.
If two options with selected values share the same depth level, saving shows Each option must have a unique depth level.
Creating a value with Quick add
- Press Quick add in the option where the value belongs.
- Type the Name in each language, choose an Image if the option uses images, and set the Sort order.
- Press Save option value.
The value is created in the OpenCart option, as if you had added it in Catalog → Options, and it is ticked in the collection at once.
Default images and image zoom
In Collection tree preview, each value has two links:
- Default image assignment opens a window where you add images, with a sort order, and press Save. These become the default gallery images of that option value: in every tree, a node of that value that has no images of its own starts with them.
- Disable image zoom or Enable image zoom, for options of type image, sets whether Image zoom starts ticked for that value in the tree.
Both links save at once, without pressing the Save button of the form.
Using the collection in a template
- In the template form, add a step and choose Option collection as the type.
- Choose the collection, listed as Option Collection - Name.
- Optionally choose a helper. The helper is shown on the step of the option it belongs to.
The Frontend type, Image source and thumb size fields are only available for steps of type Option. The steps of a collection use the type of each OpenCart option and the value's own image.
Still need help?
Open a support ticket from your account and our team will look at your store with you.