Skip to main content
edited body
Source Link
Krishna ijjada
  • 9k
  • 6
  • 42
  • 70

You can tryuse below code.

$_product = $block->getProduct();
foreach ($_product->getOptions() as $o) {
    if ($o->getTitle() != 'Color') { // or another title of option
        continue;
    }
    foreach ($o->getValues() as $value) {
        print_r($value->getData());
    }
}

You can try below code.

$_product = $block->getProduct();
foreach ($_product->getOptions() as $o) {
    if ($o->getTitle() != 'Color') { // or another title of option
        continue;
    }
    foreach ($o->getValues() as $value) {
        print_r($value->getData());
    }
}

You can use below code.

$_product = $block->getProduct();
foreach ($_product->getOptions() as $o) {
    if ($o->getTitle() != 'Color') { // or another title of option
        continue;
    }
    foreach ($o->getValues() as $value) {
        print_r($value->getData());
    }
}
Source Link
Krishna ijjada
  • 9k
  • 6
  • 42
  • 70

You can try below code.

$_product = $block->getProduct();
foreach ($_product->getOptions() as $o) {
    if ($o->getTitle() != 'Color') { // or another title of option
        continue;
    }
    foreach ($o->getValues() as $value) {
        print_r($value->getData());
    }
}