# Adding new tabs to custom products plugin

**URL:** <https://forum.shopware.com/t/adding-new-tabs-to-custom-products-plugin/48875>\
**Category:** International (English Only)\
**Tags:** programming\
**Created:** [17. Oktober 2017 um 09:44 UTC](https://forum.shopware.com/t/adding-new-tabs-to-custom-products-plugin/48875 "2017-10-17T09:44:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![roberto](https://avatars.discourse-cdn.com/v4/letter/r/8baadc/32.png) [@roberto](https://forum.shopware.com/u/roberto)\
**Post date:** [17. Oktober 2017 um 09:44 UTC](https://forum.shopware.com/t/adding-new-tabs-to-custom-products-plugin/48875/1 "2017-10-17T09:44:24Z")

</div>

Hi,

I’m trying to extend the custom products plugin to add new tabs and extra functions, I’m following some resources but without luck so far

[https://developers.shopware.com/developers-guide/backend-extension/](https://developers.shopware.com/developers-guide/backend-extension/)  
[Extend an existing plugin via another plugin](https://developers.shopware.com/developers-guide/plugin-extension-by-plugin/)

And this is what I have at the moment

&nbsp;

```
public static function getSubscribedEvents()
    {
        return [
            'Enlight_Controller_Action_PostDispatch_Backend_SwagCustomProducts' => 'extendBackendModule',
        ];
    }

    /**
     * @param \Enlight_Event_EventArgs $arguments
     */
    public function extendBackendModule(\Enlight_Event_EventArgs $arguments)
    {
        $subject = $arguments->get('subject');

        $view = $subject->View();

        $view->addTemplateDir($this->path . '/Resources/Views/');
        
        if ($arguments->get('request')->getActionName() === 'index') {
            $view->extendsTemplate('backend/swag_custom_products/app.js');
        }

        if ($arguments->get('request')->getActionName() === 'detail') {
            $view->extendsTemplate('backend/swag_custom_products/view/detail/window.js');
        }
        
    }

```

app.js

```
//{block name="backend/swag_custom_products/application"}
// {$smarty.block.parent}
// {include file="backend/swag_custom_products/view/detail/my_own_tab.js"}
//{/block}

```

&nbsp;

window.js

```
//{block name="backend/customer/view/detail/window"}
// {$smarty.block.parent}
Ext.define('Shopware.apps.SwagExtendCustomer.view.detail.Window', {
   override: 'Shopware.apps.SwagCustomProducts.detail.Window',

   getTabs: function() {
      var me = this,
          result = me.callParent();

      result.push(Ext.create('Shopware.apps.SwagExtendCustomer.view.detail.MyOwnTab'));

      return result;
   }

});
//{/block}

```

&nbsp;

my\_own\_tab.js

```
// This tab will be shown in the customer module

Ext.define('Shopware.apps.swag_custom_products.view.detail.MyOwnTab', {
    extend: 'Shopware.apps.SwagCustomProducts',
    padding: 10,
    title: 'MyOwnTab',

    initComponent: function() {
        var me = this;

        me.items = [{
            xtype: 'label',
            html: 'Hello world'
        }];

        me.callParent(arguments);
    }

});

```

As I said the idea is have an extra tab with extra actions inside the actual custom products
