I've added an Entries field called linkedCourseEntry
to a Product (Product Type > Product Fields tab). In the Product itself I've assigned an entry.
I need to access linkedCourseEntry
from one or more Events, but can’t work out how to do so.
For example when EVENT_POPULATE_LINE_ITEM
is used:
Event::on(
LineItems::class,
LineItems::EVENT_POPULATE_LINE_ITEM,
function(LineItemEvent $event) {
$lineItem = $event->lineItem;
$purchasable = $lineItem->getPurchasable();
// Somehow access the 'linkedCourseEntry' data here... help!
}
);
Can anyone point me in the right direction please?