cancel
Showing results for 
Search instead for 
Did you mean: 

How restrict empty attribute values display?

How restrict empty attribute values display?

Don't show empty attribute values, 

 

<?php
$_helper = $this->helper('catalog/output');
$_product = $this->getProduct()
?>
<?php if ($_additional = $this->getAdditionalData()) : ?>
	<!-- <h2><?php echo $this->__('Additional Information') ?></h2> -->
	<div class="box-collateral-content">


		<table class="data-table" id="product-attribute-specs-table">
			<col width="25%" />
			<col />
			<tbody>

				<?php foreach ($_additional as $_data) : ?>

					<tr>
						<th class="label"><?php echo $this->htmlEscape($this->__($_data['label'])) ?></th>
						<td class="data"><?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?></td>
					</tr>
				<?php endforeach; ?>

			</tbody>
		</table>

		<script type="text/javascript">
			decorateTable('product-attribute-specs-table')
		</script>
	</div>
<?php endif; ?>

Now all attributes display like with attributes values or without attributes values, how to add condition like display only with attributes value only. 

 

screenshot : 

 

aws.png

1 REPLY 1

Re: How restrict empty attribute values display?

done : 

<?php if ((string$_data['value'] != '' and $_data['value'] != 'N/A' and $_data['value'] != 'No') : ?>