language form-add new field

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!
khizar
Posts: 99
Joined: 19 Jan 2021, 09:51

Re: language form-add new field

Post by khizar » 30 Jan 2021, 10:33

aimeos wrote: 30 Jan 2021, 10:31 Don't extend from the Standard locale site manager class if you are using the ai-sites extension:

Code: Select all

class Myproject extends Standard
Instead, extend from the "Sites" class of that extension:

Code: Select all

class Myproject extends Sites
i have tried that but when i extend from sites these methods in manager do not work

Code: Select all

public function getSearchAttributes( bool $withsub = true ) : array
    {   
        $list = parent::getSearchAttributes( $withsub );
        
        foreach( $this->searchConfig as $key => $fields ) {
            $list[$key] = new \Aimeos\MW\Criteria\Attribute\Standard( $fields );
        }
       
        return $list;
    }
    protected function createItemBase( array $data = [] ) : \Aimeos\MShop\Locale\Item\Site\Iface
	{
       
		
		return new \Aimeos\MShop\Locale\Item\Site\Myproject( $data );
	}
and without these methods i cannot show my new field on form

khizar
Posts: 99
Joined: 19 Jan 2021, 09:51

Re: language form-add new field

Post by khizar » 30 Jan 2021, 11:05

aimeos wrote: 30 Jan 2021, 10:31 Don't extend from the Standard locale site manager class if you are using the ai-sites extension:

Code: Select all

class Myproject extends Standard
Instead, extend from the "Sites" class of that extension:

Code: Select all

class Myproject extends Sites
hey aimeos,
actually i have extended my manager from Sites class but method

Code: Select all

	protected function createItemBase( array $data = [] ) : \Aimeos\MShop\Locale\Item\Site\Iface
	{
       
		
		return new \Aimeos\MShop\Locale\Item\Site\Myproject( $data );
	}
inside my manager is not working.it is necessary in order to use my item class to add my custom field.

khizar
Posts: 99
Joined: 19 Jan 2021, 09:51

Re: language form-add new field

Post by khizar » 01 Feb 2021, 05:08

please guide me which method should i use instead of createItemBase when extending from Sites class because it is not
working as you know it is a protected method from Standard Class

khizar
Posts: 99
Joined: 19 Jan 2021, 09:51

Re: language form-add new field

Post by khizar » 01 Feb 2021, 05:40

hey aimeos can please have a look on that problem

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

Re: language form-add new field

Post by aimeos » 01 Feb 2021, 08:38

If you haven't added a \Aimeos\MShop\Locale\Item\Site\Myproject class yet, you should do that like described in the docs:
https://aimeos.org/docs/latest/infrastr ... ers/#items
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply