| 80 Mitarbieter | Physisches Geschäft | Magento2 Onlineshop |
|
|
|
|---|---|---|
| Unglückliche Endkunden | Hohe Kosten | Überlastete Mitarbeiter |
|
|
|
|---|---|---|
| Glückliche Endkunden | Fehler- reduktion | Personal- entlastung |



| Produktqualität | ++ | + | o | - |
|---|---|---|---|---|
| Funktionalität | ||||
| Sicherheit | ||||
| Zuverlässigkeit | ||||
| Benutzbarkeit | ||||
| Effizienz | ||||
| Änderbarkeit | ||||
| Übertragbarkeit |
$installer->startSetup();
$tableInstance = $installer->getTable('webvisum_customer_attribute');
/* Hier werden die Spalten der Tabelle definiert. Nach diesem Schema können weitere Attributmerkmale
zu der Tabelle hinzugefügt werden*/
$table = $installer->getConnection()
->newTable($tableInstance)
->addColumn('eav_id', Table::TYPE_INTEGER, null,['identity' => true, 'nullable' => false, 'primary' => true], 'Id')
->addColumn('attribute_code', Table::TYPE_TEXT, 255, ['nullable' => false], 'Attribute Code')
->addColumn('attr_id', Table::TYPE_INTEGER, 11, ['nullable' => false], 'Attribute Id')
->addColumn('store_code', Table::TYPE_TEXT, 255, ['nullable' => false], 'Store');
/* Die Tabelle wird in der DB installiert*/
$installer->getConnection()->createTable($table);
$data = $this->getRequest()->getPostValue();
/* Hier werden die Daten in das Model übergeben und notwendige Caches geleert */
try {
$model = $this->_cattributeFactory->create();
$model->setData($data);
$model->save();
$this->cache->clean(["EAV", "EAV_ATTRIBUTE"]);
$indexer = $this->indexerFactory->create();
$indexer->load('customer_grid');
$indexer->reindexAll();
/* Ausgabe der Erfolgsnachticht und Weiterleitung zu der Attributübersicht */
$this->messageManager->addSuccessMessage(__('Attribute has been saved.'));
return $this->_redirect('*/*/');
}
catch (\Exception $e) {
$this->messageManager->addErrorMessage(__('Something went wrong while saving attribute.'));
}
< block class="Webvisum\CustomerAttribute\Block\CustomerAttribute"
name="customer_attribute_edit"
as="customer.attribute.edit"
template="Webvisum_CustomerAttribute::customer/edit.phtml"
after="-"
/ >
namespace Webvisum\CustomerAttribute\Block;
use Magento\Framework\View\Element\Template;
use Webvisum\CustomerAttribute\Model\CattributeFactory;
use Magento\Eav\Model\Config;
class CustomerAttribute extends Template
{
public function __construct(CattributeFactory $cattributeFactory, Config $eavConfig)
{
$this->_cattributeFactory = $cattributeFactory;
$this->_eavConfig = $eavConfig;
}
public function getCustomerAttributes()
{
return $this->_cattributeFactory->create()->getCollection();
}
public function getAttributeData($entity, $code)
{
return $this->_eavConfig->getAttribute($entity, $code);
}
}
| Phase | geplante Zeit | Abweichung |
|---|---|---|
| Analyse | 9 | +2 |
| Definition | 11 | +1 |
| Entwurf | 9 | -1 |
| Implementierung | 21 | -2 |
| Testen & Abschluss | 8 | - |
| Dokumentation | 12 | - |