2025-07-27 - Assigning sub values to AttributeTree links

From Izara Wiki
Jump to navigation Jump to search

NPM module - Izara Core - Attribute Tree Service - Product Attributes Service - Sell Offer Terms

Overview

Attribute links added to an attribute tree for a specific subject, such as productAttributes for a product, might have sub values attached to them, for example Material label might have Cotton value, but then a sub value of the percentage of cotton.

Data structure

Create child attribute link below cotton with label eg Material Content Percent, with the value, eg 40 in it.

40 is treted like a string in attribute value translations, but we can use sortResult to order or do a comparison by casting/sorting the value as numeric.

Searching by value

Can create a deep path search or traversal that finds the percent value of attribute links that link below the Material labelled link, these get passed to sortResult and a comparison is performed to return a sub-set of subjects that match.