Re: Feature: Suppliers (extra fields / translations)
Posted: 12 Aug 2015, 12:44
The best way is to create a mshop_supplier_list table and a corresponding manager like described in one of the former posts. Than you can link to all other items you need and retrieve them with a single call to searchItems(). Doing it the other way round would be far more difficult in terms of collecting the data.Yvler wrote: What is the best way to link these items to a supplier (mshop_supplier)? Via the list tables of the the items itself (mshop_text_list, mshop_attribute_list, mshop_media_list) or add an extra list table to suppliers (mshop_supplier_list)?
In this case I would link the products to the suppliers via the new mshop_supplier_list table just like the catalog domain does. Then you can create a new "catalog supplier" component that works very similar to the catalog list component or its "promo" resp. "head" subpart: https://aimeos.org/docs/Developers/Html ... componentsYvler wrote: As a result of this, we would like to generate a list (like the categories listing) on the front end with products of a specific supplier, with the supplier logo and description on top of the listing . (how do we extend this?)
To get all suppliers for a product in the detail view, you then need to search for "supplier.list.refid"=<productid> and "supplier.list.domain"='product'. If you implement it like this, we would love to integrate your changes into the Aimeos core, so your application can be upgraded any time later without changes
You could also do it the other way round, i.e. link suppliers to the products via the mshop_product_list table and get all products for a specific supplier by searching for "product.list.refid"=<supplierid> and "product.list.domain"='supplier'. The downside is that this would put a lot of pressure on the mshop_product_list table for large amounts of products which MySQL won't cope well, so we would try to avoid this at any cost in the official code.