Showing results for 
Search instead for 
Did you mean: 

need help?

need help?

I am using Magento 2.1.7 with Porto theme, I recently updated theme and magento now in product information I am also seeing empty attributes that are unrelated to the current products as N/A . how can I hide them?

I saw people discussing here this in Magento 1. but it doesn't work for 2.0.

please help if you know how to do it. thanks


Re: need help?

Just override file into your theme,


Just keep line, <?php if($_data['value'] == 'N/A') continue;?> after <?php foreach ($_additional as $_data): ?> line,


Full code,

 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.

// @codingStandardsIgnoreFile

 * Product additional attributes template
 * @var $block \Magento\Catalog\Block\Product\View\Attributes
    $_helper = $this->helper('Magento\Catalog\Helper\Output');
    $_product = $block->getProduct()
<?php if ($_additional = $block->getAdditionalData()): ?>
    <div class="additional-attributes-wrapper table-wrapper">
        <table class="data table additional-attributes" id="product-attribute-specs-table">
            <caption class="table-caption"><?php /* @escapeNotVerified */ echo __('More Information') ?></caption>
            <?php foreach ($_additional as $_data): ?>
                <?php if($_data['value'] == 'N/A') continue;?>
                    <th class="col label" scope="row"><?php echo $block->escapeHtml(__($_data['label'])) ?></th>
                    <td class="col data" data-th="<?php echo $block->escapeHtml(__($_data['label'])) ?>"><?php /* @escapeNotVerified */ echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
            <?php endforeach; ?>
<?php endif;?>

Clear cache.

If Issue Solved, Click Kudos/Accept As solutions.