My account page (recent.phtml)
-
04-10-2020 - |
Question
I have been trying to figure out how reorder and my account pages are working.
I have a My Account page which shows 'Recent orders', showing a table that includes Order number, Date, Ship to, Total price, and Status. Also, there is a last column with "See order" and "Reorder" buttons.
Indeed, I think that the code for this Recent Orders is in recent.phml , which can be found at app\design\frontend\base\default\template\sales\order
. However, I've tried to modify the code in this file, but I obtain no results, even if I delete Magento's and browser's cache. I tried to do the same as in Customizing Recent Order Customer dashboard, but still I see no effects in my webpage.
Here's my code in recent.phtml, after modifying it as in the post I linked:
<?php $_orders = $this->getOrders(); ?>
<div class="box-head">
<h2><?php echo $this->__('Recent Orders') ?></h2>
<?php if( sizeof($_orders->getItems()) > 0 ): ?><a href="<?php echo $this->getUrl('sales/order/history') ?>"><?php echo $this->__('View All') ?></a><?php endif; ?>
</div>
<?php if( sizeof($_orders->getItems()) > 0 ): ?>
<table class="data-table" id="my-orders-table">
<col width="1" />
<col width="1" />
<col />
<col width="1" />
<col width="1" />
<col width="1" />
<thead>
<tr>
<th>TextChanged<?php //echo $this->__('Order #') ?></th>
<th><?php echo $this->__('Date') ?></th>
<!--<th><?php echo $this->__('Ship To') ?></th>-->
<th><?php echo $this->__('Product Name') ?></th>
<th><span class="nobr"><?php echo $this->__('Order Total') ?></span></th>
<th><?php echo $this->__('Status') ?></th>
<th> </th>
</tr>
</thead>
<tbody>
<?php foreach ($_orders as $_order): ?>
<tr>
<td><?php echo $_order->getRealOrderId() ?></td>
<td><span class="nobr"><?php echo $this->formatDate($_order->getCreatedAtStoreDate()) ?></span></td>
<!-- <td><?php echo $_order->getShippingAddress() ? $this->htmlEscape($_order->getShippingAddress()->getName()) : ' ' ?></td> -->
<?php
$order=Mage::getModel('sales/order')->loadByIncrementId($_order->getRealOrderId());
$items = $order->getAllItems();
foreach($items as $item){
$name = $item->getName();
}
?>
<td><?php echo $_order->formatPrice($_order->getGrandTotal()) ?></td>
<td><em><?php echo $_order->getStatusLabel() ?></em></td>
<td class="a-center">
<span class="nobr">
<a href="<?php echo $this->getViewUrl($_order) ?>"><?php echo $this->__('View Order') ?></a>
<?php if ($this->helper('sales/reorder')->canReorder($_order)) : ?>
<span class="separator">|</span> <a href="<?php echo $this->getReorderUrl($_order) ?>" class="link-reorder"><?php echo $this->__('Reorder') ?></a>
<?php endif ?>
</span>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<script type="text/javascript">decorateTable('my-orders-table')</script>
<?php else: ?>
<p><?php echo $this->__('You have placed no orders.'); ?></p>
I would like to know how can I modify this Recent Orders page. Is this the correct file? Any ideas or comments will be much appreciated :-)
La solution
you must need to add file in your theme with same folder structure.
if your package default then file inside default/default work and other package then must inside your theme or base/default but in change base/default not good option during upgrade that will lost.