extend product and customer manager

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!
yong
Posts: 43
Joined: 10 Apr 2019, 12:55

extend product and customer manager

Post by yong » 18 Jul 2019, 10:38

Hi ! I updated the mshop_product table, i have now a "one to many" relation between table users and table mshop_product , now i want to extend the manager and the item of the domain product and customer and use getRefItems or another function to search a customer with a customer id ! but i don't know to do it ; i read the getRefItems clas in MShop/Common/Manager/ListRef/Traits but i don't understand how to extend it and how it works

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

Re: extend product and customer manager

Post by aimeos » 18 Jul 2019, 17:20

How does your tables now look like?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

yong
Posts: 43
Joined: 10 Apr 2019, 12:55

Re: extend product and customer manager

Post by yong » 20 Jul 2019, 12:51

I just add :
- column "user_id" in the table mshop_product
- table "groups"
- table "user_groups" with a couple of foreign key "user_id" and "group_id"
I want a function to help me know how many product matching with an user_id (how many product a user own) !

yong
Posts: 43
Joined: 10 Apr 2019, 12:55

Re: extend product and customer manager

Post by yong » 20 Jul 2019, 12:53

And also with the user_id know in wich groups (in the table groups ) correspond to a user !

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

Re: extend product and customer manager

Post by aimeos » 21 Jul 2019, 11:12

The customer groups extension of the Aimeos company (https://aimeos.com/extensions#c437) uses the mshop_product_list table to associate products to customers and customer groups. That's much easier than adding custom columns to the table and you can use getRefItems() for retrieving the customer groups for the products automatically.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply