How to configure and adapt Aimeos based shops as developer
Forum rules: Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
#3673 by Richard0945
24 Nov 2016, 21:57
I am trying to find a controller that is linked to the order page that submits data to mshop_order_base_product

I want to extract all of the items that the user has just ordered (need a to find function for that) and then submit those items into a new table I have created.
#3678 by aimeos
25 Nov 2016, 09:59
There's an order controller that has a store() method which cares about saving the basket to the mshop_order* tables:
https://github.com/aimeos/ai-controller-frontend/blob/master/controller/frontend/src/Controller/Frontend/Order/Standard.php#L35

Note that no payment has been executed for that order at this point and it's uncertain if the order will be payed in the future. I you only want to retrieve payed orders, you should implement an async job controller (cronjob) like that one: https://github.com/aimeos/ai-controller-jobs/blob/master/controller/jobs/src/Controller/Jobs/Order/Cleanup/Unfinished/Standard.php

You can get the complete order (or only parts from) by using the load() method of the order base manager:
https://github.com/aimeos/aimeos-core/blob/master/lib/mshoplib/src/MShop/Order/Manager/Base/Iface.php#L70
#3708 by Richard0945
01 Dec 2016, 01:03
Is there a way where I can create a controller in App\Http\Controllers and call Aimeos Functions There?
Id like to extract the order details just product code, name, quantity.
#3711 by aimeos
01 Dec 2016, 10:38
Let Laravel inject the context into your controller class like this:
https://github.com/aimeos/aimeos-laravel/blob/master/src/Aimeos/Shop/Base/Page.php#L57

Then you can use the context to create the manager and get the orders:
Code: Select all$context = $this->context->get();
$manager = \Aimeos\MShop\Factory::createManager( $context, 'order/base/product' );

$search = $manager->createSearch();
$search->setConditions( $search->compare( '>=', 'order.base.ctime' '2016-12-01 00:00:00' ) );
$search->setSlice( 0, 100 );

$orderedProducts = $manager->searchItems( $search );