Add column in mshop_customer (Issue)
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!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Add column in mshop_customer (Issue)
Hi,
I added following code on my custom extension ./ext/myext/lib/custom/setup/default/schema/customer.php
and added following code in ./ext/myext/lib/custom/src/MShop/Customer/Manager/Decorator/Myproject.php
namespace Aimeos\MShop\Customer\Manager\Decorator;
and added ./ext/myext/config/mshop.php
after that i run php artisan serve. But column not created.
am i missing something? please provide me step.
I added following code on my custom extension ./ext/myext/lib/custom/setup/default/schema/customer.php
Code: Select all
<?php
//https://aimeos.org/docs/Developers/Library/Extend_managers_items
return array(
'table' => array(
'mshop_customer' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {
$table = $schema->getTable( 'mshop_customer' );
$table->addColumn( 'vendor_name', 'string', array( 'length' => 32, 'notnull' => false ) );
return $schema;
},
),
);
and added following code in ./ext/myext/lib/custom/src/MShop/Customer/Manager/Decorator/Myproject.php
namespace Aimeos\MShop\Customer\Manager\Decorator;
Code: Select all
class Myproject extends \Aimeos\MShop\Common\Manager\Decorator\Base
{
private $attr = [
'vendor_name' => [
'code' => 'vendor_name',
'internalcode' => 'mcus."vendor_name"',
'label' => 'My new column',
'type' => 'string',
'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
],
];
public function getSaveAttributes()
{
return parent::getSaveAttributes() + $this->createAttributes( $this->attr );
}
public function getSearchAttributes( $sub = true )
{
return parent::getSearchAttributes( $sub ) + $this->createAttributes( $this->attr );
}
}
Code: Select all
return [
'customer' => [
'manager' => [
'decorators' => [
'local' => ['Myproject']
],
],
],
];
am i missing something? please provide me step.
Re: Add column in mshop_customer (Issue)
Code: Select all
./artisan serve
Code: Select all
./artisan aimeos:setup
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Add column in mshop_customer (Issue)
Thanks and when i tried to php artisan aimeos:setup then i got "Aimeos\MW\Setup\Exception : No databases configured in resource config file"
I checked and found that i set database configuration on the .env file but i missed to add database configuration on the config.shop -> resource -> db.
After setup, artisan aimeos:setup work successfully and created column.
Thanks for the help.
I checked and found that i set database configuration on the .env file but i missed to add database configuration on the config.shop -> resource -> db.
After setup, artisan aimeos:setup work successfully and created column.
Thanks for the help.