Skip to content

Commit f9c1f5d

Browse files
author
Stanislav Idolov
authored
ENGCOM-2376: [Forwardport] Create ability to set is_visible_on_front to order status history comment #16609
2 parents 78d3ea5 + e613860 commit f9c1f5d

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
@@ -1013,8 +1013,24 @@ public function addStatusToHistory($status, $comment = '', $isCustomerNotified =
10131013
* @param string $comment
10141014
* @param bool|string $status
10151015
* @return OrderStatusHistoryInterface
1016+
* @deprecated
1017+
* @see addCommentToStatusHistory
10161018
*/
10171019
public function addStatusHistoryComment($comment, $status = false)
1020+
{
1021+
return $this->addCommentToStatusHistory($comment, $status, false);
1022+
}
1023+
1024+
/**
1025+
* Add a comment to order status history
1026+
* Different or default status may be specified
1027+
*
1028+
* @param string $comment
1029+
* @param bool|string $status
1030+
* @param bool $isVisibleOnFront
1031+
* @return OrderStatusHistoryInterface
1032+
*/
1033+
public function addCommentToStatusHistory($comment, $status = false, $isVisibleOnFront = false)
10181034
{
10191035
if (false === $status) {
10201036
$status = $this->getStatus();
@@ -1029,6 +1045,8 @@ public function addStatusHistoryComment($comment, $status = false)
10291045
$comment
10301046
)->setEntityName(
10311047
$this->entityType
1048+
)->setIsVisibleOnFront(
1049+
$isVisibleOnFront
10321050
);
10331051
$this->addStatusHistory($history);
10341052
return $history;

0 commit comments

Comments
 (0)