Ein Hoch auf xdebug und nieder mit dem Cache! Mittels des Debuggers habe ich herausgefunden, das der Cache das Model scheinbar noch vorgehalten hat. Nach Deaktivierung des Caches im Backend hat es jetzt problemlos funktioniert. Wie unter http://wiki.shopware.com/Shopware-Backe … ml#Vorwort angegeben sollte man bei der Backend-Entwicklung in der config.php den Cache deaktivieren. Die config.php sollte dann so aussehen (Datenbankdaten natürlich anpassen): <?php return array (
'db' => array ( 'host' =\> '192.168.2.106', 'port' =\> '3306', 'username' =\> 'shopware', 'password' =\> 'xxx', 'dbname' =\> 'shopware', ), 'front' =\> array ( 'noErrorHandler' =\> true, 'throwExceptions' =\> true ), 'template' =\> array ( 'forceCompile' =\> true ), 'model' =\> array( 'cacheProvider' =\> 'Array' ), 'cache' =\> array( 'backend' =\> 'Black-Hole', 'backendOptions' =\> array(), 'frontendOptions' =\> array('write\_control' =\> false), ), );
Und da es einiges an Zeit gekostet hat, die Lösung wie man eine weitere Spalte, hier notifications, ausgibt gleich mit anbei: In der Bootstrap.php muss in der Methode addDemoData der SQL-Query zweimal um notfication erweitert werden: $sql = " INSERT IGNORE INTO s\_product (id, name, active, description, descriptionLong, lastStock, createDate, notification) SELECT a.id, a.name, a.active, a.description, a.description\_long as descriptionLong, a.laststock as lastStock, a.datum as createDate, a.notification FROM s\_articles a ";
In Models/Product/Product.php muss die Variable gesetzt und die get- und set-Methoden hinzugefügt werden: /\*\* \* @var integer $notification \* \* @ORM\Column(type="integer", nullable=false) \*/ private $notification = false; /\*\* \* @param int $notification \*/ public function setNotification($notification) { $this-\>notification = $notification; } /\*\* \* @return int \*/ public function getNotification() { return $this-\>notification; }
Als letztes noch in Views/backend/swag_product/model/product.js die neue Spalte ergänzen: fields: [{ name : 'id', type: 'int', useNull: true }, { name : 'name', type: 'string' }, { name : 'active', type: 'boolean' }, { name : 'createDate', type: 'date' }, { name : 'description', type: 'string', useNull: true }, { name : 'descriptionLong', type: 'string', useNull: true }, { name : 'lastStock', type: 'boolean' }, { name : 'notification', type: 'integer' }]
Danach das Plugin installieren und aktivieren. Das sollte es gewesen sein. Gruß Mario