Get Base Order from Order item

Help for integrating the Laravel package
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!
MikaelNazarenko
Expert
Posts: 274
Joined: 27 Jun 2019, 16:19

Get Base Order from Order item

Post by MikaelNazarenko » 15 Nov 2019, 10:50

Hello, on the front-end, customer profile we have list of orders. On the view file there is $orderItems variable and it is array of \Aimeos\MShop\Order\Item\Standard. But how can I get \Aimeos\MShop\Order\Base\Item\Standard from Order item ? In the mshop_order table there is baseid filed and it is linked to mshop_order_base table. But how can I get order_base item from order item ? Order object has getBaseId() method. So I have collect all base ids and get them from db .... ? Not comfortable.. ((

what is the right way ?

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

Re: Get Base Order from Order item

Post by aimeos » 16 Nov 2019, 16:13

Right now, you have to loop over the order items and get the base IDs to fetch the order base items (baskets) afterwards.
We are currently in the process of merging mshop_order and mshop_order_base tables so in 2020.x things will get easier.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply