on ‎2018 Nov 26 1:21 PM
We have a requirement to create classification attribute of type multi-valued country list. So in the backoffice when the user navigates to Products -> Attributes, he should be able to view multi-valued attribute and he should be able to select country from the drop down and save the classification attributes. How can we achieve this?
Thanks in advance.
Request clarification before answering.
Found the below solution:
In the above solution suggested by no need to create ClassificationAttributeValue, instead use the Reference to Country in the class attribute assignment:
INSERT_UPDATE ClassAttributeAssignment;$class;$attribute;multiValued;attributeType(code);localized[default=true];referenceType(code) ;customClass;customAttributeCountry;TRUE;reference;FALSE;Country;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can define a custom enumeration / values, and assign it to the attribute:
$SYSTEM=customSystem
$SYSVER=systemVersion(catalog(id),version)[unique=true,default=$SYSTEM:1.0]
$CATVER=catalogversion(catalog(id),version)[unique=true,default=$SYSTEM:1.0]
# Create classification category
INSERT_UPDATE ClassificationClass;code[unique=true];name[lang=en];$SYSVER
;customClass;Custom Class
# Create classification attribute
INSERT_UPDATE ClassificationAttribute;code[unique=true];name[lang=en];$SYSVER
;customAttributeCountry;Custom Attribute;
# Create enumeration (e.g. for Country)
INSERT_UPDATE ClassificationAttributeValue;code[unique=true];name[lang=en];$SYSVER
;Country;Country_PH;Philippines
;Country;Country_JP;Japan
$class=classificationClass(code,$CATVER)[unique=true]
$attribute=classificationAttribute(code,$SYSVER)[unique=true]
# Define multivalued enum attribute, mapped to classification class
INSERT_UPDATE ClassAttributeAssignment;$class;$attribute;multiValued;attributeType(code);localized[default=true];attributeValues(code,$SYSVER);
;customClass;customAttributeCountry;TRUE;enum;FALSE;Country_PH,Country_JP;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.