Advanced Part List Topics
Roomle platform supports various part list features. These include aggregating more pieces of one artilce into packages in defined sizes, change article number based on the package and change the article name accordingly.
Packaging
Packaging is a feature that will aggregate the articles into packages that have defined number of pieces. Take chair endcaps as example: they are individual pieces and you need (usually) 4. It makes perfect sense that they come packed in sets of 4 pieces. Screws can also be counted individually, but also come in packages with many pieces. Packaging is a defined feature of the component. Amount of one part list entry in the whole configuration is shown in the part list as the count. If the entries have defined package sizes, they will divide into those packages. You define packaging on the component level, using either packageSizes
or packaging
. While packageSizes
is a plain list of integers, packaging
allows you to define the package sizes using conditional values.
Let's take a closer look at a following demonstration example of packaging.
Resulting part list looks like this:
There are also cases where you need conditional package sizes - the packaging
. Typical usecase: a shelf comes in two sizes. One of the sizes comes in packaging of 2 or 4, the other one only in the double package:
Component Label
However, sometimes you need this label to be variable. Typical example: the packaging. Let's add the label to the examples where the packageSizes have been explained:
Note: you can use packageSize in the label script as you did in the articleNr script - feel free to do so:
The result will be the same, but keep in mind, that tables of article numbers and labels are commonly provided. If you have the data at your disposal in a formalized way, like in a table or in a database, best approach is to generate the code from it. See following Excel formula as an example:
="if (articleNr == '"&A1&"') { label = '"&B1&"'; }"
, supposing there is articleNumber in the column A and label in the column B.
To be able to translate to other languages, you can use language
getter, which is accessible in the label script:
Important: Because English is used as a fallback language in the Roomle platform, it is the scripters' responsibility, that there are always the labels defined in a way that it always gets to a fallback value. A good approach is to define label in English, then eventually override it by other languages (like in the example above).
Where are component labels used?
Currently the configurator shows the main label and the sub label:
Content of those labels follows this pseudo-code:
Where:
rootComponentLabel
is the constant database label of the component (component.label script is not used here)rapiItemLabel
if configurator is loaded by itemId, catalogue label of the itemcatalogName
is the constant database label of the catalogueprice
is shown if pricing is used
Part list entries show the label from component.label
script or the component label in the database:
Note: component.labels
(notice the difference with the previous - plural vs singular) object is legacy and is not used in current version of the Roomle Rubens Configurator.
Aggregating part list entries using count
Part list entries aggregate together as count, if componentId, articleNr and parameters visible in part list match. Count is count of all same components, each adding 1 by default or subComponent.numberInPartList
value.
Important: If labels are different, the part list entries will still aggregate and one of the different labels is shown. This is because two products with same parameters and SKU should not be called differently. You can solve this by adding a parameter that is different.
This is a cause of following error, where the part list says there are two left (links) elements, but actually should show one left and one right instead.
Part List Grouping
By default, main component is every component on top of the subComponent hierarchy (= standalone selectable configurable part). Therefore you will, by default, get as many groups as the number of docked components in the hierarchy is.
You can override the definition of the main component by using subComponent.isMain: Script<boolean>
key, replacing the upper-level component as the main component.
If you set a component on top of the subComponent hierarchy as non-main (isMain
is set to false
), its parent component will be the group parent of that component. This is especially useful if you have for example sofa elements docked next to each other and you can dock a pillow to each of the elements. By setting the pillow child component as non-main, you can group the pillows under the sofa elements they are docked to.
The main component does not have to have numberInPartList
bigger than zero to appear as the group header. If numberInPartList
is zero, it will still appear in the part list as the group parent.
If you have two main components, both will appear as their own top-level group in the part list.
All non-main components appear only once in the parlist.
Hierarchical subComponent structure of this sofa system elements:
Part List Highlighting
When you hover (on desktop) or click (on mobile) on an an entry in the part list, it gets highlighted in the scene. As you already know, the part list entries are components or subComponents. Going up through the subCompnent tree, the root component of the hierarchy is highlighted. Every docked component, which subComponent hierarchy contains the part list entry, gets highlighted.
If one part list entry comes into the part list from more docked component, every of those components are then highlighted. Consider using the part list grouping feature described above.
Last updated