Object initiation
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!
Object initiation
Hi all,
I'm currently working on the myaccount history page. More concrete, I'm updating the list of orders a user has ordered. Therefore, I'm updating the following view into my ext folder: /client/html/templates/account/history/list-body-default.php
In the list I'm showing:
More concrete :
But I'm doing something wrong because this is not working.
Who can advise me on this one?
Thanks a lot!
Regards,
Kevin
I'm currently working on the myaccount history page. More concrete, I'm updating the list of orders a user has ordered. Therefore, I'm updating the following view into my ext folder: /client/html/templates/account/history/list-body-default.php
In the list I'm showing:
- Order id
Order date
Payment status
Delivery status
Link to order detail
More concrete :
Code: Select all
$context = App::make('\Aimeos\Shop\Base\Context')->get(false);
$manager = \Aimeos\MShop\Factory::createManager( $context, 'order' );
Who can advise me on this one?
Thanks a lot!
Regards,
Kevin
Re: Object initiation
You can't create managers in the view!
Instead, create a decorator for the account/history client which uses the order/base manager to retrieve the data you need: https://aimeos.org/docs/index.php?title ... ldid=50181
You can get the data in the decorator using:
Afterwards, you can match both by the base ID in your template.
Instead, create a decorator for the account/history client which uses the order/base manager to retrieve the data you need: https://aimeos.org/docs/index.php?title ... ldid=50181
You can get the data in the decorator using:
Code: Select all
$context = $this->getContext();
$manager = \Aimeos\MShop\Factory::createManager( $context, 'order/base' );
$search = $manager->createSearch();
$search->setConditions( $search->compare( '==', 'order.base.customerid', $context->getUserId() ) );
$view->myprojectOrderBaseItems = $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: Object initiation
Hi Aimeos,
Makes sense, thanks!
One questions, where (in what folder) do we need to write decorators?
K.
Makes sense, thanks!
One questions, where (in what folder) do we need to write decorators?
K.
Re: Object initiation
In ./client/html/src/Client/Html/Common/Decorator/ so it matches the namespace
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