Hello,
I’ve edited my ProductList/ProductList.php file
'onPostDispatchBackendIndex',
];
}
/**
* {@inheritdoc}
*/
public function install(InstallContext $installContext) {
$this->createDatabase();
}
/**
* {@inheritdoc}
*/
public function activate(ActivateContext $activateContext) {
$activateContext->scheduleClearCache(InstallContext::CACHE_LIST_ALL);
}
/**
* {@inheritdoc}
*/
public function uninstall(UninstallContext $uninstallContext) {
if (!$uninstallContext->keepUserData()) {
$this->removeDatabase();
}
}
private function createDatabase() {
$modelManager = $this->container->get('models');
$tool = new SchemaTool($modelManager);
$classes = $this->getClasses($modelManager);
$tool->updateSchema($classes, true); // make sure to use the save mode
}
private function removeDatabase() {
$modelManager = $this->container->get('models');
$tool = new SchemaTool($modelManager);
$classes = $classes = $this->getClasses($modelManager);
$tool->dropSchema($classes);
}
/**
* @param ModelManager $modelManager
* @return array
*/
private function getClasses(ModelManager $modelManager) {
return [
$modelManager->getClassMetadata(Product::class),
];
}
/**
* @param \Enlight_Controller_ActionEventArgs $args
*/
public function onPostDispatchBackendIndex(\Enlight_Controller_ActionEventArgs $args) {
$request = $args->getRequest();
$view = $args->getSubject()->View();
$config = $this->container->get('shopware.plugin.cached_config_reader')->getByPluginName($this->getName());
$view->assign('ProductImportApi', $config['ProductImportApi']);
$view->assign('ProductImportUsername', $config['ProductImportUsername']);
$view->assign('ProductImportCategoryId', $config['ProductImportCategoryId']);
$view->addTemplateDir($this->getPath() . '/Resources/views');
}
}
Now how can I use this variable in detail or list view? Please find attached snap for hierarchy