Extend order/manager/standard wit own throws ertror in jsonapi

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)
Spam and unrelated posts will be removed immediately!
heural
Posts: 63
Joined: 09 Jun 2022, 07:55

Extend order/manager/standard wit own throws ertror in jsonapi

Post by heural » 26 Jul 2024, 14:32

Hi Aimeos-Team,

I extend (overwrite) MShop/Order/Manager/Standard with my own Customerordermanager,
purpose is to generate a custom invoice number (MShop/Order/Manager/Standard::createInvoiceNumber)

in config/mshop.php I have defined

Code: Select all

return [
    'order' => [
        'manager' => [
            'name' => 'Customordermanager'
        ]
    ]
];
(see https://aimeos.org/docs/2022.x/config/m ... er/#name_2)

But now if I try to add a product to the basket, an exception is thrown in
aimeos/ai-client-jsonapi/src/Client/JsonApi/Basket/Product/Standard.php line 337 with message
"Klasse "\Aimeos\MShop\Order\Manager\Base\Product\Attribute\Customordermanager" nicht verfügbar"

What I doing wrong or is it a bug?

aimeos/aimeos-core 2022.10.16
aimeos/ai-client-jsonapi 2022.10.4

Thank you for your support!

User avatar
aimeos
Administrator
Posts: 8238
Joined: 01 Jan 1970, 00:00

Re: Extend order/manager/standard wit own throws ertror in jsonapi

Post by aimeos » 28 Jul 2024, 09:29

Did you overwrite that method and pass another value as default name?
https://github.com/aimeos/aimeos-core/b ... #L966-L976

Does it work if you remove your configuration again?

Please note that 2022.10 is supported by the ELTS program of the Aimeos company only.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

heural
Posts: 63
Joined: 09 Jun 2022, 07:55

Re: Extend order/manager/standard wit own throws ertror in jsonapi

Post by heural » 29 Jul 2024, 14:00

I dont overwrite this method but yes I overwrite in config/mshop.php order/manager/base/name and order/manager/base/product/name.
We use offically 2023.x but I´ve tested locally on my system with 2022.x

In 2023.10 this issue seems not exists, it works as expected!

User avatar
aimeos
Administrator
Posts: 8238
Joined: 01 Jan 1970, 00:00

Re: Extend order/manager/standard wit own throws ertror in jsonapi

Post by aimeos » 30 Jul 2024, 08:45

Yes, in 2022 the manager name of the order product manager is used for the order product attribute manager too. This isn't the case in later versions any more.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply