Extending backend customer (new tab problem)

Hi folks.

When I do** Ext.create(“Shopware.apps.PeCustomers.view.list.Markets”)** in the part of code where I am putting list into the tab, 404 error came up, saying it cant find that path.

What should I do?

It looks like your list/markets.js isn’t embedded correctly. If a Ext.Js class is unknown, Shopware tries to load it via Ajax and that fails in your case. Please ensure that your ExtJs file is actually loaded before you try to create it (e.g. via {include file=…}) or your extend the backend template also on any ajax Event (load) (with Ext.create(…)).

Have a look at 

Especially in your php-Event Listener:

if ($request->getActionName() == 'index') {
    // your extension is loaded. Just embed the app.js (in which all subfiles should be 
    // included via {include file=...})
    $view->extendsTemplate('backend/swag_extend_customer/app.js');
}

if ($request->getActionName() == 'load') {
    // dependency loader. Make sure to list *all* parts of your extension here except the
    // app.js
    $view->extendsTemplate('backend/swag_extend_customer/view/detail/window.js');
}

 Hope I could help  Wink

1 Like

Where should I include list/markets.js file? In app.js or somwhere else?

Here is installation file of plugin:
https://image.ibb.co/iiUVua/Screen_Shot_2017_07_04_at_08_39_02.png

I got it! Thank you!