Skip to content

Commit

Permalink
Don't required "order" as include to return addresses, coupons, produ…
Browse files Browse the repository at this point in the history
…cts, services
  • Loading branch information
aimeos committed Feb 9, 2024
1 parent 78e5337 commit eecea8a
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions src/Admin/JsonAdm/Order/Standard.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,30 +187,27 @@ protected function getChildItems( \Aimeos\Map $items, array $include ) : \Aimeos
{
$list = map();

if( in_array( 'order', $include ) )
{
$ids = map( $items )->getId()->toArray();
$manager = \Aimeos\MShop::create( $this->context(), 'order' );
$ids = map( $items )->getId()->toArray();
$manager = \Aimeos\MShop::create( $this->context(), 'order' );

$search = $manager->filter( false, true );
$search->setConditions( $search->and( [
$search->compare( '==', 'order.id', $ids ),
$search->getConditions()
] ) );
$search = $manager->filter( false, true );
$search->setConditions( $search->and( [
$search->compare( '==', 'order.id', $ids ),
$search->getConditions()
] ) );

$orders = $manager->search( $search, $include );
$orders = $manager->search( $search, $include );

$list = $list->merge( $orders )
->merge( $orders->getAddresses()->flat() )->merge( $orders->getCoupons()->flat() )
->merge( $orders->getProducts()->flat() )->merge( $orders->getServices()->flat() );
$list = $list->merge( $orders )
->merge( $orders->getAddresses()->flat() )->merge( $orders->getCoupons()->flat() )
->merge( $orders->getProducts()->flat() )->merge( $orders->getServices()->flat() );

foreach( $orders->getProducts()->flat() as $row ) {
$list->merge( $row->getAttributeItems() );
}
foreach( $orders->getProducts()->flat() as $row ) {
$list->merge( $row->getAttributeItems() );
}

foreach( $orders->getServices()->flat() as $row ) {
$list->merge( $row->getAttributeItems() );
}
foreach( $orders->getServices()->flat() as $row ) {
$list->merge( $row->getAttributeItems() );
}

if( in_array( 'order/status', $include ) )
Expand Down

0 comments on commit eecea8a

Please sign in to comment.