How can I get the value of a custom option text field called "My Option"? This is what I have so far:
foreach($product->getOptions() as $option) {
$optionTitle = $option->getTitle();
if(preg_match('/.*my option.*/i', $optionTitle)) {
//How can I get the value here? I tried:
$optionValue = $option->getValue();
$optionValue = $option['value'];
}
}
The $optionValue var is always empty. Is that the correct way?
Thanks!