Beim Artikel hat SW ja von Haus aus 20 Freitextfelder (attr1 - attr20). Diese kann man ja beliebig um eigene erweitern. Jetzt scheint es so zu sein, dass wenn ich im backend zB ein attr21 hinzufüge, dann wird das über die API offenbar nicht bereit gestellt obwohl es in der DB und im Backend als Feld vorhanden und manuell bearbeitet werden kann.
Ich habe schon ein bisschen gesucht, und es scheint ja so zu sein, dass die API an dieser Stelle eine entsprechende Erweiterung benötigt. In den Dev docs steht ja zb hier:’
https://developers.shopware.com/developers-guide/attribute-system/?_ga=2.55370285.782390016.1591794199-804057775.1554848649#rebuild-attribute-models
„Shopware.attribute.FormAnchor link for: shopware.attribute.form
All attributes are defined, loaded and saved over the Shopware.attribute.Form. It requires only the attribute table and generates all fields dynamically. The following example shows how to display, load and save customer attributes:“
Ich bin selbst kein Programmierer, aber ich möchte schnell etwas ausprobieren. Verstehe ich das richtig, dass ich in der Datei „/themes/Backend/ExtJs/backend/base/attribute/Shopware.attribute.Form.js“
durch ein entsprechendes Codesnippet der API beibringen kann das eigene Attribut ebenfalls mit bereitzustellen?
Ich habe mal versucht dieses Snippet in die Datei zu werfen
me.attributeForm = Ext.create('Shopware.attribute.Form', {
table: 's_attribute_configuration'
});
me.attributeForm.loadAttribute(me.customerRecord.get('attr21'));
me.attributeForm.saveAttribute(me.customerRecord.get('attr21'));
Leider brachte das keinen Erfolg.
Ist das so überhauot möglich, also mit ein paar Zeilen Code (auch für jedes eigene Attribut) in die eine Datei, oder wird das ganze eventuell komplexer?
Danke schon mal für eure Hilfe.