I'm working on a plugin to calculate price based on width and height but struggling to get the product type of each product into the 'onPopulateLineItem' event.
So far, I've looked into the purchasables and lineItems arrays to get the information, and although I can see the typeId under the $event array, I just can't get this value.
Can anyone point me in the right direction for this please?
** UPDATE **
I've managed to get something with the below, but this feels really hacky. Is there a better way I should be doing this?
$lineItem = $event->params['lineItem']; echo $lineItem['snapshot']['product']['typeId'];