# Custom Icon in Backend-Plugin

**URL:** <https://forum.shopware.com/t/custom-icon-in-backend-plugin/49459>\
**Category:** Programmierung\
**Created:** [14. November 2017 um 16:21 UTC](https://forum.shopware.com/t/custom-icon-in-backend-plugin/49459 "2017-11-14T16:21:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![FloC3](https://avatars.discourse-cdn.com/v4/letter/f/838e76/32.png) [@FloC3](https://forum.shopware.com/u/FloC3)\
**Post date:** [14. November 2017 um 16:21 UTC](https://forum.shopware.com/t/custom-icon-in-backend-plugin/49459/1 "2017-11-14T16:21:28Z")

</div>

Hallo,

wenn ich im Backend in einem Plugin einen neuen Menüeintrag erstelle… wie kann ich dem ein eigenes Icon geben und nicht eines aus den vorhandenen verwenden? Möchte das Icon des Plugins selbst dort einbinden…

Hab schon rausgefunden, dass ich wohl mit dem Event&nbsp; **_Enlight\_Controller\_Action\_PostDispatch\_Backend\_Index_** arbeiten muss… aber wie?

---

<div class="post-metadata">

**Author:** ![arnebecker](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@arnebecker](https://forum.shopware.com/u/arnebecker)\
**Post date:** [15. November 2017 um 09:06 UTC](https://forum.shopware.com/t/custom-icon-in-backend-plugin/49459/2 "2017-11-15T09:06:18Z")

</div>

Im alten Plugin System hat es so funktioniert:

```
        $topFolder = $this->createMenuItem(array(
            'label' => 'EurotextTranslationManagerFoldernameDummy',
            'action' => 'index',
            'controller' => 'EurotextTranslationManager',
            'class' => 'ico2\" style=\"background: transparent url(/' . str_replace(Shopware()->DocPath() , '', $this->Path()) . '/Views/backend/eurotext_translation_manager/assets/icons/translationmanager.png)',
            'active' => 1,
            'parent' => $this->Menu()->findOneBy('label', 'Einstellungen'),
            'onclick' => ';' // do nothing
        ));

```

Ob das im neuen auch noch so funkioniert, kann ich dir leider nicht sagen. Da hab ich das noch nicht probiert.

---

<div class="post-metadata">

**Author:** ![FloC3](https://avatars.discourse-cdn.com/v4/letter/f/838e76/32.png) [@FloC3](https://forum.shopware.com/u/FloC3)\
**Post date:** [15. November 2017 um 14:37 UTC](https://forum.shopware.com/t/custom-icon-in-backend-plugin/49459/3 "2017-11-15T14:37:04Z")

</div>

@arnebecker‍

in deinem Beispiel wird der Menüeintrag in PHP in der Plugin-Basisklasse erzeugt nehme ich an.

Ich arbeite aber mit der menu.xml als Konfigurationsdatei…

---

<div class="post-metadata">

**Author:** ![arnebecker](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@arnebecker](https://forum.shopware.com/u/arnebecker)\
**Post date:** [15. November 2017 um 16:09 UTC](https://forum.shopware.com/t/custom-icon-in-backend-plugin/49459/4 "2017-11-15T16:09:37Z")

</div>

Ja genau. Wie beschrieben funktioniert es so im alten Plugin System. Ich dachte, es könnte dir vielleicht als Inspiration dienen. Hat es wohl scheinbar nicht.

Versuch dass doch mal so in das class-Tag in der Menu.xml einzutragen. Vielleicht klappt es ja!

Ansonsten schreibst du es halt einfach so in die Tabelle s\_core\_menu Spalte class

---

<div class="post-metadata">

**Author:** ![selvaranjani](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@selvaranjani](https://forum.shopware.com/u/selvaranjani)\
**Post date:** [7. Februar 2018 um 13:20 UTC](https://forum.shopware.com/t/custom-icon-in-backend-plugin/49459/5 "2018-02-07T13:20:57Z")

</div>

Hi

&nbsp;I have a doubt about custom plugins.

there are two ways to implement a plugin

1. custom/plugins/yourplugin

2. engine/Shopware/Plugins/Community/Frontend/yourplugin

Which one is best to implement a payment plugin and what is the main advantages of custom plugins

---

<div class="post-metadata">

**Author:** ![BestShopPossible](https://avatars.discourse-cdn.com/v4/letter/b/6bbea6/32.png) [@BestShopPossible](https://forum.shopware.com/u/BestShopPossible)\
**Post date:** [7. Februar 2018 um 14:36 UTC](https://forum.shopware.com/t/custom-icon-in-backend-plugin/49459/6 "2018-02-07T14:36:39Z")

</div>

custom is the new plug-in system -\> go with that

engine/Shopware/Plugins/… is the old plug-in system, deprecated and will be removed in future versions of shopware

see:&nbsp;[Developer Guides](https://developers.shopware.com/developers-guide/)

---

<div class="post-metadata">

**Author:** ![selvaranjani](https://avatars.discourse-cdn.com/v4/letter/s/d78d45/32.png) [@selvaranjani](https://forum.shopware.com/u/selvaranjani)\
**Post date:** [8. Februar 2018 um 05:04 UTC](https://forum.shopware.com/t/custom-icon-in-backend-plugin/49459/7 "2018-02-08T05:04:30Z")

</div>

ok thanks for your valuable comments.

I have already developed a plugins( like a path engine/Shopware/Plugins/Frontend).I want implement a plugin in new custom plugin.

what is the advantages of new plug-in system (custom).

Can you explain about that ??

&nbsp;

---

<div class="post-metadata">

**Author:** ![novallnet](https://avatars.discourse-cdn.com/v4/letter/n/7feea3/32.png) [@novallnet](https://forum.shopware.com/u/novallnet)\
**Post date:** [20. Februar 2018 um 07:14 UTC](https://forum.shopware.com/t/custom-icon-in-backend-plugin/49459/8 "2018-02-20T07:14:36Z")

</div>

I have started to implement a payment plugin with subscription supported, So i have analyzed about AboCommerce/Subscription plugin.  
I have a doubt related AboCommerce cron execution,please refer the below points.

below mentioned query to used for recurring order creation

1. &nbsp;private function getOrderById($orderId)  
&nbsp; &nbsp; {  
&nbsp; &nbsp; &nbsp; &nbsp; return $this-\>connection-\>createQueryBuilder()  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -\>select([’\*’, ‚ord.id AS orderId‘, ‚payment.id as paymentId‘, ‚shop.id AS shopId‘])  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -\>from(‚s\_order‘, ‚ord‘)  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -\>innerJoin(‚ord‘, ‚s\_core\_shops‘, ‚shop‘, ‚ord.language = shop.id AND shop.active = 1‘)  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -\>leftJoin(‚ord‘, ‚s\_core\_paymentmeans‘, ‚payment‘, ‚payment.id = ord.paymentID‘)  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -\>where(‚ord.id = :id‘)  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -\>setParameter(‚id‘, $orderId)  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -\>execute()  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; -\>fetch(\PDO::FETCH\_ASSOC);  
&nbsp; &nbsp; }

2. &nbsp;$order = $this-\>getOrderById((int) $abo[‚last\_order\_id‘]);  
&nbsp; &nbsp; &nbsp; &nbsp; if (empty($order[‚payment\_action‘])) {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $action = ‚aboFinish‘;  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $controller = ‚checkout‘;  
&nbsp; &nbsp; &nbsp; &nbsp; } else {  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $controller = $order[‚payment\_action‘];  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $action = ‚recurring‘;  
&nbsp; &nbsp; &nbsp; &nbsp; }

please check the above 2 points the $order[‚payment\_action‘] is correct or not ?? Actually the column name having action but they mentioned payment\_action.So always called aboFinish action but i need to call a recurring action,if the above points are correct how to adapt the payment\_action in my plugin or any other possibilities to call a recurring action.
