Add Magento Order History Comment using the programmatic approach for the orders.
You need to use the interface, Magento\Sales\Api\OrderStatusHistoryRepositoryInterface to add a comment. You can also set the order status for the comment.
You can check to add sales order status history data programmatically in Magento 2.
You have to Retrieve the Order ID to add a comment, load the order object by the ID, add a status history comment for the given sales order with some code snippet, Continue reading “How to add Order Comments History by order id programmatically in Magento 2?”
