$orders =
$this->
getOrders($sendTime);
if (empty($orders)) { return 'No orders for rating mail found.';
} $orderIds =
array_keys($orders);
$customers =
$this->
getCustomers($orderIds);
$orderPositions =
$this->
getPositions($orderIds);
$shopPositionBaseProducts =
$this->
structurePositionsArray($orderPositions);
$shopPositionImages =
$this->
getPositionImages($shopPositionBaseProducts);
$count = 0;
foreach ($orders as $orderId =>
$order) { if (empty($customers[$orderId]['email'
]) ||
empty($orderPositions[$orderId])) { continue;
} $repository =
Shopware()->
Models()->
getRepository(Shop::
class);
$shopId =
is_numeric($order['language'
]) ?
$order['language'
] :
$order['subshopID'
];
$shop =
$repository->
getActiveById($shopId);