简体   繁体   中英

Shopware plugin

I am trying to create a basic plugin in the shopware I have also added the code from the reference site of the shopware. The plugin is also available in the shopware backend. But when i try to post the url http://localhost/shopware/RoutingDemonstration on my browser it is redirecting to the homepage only. No error nothing is shown even if I add anything after the url it is redirecting to the home page not on 404 page.

The default behavior of a 404 is a redirect to the homepage. So it seems that your controller is not registered correctly. You need to show us some source code to understand your issue. Perhaps your Subscriber does not work?

There is a full example on how to do this in the documentation: https://developers.shopware.com/developers-guide/legacy-plugin-system/#register-plugin-controller-with-template-in-a-subscriber

You must also add the following PHP code to your config.php file if you want to see PHP errors:

'front' => [
    'throwExceptions' => true,
    'showException' => true
],

'phpsettings' => [
    'display_errors' => 1
],

'template' => [
    'forceCompile' => true
],

'csrfProtection' => [
    'frontend' => true,
    'backend' => true
],

'httpcache' => [
    'debug' => true
]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM