Skip to content

Commit 6f7f048

Browse files
ENGCOM-1892: Create ability to set is_visible_on_front to order status history comment #15637
- Merge Pull Request #15637 from markoshust/magento2:feature/order-history-comment-is-visible-on-front - Merged commits: 1. 8aea8ca 2. 594203c
2 parents a328a6b + 594203c commit 6f7f048

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
@@ -1008,8 +1008,24 @@ public function addStatusToHistory($status, $comment = '', $isCustomerNotified =
10081008
* @param string $comment
10091009
* @param bool|string $status
10101010
* @return OrderStatusHistoryInterface
1011+
* @deprecated
1012+
* @see addCommentToStatusHistory
10111013
*/
10121014
public function addStatusHistoryComment($comment, $status = false)
1015+
{
1016+
return $this->addCommentToStatusHistory($comment, $status, false);
1017+
}
1018+
1019+
/**
1020+
* Add a comment to order status history
1021+
* Different or default status may be specified
1022+
*
1023+
* @param string $comment
1024+
* @param bool|string $status
1025+
* @param bool $isVisibleOnFront
1026+
* @return OrderStatusHistoryInterface
1027+
*/
1028+
public function addCommentToStatusHistory($comment, $status = false, $isVisibleOnFront = false)
10131029
{
10141030
if (false === $status) {
10151031
$status = $this->getStatus();
@@ -1024,6 +1040,8 @@ public function addStatusHistoryComment($comment, $status = false)
10241040
$comment
10251041
)->setEntityName(
10261042
$this->entityType
1043+
)->setIsVisibleOnFront(
1044+
$isVisibleOnFront
10271045
);
10281046
$this->addStatusHistory($history);
10291047
return $history;

0 commit comments

Comments
 (0)