Page 1 of 1

how can i extend Common Address Item?

Posted: 13 Jan 2018, 19:30
by Ahmad
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?

Re: how can i extend Common Address Item?

Posted: 15 Jan 2018, 15:20
by aimeos