Checkout Page

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)
Spam and unrelated posts will be removed immediately!
Richard0945
Posts: 2
Joined: 24 Nov 2016, 21:55

Checkout Page

Post 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.

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Checkout Page

Post 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 ... rd.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 ... andard.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/b ... ce.php#L70
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Richard0945
Posts: 2
Joined: 24 Nov 2016, 21:55

Re: Checkout Page

Post 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.

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Checkout Page

Post by aimeos » 01 Dec 2016, 10:38

Let Laravel inject the context into your controller class like this:
https://github.com/aimeos/aimeos-larave ... ge.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 );
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply