Announcement

Collapse
No announcement yet.

Get itemlist from salesorder entity

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Get itemlist from salesorder entity

    Hello,

    Is it correct i dont get the itemList property if i use this line of code?
    So actually in general, the getEntityById doesnt return related entities?

    Code:
     $salesOrder = $this->entityManager->getEntityById('SalesOrder', $salesOrderId);
    Once I ask for itemList it returns me null
    Code:
     $salesOrderItemList =  $salesOrder->get('itemList');

  • #2
    PHP Code:
    $items $this->entityManager
        
    ->getRDBRepository('SalesOrderItem')
        ->
    where(['salesOrderId' => $salesOrderId])
        ->
    order('order')
        ->
    find(); 
    Last edited by yuri; 11-13-2023, 08:06 PM.

    Comment

    Working...
    X