Hi, I’m trying to remove the table head from this table if the customer hasn’t made a RMA request. I’ve been trying everything I know with no luck. Can someone take a look at it for me.
<?php $result = $this->getRmaList(); ?>
<div class="page-title title-buttons">
<h2><?php echo $this->__('Request For Return Merchandise Authorization (RMA)') ?></h2>
</div>
<a href="<?php echo Mage::helper('core/url')->getHomeUrl(); ?>rma/index/request">
<h4 align="right"><?php echo $this->__('Add New RMA') ?></h4></a>
<table class="data-table" id="my-orders-table">
<thead>
<tr class="first last">
<th><?php echo $this->__('RMA') ?></th>
<th><?php echo $this->__('RMA #') ?></th>
<th><?php echo $this->__('Order #') ?></th>
<th><?php echo $this->__('Date') ?></th>
<th><span class="nobr"><?php echo $this->__('Status') ?></span></th>
<th><?php echo $this->__('Return Type') ?></th>
</tr>
</thead>
<tbody>
<?php while($resultn = $result->fetch(PDO::FETCH_ASSOC)){
$dateTimestamp = Mage::getModel('core/date')->timestamp(strtotime($created_time));
extract($resultn);
echo "<tr class='first odd'>
<td><a href=". Mage::helper('core/url')->getHomeUrl() ."rma/index/view/rma_id/$rma_id>View Details</a></td>
<td>$rma_id</td>
<td><span class='nobr'><a href=". Mage::helper('core/url')->getHomeUrl() ."sales/order/view/order_id/$order_id>$increment_id<?a></span></td>
<td>". date('F j, Y g:i a', $dateTimestamp) ."</td>
<td><span class='price'>$adminstatus</span></td>
<td class=''>
<span class='nobr'>$return_type</span></td>
</tr>";
} ?>
</tbody>
</table>[/code]
How would I go about it? I've tried things like: [code]<?php if ($result): ?>[/code]that didn't work. I guess I need to find a variable that works, that's what I've been trying.
Thanks
Doesn’t running through the while() loop at that position ruin it for the lower section where you actually want those results to display in the table body?
Is there a way you can get the result count for the query before you start the table, and just wrap the entire table in an if() clause? So assuming the query has already run: