Add new customer address field in JQAdm backend - Decorator

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!
columbo
Advanced
Posts: 124
Joined: 09 Oct 2019, 09:42

Add new customer address field in JQAdm backend - Decorator

Post by columbo » 17 Jun 2021, 20:08

Hi,

I'd like to add in the Aimeos JQAdm/ admin-backen a new field to Customer > Address:
Unbenannt.PNG
Unbenannt.PNG (32.86 KiB) Viewed 3196 times
already added the field in:
\ext\ai-admin-jqadm\admin\jqadm\templates\customer\item-address-standard.php

created a decorator:
\ext\<my-extension>\lib\custom\src\MShop\Customer\Manager\Address\Decorator

Code: Select all

<?php
namespace Aimeos\MShop\Customer\Manager\Address\Decorator;

class Myproject extends \Aimeos\MShop\Common\Manager\Decorator\Base
{
    private $attr = [
        'mycolumn' => [
            'code' => 'mycolumn',
            'internalcode' => 'lvuad."mycolumn"',
            'label' => 'My new column',
            'type' => 'string',
            'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
        ],
    ];

    public function getSaveAttributes() : array
    {
        return parent::getSaveAttributes() + $this->createAttributes( $this->attr );
    }

    public function getSearchAttributes( bool $sub = true ) : array
    {
        return parent::getSearchAttributes( $sub ) + $this->createAttributes( $this->attr );
    }
}
and updated shop.php:

Code: Select all

'admin' => [
   'jqadm' => [
         'customer' => [
               'address' => [
                     'decorators' => [
                        'local' => ['Myproject']
                  ]
               ]
         ]
    ]
 ...
 ]

but this causes Error "Class "\Aimeos\Admin\JQAdm\Customer\Address\Decorator\Myproject" not found", and when using:

Code: Select all

 
 'mshop' => [
      'customer' => [
            'address' => [
                  'decorators' => [
                           'local' => ['Myproject']
                  ]
            ]
      ]
]
nothing happens, neither an error message nor an DB-entry

What I'm doing wrong? What's missing?

Thanks
Last edited by columbo on 20 Jun 2021, 13:37, edited 4 times in total.

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

Re: Add new customer address field in JQAdm backend - Decorator

Post by aimeos » 18 Jun 2021, 05:25

The correct configuration in your case is: https://aimeos.org/docs/2021.x/config/m ... atorslocal
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

columbo
Advanced
Posts: 124
Joined: 09 Oct 2019, 09:42

Re: Add new customer address field in JQAdm backend - Decorator

Post by columbo » 20 Jun 2021, 21:12

thanks - now its working fine.

Post Reply