I've been having problems with product attributes in Magento 2 showing N/A and No instead of being hidden, all solutions refer you to locate the attributes.phtml file. However I cannot trace that file, is there another solution?
2 Answers
The file is located under the vendor folder, you will need to copy it over to your theme. Never make changes to files inside vendor (core files) as you will likely lose them when you update/upgrade.
vendor/magento/module-catalog/view/frontend/templates/product/view/attributes.phtml
The code I used that also actually works to replace the N/A and No on the product attributes is this:
<?php
/**
* 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
*/
?>
<?php
$_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>
<tbody>
<?php foreach ($_additional as $_data): ?>
<?php if($_data['value'] == 'N/A') continue;?>
<?php if($_data['value'] == 'No') continue;?>
<tr>
<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>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif;?>
vendor/magento/module-catalog/view/frontend/templates/product/view/attributes.phtml
. It should do as it's part of Magento 2's core.