jvelo / mayocat-shop

[RETIRED] Open source e-commerce and marketplaces made simple on the JVM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The selectBox addon returns the same value for the raw and display properties

nesk opened this issue · comments

I have the following YAML configuration:

#...

addons:
  caracteristiques:
    name: Caracteristiques
    for: product
    fields:
      matiere:
        name: Matière
        editor: selectBox
        properties:
          listValues:
            - key: alu
              name: Capsule complexe aluminium
            - key: alu-epais
              name: Capsule complexe aluminium Epais
            - key: thermo
              name: Capsule Thermo-rétractable (PVC)
            - key: vis
              name: Capsule à vis
            - key: etain-alu
              name: Capsule Etain et Aluminium Embouti
            - key: coiffes
              name: Coiffes pour les vins effervescents

Say we select the Capsule Thermo-rétractable (PVC) option for a product in the back office. If I query the API, I will get:

// ...

"addons": {
    "caracteristiques": {
        "matiere": {
            "raw": "thermo",
            "display": "thermo"
        },
    }
},

// ...

Instead of:

// ...

"addons": {
    "caracteristiques": {
        "matiere": {
            "raw": "thermo",
            "display": "Capsule Thermo-rétractable (PVC)"
        },
    }
},

// ...