From 8aea8ca5c5250c15e3b2379c66ac492f44737c69 Mon Sep 17 00:00:00 2001 From: Mark Shust Date: Thu, 31 May 2018 17:20:24 -0400 Subject: [PATCH 1/2] Create ability to set is_visible_on_front to order status history comment --- app/code/Magento/Sales/Model/Order.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php index 85443ee7f4f11..4693e0dd74df4 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -1009,7 +1009,7 @@ public function addStatusToHistory($status, $comment = '', $isCustomerNotified = * @param bool|string $status * @return OrderStatusHistoryInterface */ - public function addStatusHistoryComment($comment, $status = false) + public function addStatusHistoryComment($comment, $status = false, $isVisibleOnFront = false) { if (false === $status) { $status = $this->getStatus(); @@ -1024,6 +1024,8 @@ public function addStatusHistoryComment($comment, $status = false) $comment )->setEntityName( $this->entityType + )->setIsVisibleOnFront( + $isVisibleOnFront ); $this->addStatusHistory($history); return $history; From 594203c52e82ac26fa86c09d5f3f9ab36ec20492 Mon Sep 17 00:00:00 2001 From: Stanislav Idolov Date: Tue, 19 Jun 2018 10:56:46 +0300 Subject: [PATCH 2/2] Fixed according to Backward compatible development guide --- app/code/Magento/Sales/Model/Order.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php index 4693e0dd74df4..6de0fe4459fa6 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -1008,8 +1008,24 @@ public function addStatusToHistory($status, $comment = '', $isCustomerNotified = * @param string $comment * @param bool|string $status * @return OrderStatusHistoryInterface + * @deprecated + * @see addCommentToStatusHistory */ - public function addStatusHistoryComment($comment, $status = false, $isVisibleOnFront = false) + public function addStatusHistoryComment($comment, $status = false) + { + return $this->addCommentToStatusHistory($comment, $status, false); + } + + /** + * Add a comment to order status history + * Different or default status may be specified + * + * @param string $comment + * @param bool|string $status + * @param bool $isVisibleOnFront + * @return OrderStatusHistoryInterface + */ + public function addCommentToStatusHistory($comment, $status = false, $isVisibleOnFront = false) { if (false === $status) { $status = $this->getStatus();