Aimeos Laravel Package - Add more fields in Product form
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!
Aimeos Laravel Package - Add more fields in Product form
Hi,
I need help regarding product forms in Aimeos Administration panel. I want to add additional fields in the forms. Can anyone help me how I can do this?
Thanks!
I need help regarding product forms in Aimeos Administration panel. I want to add additional fields in the forms. Can anyone help me how I can do this?
Thanks!
Re: Aimeos Laravel Package - Add more fields in Product form
This depends a bit on the information you want to store because either you need to extend the managers and templates or you can add a new subpart. Can you explain which information you want to store?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Aimeos Laravel Package - Add more fields in Product form
I wish to add new fields to product form, e.g. a latitude and longitude field, country of origin, and few other modifications to existing fields.aimeos wrote:This depends a bit on the information you want to store because either you need to extend the managers and templates or you can add a new subpart. Can you explain which information you want to store?
If this is documented somewhere then please, share those links. Specially about "managers, templates, and subparts." I am in a hurry.
Thanks a lot!!!
Re: Aimeos Laravel Package - Add more fields in Product form
The easiest way is to use the product properties where you can add arbitrary information without extending the database or the managers/items. You can even provide a new subpart and template with specialized fields like the "Physical" subpanel to improve usability (weight, height, length and width are stored as product properties).
If you want the country of origin to be an option in the facetted search, you have to use attributes you associate to the products instead. Properties doesn't generate facetts.
For extending the admin interface there's no documentation yet. You have to have a look into the existing code to see how it works and copy/paste the things you need.
If you want to extend the database instead, you should read these articles:
Add tables and fields to the database: https://aimeos.org/docs/Developers#Database
Create or extend managers/items: https://aimeos.org/docs/Developers#Managers_and_items
If you want the country of origin to be an option in the facetted search, you have to use attributes you associate to the products instead. Properties doesn't generate facetts.
For extending the admin interface there's no documentation yet. You have to have a look into the existing code to see how it works and copy/paste the things you need.
If you want to extend the database instead, you should read these articles:
Add tables and fields to the database: https://aimeos.org/docs/Developers#Database
Create or extend managers/items: https://aimeos.org/docs/Developers#Managers_and_items
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Aimeos Laravel Package - Add more fields in Product form
Hi,aimeos wrote:The easiest way is to use the product properties where you can add arbitrary information without extending the database or the managers/items. You can even provide a new subpart and template with specialized fields like the "Physical" subpanel to improve usability (weight, height, length and width are stored as product properties).
If you want the country of origin to be an option in the facetted search, you have to use attributes you associate to the products instead. Properties doesn't generate facetts.
For extending the admin interface there's no documentation yet. You have to have a look into the existing code to see how it works and copy/paste the things you need.
If you want to extend the database instead, you should read these articles:
Add tables and fields to the database: https://aimeos.org/docs/Developers#Database
Create or extend managers/items: https://aimeos.org/docs/Developers#Managers_and_items
Where should I copy/paste the part of code? Obviously, I am using Laravel 5.6 so I have to do modifications according to Laravel 5.6. But the core Aimeos is not in Laravel.
Please, help!
Thanks!
Re: Aimeos Laravel Package - Add more fields in Product form
And is there any section from where I can add Manufacturers?aimeos wrote:The easiest way is to use the product properties where you can add arbitrary information without extending the database or the managers/items. You can even provide a new subpart and template with specialized fields like the "Physical" subpanel to improve usability (weight, height, length and width are stored as product properties).
If you want the country of origin to be an option in the facetted search, you have to use attributes you associate to the products instead. Properties doesn't generate facetts.
For extending the admin interface there's no documentation yet. You have to have a look into the existing code to see how it works and copy/paste the things you need.
If you want to extend the database instead, you should read these articles:
Add tables and fields to the database: https://aimeos.org/docs/Developers#Database
Create or extend managers/items: https://aimeos.org/docs/Developers#Managers_and_items
Thanks!
Re: Aimeos Laravel Package - Add more fields in Product form
If you create a new subpanel for the admin interface, it has to be in the same directory structure as in the ./ext/ai-admin-jqadm/admin/jqadm/src/ folder of your own Aimeos extension.
Manufacturers (called suppliers in Aimeos) have their own panel in the admin interface. There you can also associate products to them.
Manufacturers (called suppliers in Aimeos) have their own panel in the admin interface. There you can also associate products to them.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Aimeos Laravel Package - Add more fields in Product form
What if I only want to add a new field in Product form in Admin Panel? I have followed all steps mentioned in following link: https://aimeos.org/docs/Developers/Libr ... gers_itemsaimeos wrote:If you create a new subpanel for the admin interface, it has to be in the same directory structure as in the ./ext/ai-admin-jqadm/admin/jqadm/src/ folder of your own Aimeos extension.
Manufacturers (called suppliers in Aimeos) have their own panel in the admin interface. There you can also associate products to them.
But new field value is not being saved. I am sure I am missing something. In your above comment you said to add code in ./ext/ai-admin-jqadm/admin/jqadm/src/ folder but in the link the writer asks to create class in this directory: ./<yourext>/lib/custom/src/MShop/Product/Item/Myproject.php
Please, help!
Thanks!
Re: Aimeos Laravel Package - Add more fields in Product form
Yes, you have to follows the steps in that article and create an extended item and manager.mohal_04 wrote: What if I only want to add a new field in Product form in Admin Panel? I have followed all steps mentioned in following link: https://aimeos.org/docs/Developers/Libr ... gers_items
Afterwards, you can add your new field to the product basic panel. If you implemented toArray() and fromArray() of the item correctly, it will be saved by your extended saveItem() method of your manager.mohal_04 wrote: But new field value is not being saved. I am sure I am missing something. In your above comment you said to add code in ./ext/ai-admin-jqadm/admin/jqadm/src/ folder but in the link the writer asks to create class in this directory: ./<yourext>/lib/custom/src/MShop/Product/Item/Myproject.php
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos,
give us a star
If you like Aimeos,

Re: Aimeos Laravel Package - Add more fields in Product form
Thank you so much for the help! I have nothing inside saveItem(). Can you guide me what to write in it? The input field name is "item[product.oldcode]"aimeos wrote:Yes, you have to follows the steps in that article and create an extended item and manager.mohal_04 wrote: What if I only want to add a new field in Product form in Admin Panel? I have followed all steps mentioned in following link: https://aimeos.org/docs/Developers/Libr ... gers_items
Afterwards, you can add your new field to the product basic panel. If you implemented toArray() and fromArray() of the item correctly, it will be saved by your extended saveItem() method of your manager.mohal_04 wrote: But new field value is not being saved. I am sure I am missing something. In your above comment you said to add code in ./ext/ai-admin-jqadm/admin/jqadm/src/ folder but in the link the writer asks to create class in this directory: ./<yourext>/lib/custom/src/MShop/Product/Item/Myproject.php
Here is my code (copied as is)
Code: Select all
namespace Aimeos\MAdmin\Product\Manager;
class Myproject extends Standard
{
private $searchConfig = array(
'product.oldcode'=> array(
'code'=>'product.oldcode',
'internalcode'=>'mpro."oldcode"',
'label'=>'Product oldcode',
'type'=> 'string', // integer, float, etc.
'internaltype'=> \Aimeos\MW\DB\Statement\Base::PARAM_STR, // _INT, _FLOAT, etc.
),
);
public function saveItem( \Aimeos\MShop\Common\Item\Iface $item, $fetch = true )
{
// a modified copy of the code from the parent class
// extended by a bind() call and updated bind positions (first parameter)
}
public function getSearchAttributes( $withsub = true )
{
$list = parent::getSearchAttributes( $withsub );
foreach( $this->searchConfig as $key => $fields ) {
$list[$key] = new \Aimeos\MW\Criteria\Attribute\Standard( $fields );
}
return $list;
}
protected function createItemBase( array $values = [] /* , ... */ )
{
return new \Aimeos\MShop\Product\Item\Myproject( $values /* , ... */ );
}
}