# Selbsterstelltes Plugin funktioniert nicht

**URL:** https://forum.shopware.com/t/selbsterstelltes-plugin-funktioniert-nicht/37922
**Category:** Programmierung
**Created:** [5. Juli 2016 um 10:09 UTC](https://forum.shopware.com/t/selbsterstelltes-plugin-funktioniert-nicht/37922 "2016-07-05T10:09:17Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![julian\_hartmann](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@julian\_hartmann](https://forum.shopware.com/u/julian_hartmann)
#### Post date: [5. Juli 2016 um 10:09 UTC](https://forum.shopware.com/t/selbsterstelltes-plugin-funktioniert-nicht/37922/1 "2016-07-05T10:09:17Z")

</div>

Hallo liebe Community,

ich habe gerade das Tutorial „[Example Plugin](https://developers.shopware.com/developers-guide/example-plugin/)“ beendet und kann nun weder den Plugin-Manager starten, noch den Cache leeren. Falls es sich um ein Syntaxfehler handelt kann ich ihn leider nicht finden oder habe ich vielleicht falsche Dateipfade verwendet?

&nbsp;

**bearbeitete Quellen in** &nbsp;

**+ /engine/Shopware/Plugins/Local/Frontend/SystemPlugin/**

&nbsp;

- Bootstrap.php

&nbsp;

- StoreFrontBundle/ListProductService.php

&nbsp;

-&nbsp;StoreFrontBundle/SeoCategoryService.php

```
connection = $connection;
		$this->categoryService = $categoryService;
	}
	
	# @param ListProduct[] $listProducts
	# @param ShopContextInterface $context
	# @return Category[] $indexed by product id
	public function getList($listProducts, ShopContextInterface $context){
		$ids = array_map(function(ListProduct $product){
			return $product->getId();
		}, $listProducts);
		
		# select all SEO category ids, indexed by product id
		$ids = $this->getCategoryIds($ids, $context);
		
		# now select all category data for the selected ids
		$categories = $this->categoryService->getList($ids, $context);
		
		$result = [];
		foreach($ids as $productId => $categoryId){
			if(!isset($categories[$categoryId])){
				continue;
			}
			$result[$productId] = $categories[$categoryId];
		}
		
		return $result;
	}
	
	# @param ids
	# @param $context
	public function getCategoryIds($ids, ShopContextInterface $context){
		$query = $this->connection->createQueryBuilder();
		$query
			->select('seoCategories.article_id', 'seoCategories.category_id')
			->from('s_articles_categories_seo', 'seoCategories')
			->andWhere('seoCategories.article_id IN (:productIds)')
			->andWhere('seoCategories.shop_id = :shopId')
			->setParameter(':shopId', $context->getShop()->getId())
			->setParameter('_productIds', $ids, Connection::PARAM_INT_ARRAY);
		return $query->execute()->fetchAll(\PDO::FETCH_KEY_PAIR);
	}
}

?>

```

&nbsp;

- Views/frontend/detail/actions.tpl

&nbsp;

- Views/frontend/listing/product-box/product-badges.tpl

&nbsp;

- Views/frontend/system\_plugin/detail-link.tpl

&nbsp;

- Views/frontend/system\_plugin/listing-badge.tpl

&nbsp;

- Views/frontend/\_public/src/less/all.less

&nbsp;

---

<div class="post-metadata">

### Author: ![julian\_hartmann](https://avatars.discourse-cdn.com/v4/letter/j/b5e925/32.png) [@julian\_hartmann](https://forum.shopware.com/u/julian_hartmann)
#### Post date: [5. Juli 2016 um 10:09 UTC](https://forum.shopware.com/t/selbsterstelltes-plugin-funktioniert-nicht/37922/2 "2016-07-05T10:09:26Z")

</div>

**+ /theme/Frontend/Theme/**

- Theme.php

&nbsp;

- frontend/system\_plugin/detail-link.tpl

&nbsp;

- frontend/system\_plugin/listing-badge.tpl

&nbsp;

- frontend/\_public/src/less/all.less

&nbsp;

&nbsp;

Ich würde mich sehr über eine Antwort freuen, denn ich weiß ehrlich nicht woran es scheitert.

Freundliche Grüße,  
​Julian
