This commit is contained in:
Dennis Eichhorn 2022-12-16 20:30:04 +01:00
parent fcf1b24ec9
commit 7fc1134e9c
3 changed files with 90 additions and 0 deletions

View File

@ -0,0 +1,77 @@
[
{
"id": "color",
"name": {
"en": "Color",
"de": "Farbe"
},
"value_type": "string",
"is_custom_allowed": false,
"validation_pattern": "",
"is_required": false,
"default_value": "",
"values": [
{
"name": {
"en": "Red",
"de": "Rot"
}
},
{
"name": {
"en": "Green",
"de": "Gruen"
}
}
]
},
{
"id": "length",
"name": {
"en": "Length",
"de": "Laenge"
},
"values": []
},
{
"id": "weight",
"name": {
"en": "Weight",
"de": "Gewicht"
},
"values": []
},
{
"id": "origin",
"name": {
"en": "Country of origin",
"de": "Herkunftsland"
},
"values": []
},
{
"id": "license",
"name": {
"en": "License",
"de": "Lizenz"
},
"values": []
},
{
"id": "payment_model",
"name": {
"en": "Payment Model",
"de": "Zahlungsweise"
},
"values": [
{
"en": "Subscription",
"de": "Abo"
},
{
"en": "pay-per-use",
"de": "Einmalzahlung"
}
]
}
]

View File

@ -62,6 +62,7 @@ class ItemAttributeType implements \JsonSerializable
public bool $isRequired = false;
/**
* Localization
*
@ -76,6 +77,14 @@ class ItemAttributeType implements \JsonSerializable
*/
private array $defaults = [];
/**
* Default attribute value
*
* @var int
* @since 1.0.0
*/
public int $default = 0;
/**
* Constructor.
*

View File

@ -85,6 +85,10 @@ class ItemAttributeValue implements \JsonSerializable
*/
public bool $isDefault = false;
// @todo: The following l11n is bad!!!
// the l11n should be separate, because we want to know which value it is despite the l11n
// it should be basically the same ass the itemattributetype which has a itemattributetypel11n element.
/**
* Language
*