Add hook to optimise order line query count

It was requested to factor the get() call out into a separate
method because it makes it hard to optimise the method call.

This is one of the changes related to #1467.

Closes #1470.