update slack msg
This commit is contained in:
@@ -55,7 +55,6 @@ class SlackNotifySubscriber implements EventSubscriberInterface
|
||||
return;
|
||||
}
|
||||
|
||||
//if (is_array($order->getData()[0]['positions'] != null)) {
|
||||
foreach ($order->getData()[0]['positions'] as $item) {
|
||||
if ($item['menge'] > 0) {
|
||||
|
||||
@@ -70,18 +69,16 @@ class SlackNotifySubscriber implements EventSubscriberInterface
|
||||
]);
|
||||
|
||||
$msg = "Bestellung {$order->getOrderId()}: \n";
|
||||
($item['marke'] ?: $msg .= $item['marke'] . '-');
|
||||
$msg .= $item['name'];
|
||||
$msg .= ' ' . $item['sku'];
|
||||
($item['han'] ?: $msg .= '-' . $item['han']);
|
||||
$msg .= ' Menge: ' . $item['menge'] . "\n";
|
||||
|
||||
if ($order->getStatus() == 1) {
|
||||
$slack->from('CDS-Notify')
|
||||
->send($msg);
|
||||
$slack->from('CDS-Notify')->send($msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,10 +87,6 @@ class SlackNotifySubscriber implements EventSubscriberInterface
|
||||
*/
|
||||
private function getWarehouseByGtin(string $gtin)
|
||||
{
|
||||
if ($gtin == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$product = $this->productRepository->findOneBy(['gtin' => $gtin]);
|
||||
|
||||
if ($product) {
|
||||
@@ -108,5 +101,4 @@ class SlackNotifySubscriber implements EventSubscriberInterface
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user