Add supplier drop down option to Aimeos Admin?
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!
Add supplier drop down option to Aimeos Admin?
Hi
I am trying to add suppliers options for each product in the Aimeos admin and I need to get that in the front end?
currently see my screenshot I don't have that option
can you please help me?
I am trying to add suppliers options for each product in the Aimeos admin and I need to get that in the front end?
currently see my screenshot I don't have that option
can you please help me?
Last edited by bill on 30 Jun 2017, 03:47, edited 1 time in total.
Re: Add supplier drop down option to Aimeos Admin?
Do it the other way round: Go to the Supplier tab and add your products to that supplier. You can then fetch the supplier data by looking up the product ID.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Add supplier drop down option to Aimeos Admin?
Can you show me the code to fetch the supplier by product ID ? Assuming I am in the basket page ?
Re: Add supplier drop down option to Aimeos Admin?
What is really the best way to get it inside the client/html/basket/body-default.php ; I need to print the supplier Code for the product attached to it
I did this code below but seems its doing a search twice? one for 'supplier/list' and one for 'supplier'? is there away we can make it simpler?
I did this code below but seems its doing a search twice? one for 'supplier/list' and one for 'supplier'? is there away we can make it simpler?
Code: Select all
// NOT SURE WHY I cant get $conext variable inside the template files??
$context = App::make('\Aimeos\Shop\Base\Context')->get(true);
$manager = \Aimeos\MShop\Factory::createManager( $context, 'supplier/lists' );
$search = $manager->createSearch( true );
$expr = array(
$search->compare( '==', 'supplier.lists.refid', $product->getProductId() ),
$search->compare( '==', 'supplier.lists.domain', 'product' ),
$search->getConditions(),
);
$search->setConditions( $search->combine( '&&', $expr ) );
$supplierItems = $manager->searchItems( $search);
foreach( $supplierItems as $item ) {
$supID = $item->getParentId() ;
}
// find the supplier code
$manager = \Aimeos\MShop\Factory::createManager( $context, 'supplier' );
$search = $manager->createSearch( true );
$expr = array(
$search->compare( '==', 'supplier.id', $supID ),
$search->getConditions(),
);
$search->setConditions( $search->combine( '&&', $expr ) );
$supplier = $manager->searchItems( $search);
foreach( $supplier as $item ) {
print_r($item->getCode());
}
Re: Add supplier drop down option to Aimeos Admin?
You can shorten this to:
The reason why the context isn't available in the templates is that templates are only for creating the output based on the assigned data. Fetching and managing the data is the task of the client (controller). This separation is extremely important to be able to maintain applications in the long run.
Code: Select all
$context = App::make('\Aimeos\Shop\Base\Context')->get(true);
$manager = \Aimeos\MShop\Factory::createManager( $context, 'supplier' );
$search = $manager->createSearch( true );
$expr = array(
$search->compare( '==', 'supplier.lists.refid', $product->getProductId() ),
$search->compare( '==', 'supplier.lists.domain', 'product' ),
$search->getConditions(),
);
$search->setConditions( $search->combine( '&&', $expr ) );
print_r( $manager->searchItems( $search ) );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Add supplier drop down option to Aimeos Admin?
If I want to add this code in our /ext folder for the client controller , can I override or add it to the (client) controller instead inside the template code?
is that possible and how we could do that?
Thanks in advance
is that possible and how we could do that?
Thanks in advance
Re: Add supplier drop down option to Aimeos Admin?
To dynamically add data to views, please have a look at how to implement a client decorator:
https://aimeos.org/docs/Developers/Html ... components
The context is decorators is already available via
https://aimeos.org/docs/Developers/Html ... components
The context is decorators is already available via
Code: Select all
$this->getContext()
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Expert
- Posts: 274
- Joined: 27 Jun 2019, 16:19
Re: Add supplier drop down option to Aimeos Admin?
Hi community!
For me this is also actual problem now. I would like to add possibility in admin to set supplier inside product..
Was something changed now regarding to this problem ?
My components are pretty fresh I think:
For me this is also actual problem now. I would like to add possibility in admin to set supplier inside product..
Was something changed now regarding to this problem ?
My components are pretty fresh I think:
Code: Select all
aimeos/ai-admin-jqadm 2021.04.6 Aimeos Vue.js+Bootstrap admin interface
aimeos/ai-admin-jsonadm 2021.04.1 Aimeos ai-admin-jsonadm extension
aimeos/ai-client-html 2021.04.7 Aimeos ai-client-html extension
aimeos/ai-client-jsonapi 2021.04.1 Aimeos JSON API extension
aimeos/ai-cms-grapesjs 2021.04.2 Aimeos GrapesJS CMS extension
aimeos/ai-controller-frontend 2021.04.1 Aimeos ai-controller-frontend extension
aimeos/ai-controller-jobs 2021.04.3 Aimeos ai-controller-jobs extension
aimeos/ai-gettext 2021.04.1 Aimeos Gettext extension
aimeos/ai-laravel 2021.04.3 Laravel adapter for Aimeos web shops and e-commerce solutions
aimeos/ai-swiftmailer 2021.04.1 SwiftMailer adapter for Aimeos web shops and e-commerce solutions
aimeos/aimeos-core 2021.04.3 Full-featured e-commerce components for high performance online shops
aimeos/aimeos-laravel 2021.04.4 Professional, full-featured and high performance Laravel e-commerce package for online shops and complex B2B projects
aimeos/map 2.2.0 Easy and elegant handling of PHP arrays as array-like map objects similar to jQuery and Laravel Collections
Re: Add supplier drop down option to Aimeos Admin?
In the current version this is already possible in the "Supplier" tab of the product detail view of the admin backend.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Expert
- Posts: 274
- Joined: 27 Jun 2019, 16:19
Re: Add supplier drop down option to Aimeos Admin?
Great! Thank you so much for the quick help ! So seems I need to update aimeos/aimeos-core ? What the current version ?