/** * Build Description Information for the Transaction * @param \Magento\Sales\Model\Order $order * @param string $lineSeparator * @return string */ public function buildOrderDescriptionText($order, $lineSeparator = PHP_EOL) { $orderDescriptionText = ""; $orderItems = $order->getItems(); foreach ($orderItems as $orderItem) { $separator = $orderItem == end($orderItems) ? '' : $lineSeparator; $orderDescriptionText .= $orderItem->getQtyOrdered() . ' x ' . $orderItem->getName() . $separator; } return $orderDescriptionText; }
/** * 2016-09-07 * @param O $o * @return string */ function df_oi_roots(O $o) { return array_filter($o->getItems(), function (OI $i) { return !$i->getParentItem(); }); }
/** * Returns list of line items in the cart * * @return \Magento\Sales\Api\Data\OrderItemInterface[] */ public function getItems() { return $this->order->getItems(); }