From 30e53fa5c69fc3f6f33f2881bf5311611c006206 Mon Sep 17 00:00:00 2001 From: Dmitry Mamontov Date: Fri, 12 Jan 2018 14:05:04 +0300 Subject: [PATCH] Add customer comment (#26) --- retailcrm/retailcrm.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/retailcrm/retailcrm.php b/retailcrm/retailcrm.php index 05203e4..5be7a29 100644 --- a/retailcrm/retailcrm.php +++ b/retailcrm/retailcrm.php @@ -410,6 +410,14 @@ class RetailCRM extends Module } $orderdb = new Order($params['order']->id); + + $comment = $orderdb->getFirstMessage(); + if ($comment !== false) { + $order['customerComment'] = $comment; + } + + unset($comment); + foreach ($orderdb->getProducts() as $item) { if (isset($item['product_attribute_id']) && $item['product_attribute_id'] > 0) { $productId = $item['product_id'] . '#' . $item['product_attribute_id'];