Chủ Nhật, 2 tháng 7, 2017

Get Attribute for Product in magento 2


<!-- get Attribute -->


<?php 
    echo $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block->getProduct(),
     $block->getProduct()->getshow_attribute(), 'show_attribute');
?>
OR
<?php  
    echo $_product->getResource()->getAttribute('show_attribute')->getFrontend()->getValue($_product);
?>

Không có nhận xét nào:

Đăng nhận xét

About me

Recent

recentposts

Random

randomposts