how can i extend Common Address Item?

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Ahmad
Posts: 72
Joined: 05 Jul 2017, 15:19

how can i extend Common Address Item?

Post by Ahmad » 13 Jan 2018, 19:30

i want to change in my customer address fields,
i add 2 new fields to table users for customer address, and i now i want to retrieve those from customer manager getPaymentAddress() function, but when i extend common/item/address manager based onthis instruction, the project don't overwrite my class and don't refer to my custom class on this address: myextension/lib/custom/src/MShop/Common/Item/Address/MyStandard
i have a mshop.php config that have:

Code: Select all

<?php
return [
    'common' => [
        'item' => [
            'address' => [
                'name' => 'MyStandard'
            ]
        ],
        'manager' => [
            'address' => [
                'name' => 'MyStandard'
            ]
        ]
    ],
    'order' => [
        'item' => [
            'base' => [
                'address' => [
                    'name' => 'MyStandard'
                ]
            ]
        ],
        'manager' => [
            'base' => [
                'address' => [
                    'name' => 'MyStandard'
                ]
            ]
        ],
    ],
];
i extent Order/Item/Base/Address and this worked for me, but for Common/Item/Address doesn't work,

I want to do this for add my custom database field for users table which are related to the customer's address,
I want to retrieve this fields on the toArray function of address item, and add setMyField and getMyField function to own extended address item
what should i do?

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

Re: how can i extend Common Address Item?

Post by aimeos » 15 Jan 2018, 15:20

Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply