Page 1 of 1

Add new fields to products and other stuff

Posted: 09 Nov 2017, 17:38
by mantik
I would add a new property to the Product.
How can i do that. In Extbase i do that in the Domain/Model/Object.php...

Re: Add new fields to products and other stuff

Posted: 09 Nov 2017, 20:54
by aimeos
In Aimeos you don't need to extend existing tables to store new properties. Instead, the mshop_product_property table can store any product data you have for your products. Use the product property manager to save that information, you can retrieve it together with the basic product data if you add 'product/property' to the domain parameter:

Code: Select all

$products = $productManager->searchItems( $filter, ['product/property'] );
If you have data that is shared by several products, store them in attributes. This will automatically generate a faceted search filter in the frontend if you add the attribute type to the list of allowed attribute types for the faceted search.

Re: Add new fields to products and other stuff

Posted: 10 Nov 2017, 12:55
by mantik
What i want do is works with the FE-Usergroups.
I know there is an additional Extension but i need it just for the products and would have a own field where i fetch all the USergroups.

i allready got it in the view. All what i must do is just to save it in the backend and get this field in the template.

Re: Add new fields to products and other stuff

Posted: 10 Nov 2017, 20:09
by aimeos
Using the ai-customergroups extension would be much simpler. If you want to do this yourself, you need to extend the item, manager, JQAdm class and template as well as the frontend template. For the JQAdm interface there's no documentation yet.