Skip to content

Commit 930baef

Browse files
author
Stanislav Idolov
authored
ENGCOM-2369: [Backport] Create ability to set is_visible_on_front to order status history comment #16846
2 parents 210689a + 96b609b commit 930baef

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

app/code/Magento/Sales/Model/Order.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,8 +993,24 @@ public function addStatusToHistory($status, $comment = '', $isCustomerNotified =
993993
* @param string $comment
994994
* @param bool|string $status
995995
* @return OrderStatusHistoryInterface
996+
* @deprecated
997+
* @see addCommentToStatusHistory
996998
*/
997999
public function addStatusHistoryComment($comment, $status = false)
1000+
{
1001+
return $this->addCommentToStatusHistory($comment, $status, false);
1002+
}
1003+
1004+
/**
1005+
* Add a comment to order status history
1006+
* Different or default status may be specified
1007+
*
1008+
* @param string $comment
1009+
* @param bool|string $status
1010+
* @param bool $isVisibleOnFront
1011+
* @return OrderStatusHistoryInterface
1012+
*/
1013+
public function addCommentToStatusHistory($comment, $status = false, $isVisibleOnFront = false)
9981014
{
9991015
if (false === $status) {
10001016
$status = $this->getStatus();
@@ -1009,6 +1025,8 @@ public function addStatusHistoryComment($comment, $status = false)
10091025
$comment
10101026
)->setEntityName(
10111027
$this->entityType
1028+
)->setIsVisibleOnFront(
1029+
$isVisibleOnFront
10121030
);
10131031
$this->addStatusHistory($history);
10141032
return $history;

0 commit comments

Comments
 (0)