本文介绍了如何在Magento 2中删除空属性"N/A"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Magento 2与Porto主题一起使用,最近我在产品信息中更新了theme和magento,我还看到与N/A无关的与当前产品无关的空属性.我怎么藏起来?

I am using Magento 2 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?

我看到人们在这里用Magento 1进行讨论,但是它不适用于2.0.

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

推荐答案

Magento_Catalog/templates/product/view/attributes.phtml

Magento_Catalog/templates/product/view/attributes.phtml

   if(strpos($_data['value'],"N/A")===false):?>
                <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

            endif;

这篇关于如何在Magento 2中删除空属性"N/A"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 23:23