How to configure and adapt Aimeos based shops as developer
Forum rules: Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#6222 by sixbynine
08 Jun 2018, 10:50
Hello,

I coded some tests, it is almost ok.
So I would like to add my custom files to my extension.

What do I need to write exactly to make the modified files be taken in account?
Is this the /ext/myext/config/mshop.php file that has to be changed?

I tried this in mshop.php

Code: Select allreturn [

        'plugin' => [

            'provider' => [

                'order' => [

                    'productstock' => [

                    ],

                ],

            ],

        ],

    ];

But it doesn't seem to work...

Thank you very much,

sbn
#6226 by sixbynine
11 Jun 2018, 08:17
Hello,

Sorry for the misunderstanding! I would like just AimeOs to use my modified files :

- https://github.com/aimeos/aimeos-core/b ... tStock.php

- https://github.com/aimeos/aimeos-core/b ... andard.php

I'm not really sure about how I should do that... I copied the new files to my /myext/ folder with this structure :

/ext/myext/lib/custom/src/MShop/Plugin/Provider/Order/ProductStock.php
and
/ext/myext/controller/common/src/Controller/Common/Order/Standard.php

And I'm probably supposed to change my config files to make them being used by AimeOs?

Thank you a lot !
#6228 by aimeos
12 Jun 2018, 08:48
Only templates can be copied, classes must be renamed and the new name configured as you mentioned.

For the common order controller, you need to configure the new name using:
https://github.com/aimeos/aimeos-core/blob/master/controller/common/src/Controller/Common/Order/Factory.php#L51

The ProductStock plugin is different because you configure that in the "plugin" panel of the admin interface. Rename your class and add a new plugin entry in the panel. Disable the original ProductStock plugin afterwards.