0

I have a plugin/interceptor hooking into a Vendor webhook function. This vendor webhook handler has an Magento\Sales\Model\Order model where they add comments through the addStatusHistoryComment function.

When my plugin function is called, I then call $order->getStatusHistoryCollection(true), to receive the comments. However the comments that are added by the Vendor webhook function are not shown, only previous comments.

I thought by passing the true boolean to the getStatusHistoryCollection the collection would 'reload' but that still doesn't include the missing comments.

Any idea how to tackle this problem?

1 Answer 1

0

Using the getStatusHistories instead of getStatusHistoryCollection function fixed the problem, this function includes all comments (previous + the once generated in the request).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.