Get value of variant field in plugin I'm trying to access a custom variant dropdown field in a plugin inside the commerce_lineItems.onPopulateLineItem event. How would I access the value of the dropdown, in order to do a comparison on it?

Thanks!
Something like this should work:

public function init()
{
    craft()-&gt;on('commerce_lineItems.onPopulateLineItem', function(Event $event) {
        $purchasable = $event-&gt;params['purchasable'];

        $myDropdownFieldValue = $purchasable-&gt;getProduct()-&gt;getContent()-&gt;myDropdownField;
    });
}


Relevant event docs: https://craftcommerce.com/docs/events-reference#commerce_lineitems.onpopulatelineitem