☰
获取select属性
<code class=" hljs coffeescript" codemark="1">$_product->getResource()->getAttribute('your_attribute_code')->getFrontend()->getValue($_product);
$product->getResource()->getAttribute('your_attribute_code')->getFrontend()->getLabel($product);
获取multiselect属性
<?php $product = $block->getProduct(); ?> // Get current product
<div>
<?php
$data = explode(',',$product->getData('attribute_code'));
foreach($data as $value):
?>
<?php
$attr = $product->getResource()->getAttribute('attribute_code');
if ($attr->usesSource()): ?>
<?php
$option_value = $attr->getSource()->getOptionText($value);
?>
<p><?php echo $option_value; ?></p>
<?php endif;?>
<?php endforeach;?>