update slack msg

This commit is contained in:
Marko
2024-03-01 10:15:12 +01:00
parent bc1c6b85bc
commit b950238865
6 changed files with 129 additions and 53 deletions

View File

@@ -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;
}
}