Implement own data domain

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!
MikaelNazarenko
Expert
Posts: 274
Joined: 27 Jun 2019, 16:19

Implement own data domain

Post by MikaelNazarenko » 18 Aug 2019, 12:22

Hi my friends,

My environment is the following:
Laravel Framework 5.8.26
aimeos-laravel 2019.07
PHP Version 7.2.19-1+ubuntu18.04.1+deb.sury.org+1

I have red this topic Re: Custom data domain but seems it is for old versions.

For now I have the following modifications:

/var/www/schmuck/ext/labor/lib/custom/setup/default/schema/product.php :

Code: Select all

return array(
    'table' => array(
        'mshop_product_group' => function ( \Doctrine\DBAL\Schema\Schema $schema ) {

            $table = $schema->createTable( 'mshop_product_group' );

            $table->addColumn( 'id', 'integer', array( 'autoincrement' => true ) );
            $table->addColumn( 'siteid', 'integer', array( 'notnull' => false ) );
            $table->addColumn( 'code', 'string', array( 'length' => 32 ) );
            $table->addColumn( 'label', 'string', array( 'length' => 255 ) );
            $table->addColumn( 'mtime', 'datetime', [] );
            $table->addColumn( 'ctime', 'datetime', [] );
            $table->addColumn( 'editor', 'string', array( 'length' => 255 ) );

            $table->setPrimaryKey( array( 'id' ), 'pk_msprodgr_id' );
            $table->addUniqueIndex( array( 'siteid', 'code' ), 'unq_msprodgr_sid_code' );
            $table->addIndex( array( 'siteid', 'label' ), 'idx_msprodgr_sid_label' );

            return $schema;
        },
    ),
);
To the navbar config I have added:

Code: Select all

                'product' => [
                    'product',
                    'product/group'
                ],
From original aimeos extension I have copied this /var/www/schmuck/ext/labor/admin/jqadm/src/Product to my custom extension. Also in Product folder I created Group folder with Standard inside. But in admin panel I got only Product->Products, but I expect to get Product-> (Products, Groups)

I guess I need to add manager for new domain and maybe something else. Help me please what else I need ?

Thanks a lot!

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

Re: Implement own data domain

Post by aimeos » 19 Aug 2019, 12:46

If you need to link products to customer groups, the easiest way is the ai-customergroups extension from the Aimeos company: https://aimeos.com/extensions#c437
If you want to group products together in the frontend, you can use an attribute associated to the products instead. Can you explain a bit more in detail what you want to achieve?

The topic you reference is for Aimeos 2016.x and before and not relevant any more for extending the admin interface.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

MikaelNazarenko
Expert
Posts: 274
Joined: 27 Jun 2019, 16:19

Re: Implement own data domain

Post by MikaelNazarenko » 20 Aug 2019, 12:43

Hi, great thank you for the help! I am very glad that I have chosed Aimeos for development. Now I have pretty complicated task:
Each product may belong to several 'Price groups'. And for each belonged group must be different prices. For example:

Product 1 belongs to Group 1 and Group 2. For Product 1-> Group 1 price is 100$, but for Product 1 -> Group 2 the price is 200$.
On the other side, each user will have only one specific price group. so user with Group 1 will see price 100$, but another user with group 2 will see price 200$.

Please give me at least general idea how to implement it better ? Cuz you are guru in Aimeos!

I am very thankful !

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

Re: Implement own data domain

Post by aimeos » 20 Aug 2019, 14:31

The ai-customergroups extension from the Aimeos company does exactly that. They associate customers or customer groups to products (and other items) via the list table and filter the price depending on the logged in user.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply