Notifications 用户帐户opencart中的用户通知
感谢所有帮助我或为我指出正确方向的人 登录后,我想在用户的“我的帐户”页面中向用户显示一个挂起的通知。此通知仅在其任何订单状态处于挂起状态时显示。从管理员更改任何其他状态后,将删除该通知 此通知将显示如下内容: 您的订单ID: 订单状态: 和[带有自定义Url的按钮] 如果有多个订单,则将显示多个订单id。 带有自定义主题的My Open cart版本1.5.6.3Notifications 用户帐户opencart中的用户通知,notifications,opencart,status,user-accounts,Notifications,Opencart,Status,User Accounts,感谢所有帮助我或为我指出正确方向的人 登录后,我想在用户的“我的帐户”页面中向用户显示一个挂起的通知。此通知仅在其任何订单状态处于挂起状态时显示。从管理员更改任何其他状态后,将删除该通知 此通知将显示如下内容: 您的订单ID: 订单状态: 和[带有自定义Url的按钮] 如果有多个订单,则将显示多个订单id。 带有自定义主题的My Open cart版本1.5.6.3 $this->load->model('account/order'); $results = $th
$this->load->model('account/order');
$results = $this->model_account_order->getOrders();
foreach ($results as $result) {
$product_total = $this->model_account_order->getTotalOrderProductsByOrderId($result['order_id']);
$voucher_total = $this->model_account_order->getTotalOrderVouchersByOrderId($result['order_id']);
if( $result['status'] =! 5){ // 5 order status means its completed
$this->data['orders'][] = array(
'order_id' => $result['order_id'],
'name' => $result['firstname'] . ' ' . $result['lastname'],
'status' => $result['status'],
'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
'products' => ($product_total + $voucher_total),
'total' => $this->currency->format($result['total'], $result['currency_code'], $result['currency_value']),
'href' => $this->url->link('account/order/info', 'order_id=' . $result['order_id'], 'SSL'),
'reorder' => $this->url->link('account/order', 'order_id=' . $result['order_id'], 'SSL')
);
}
}
在account.tpl中添加此代码
<div id="resent_order" class="recent_order">
<a style="float:right; margin-bottom:15px;" href="<?php echo $manage_order; ?>" class="button">Pending orders</a>
<h4>Recent Order</h4>
<ul style="clear:both;">
<?php if( isset($orders) && count($orders > 0 ) ){
foreach ($orders as $order) { ?>
<li>
<div><strong>Order:#</strong><?php echo $order['order_id']; ?></div>
<div><strong>Date:</strong> <?php echo $order['date_added']; ?></div>
<div><strong>Amount:</strong> <?php echo $order['total']; ?></div>
<div><strong>Status:</strong> <?php echo $order['status']; ?></div>
<div class="editPan"><a class="" title="Edit" href="<?php echo $order['href']; ?>">Edit</a></div>
</li>
<?php } ?>
<?php }else{?> <li>You have no pending orders.</li><?php } ?>
</ul>
</div>
近期订单
-
顺序:#
日期:
金额:
状态:
- 您没有未完成的订单
在account.tpl中添加此代码
<div id="resent_order" class="recent_order">
<a style="float:right; margin-bottom:15px;" href="<?php echo $manage_order; ?>" class="button">Pending orders</a>
<h4>Recent Order</h4>
<ul style="clear:both;">
<?php if( isset($orders) && count($orders > 0 ) ){
foreach ($orders as $order) { ?>
<li>
<div><strong>Order:#</strong><?php echo $order['order_id']; ?></div>
<div><strong>Date:</strong> <?php echo $order['date_added']; ?></div>
<div><strong>Amount:</strong> <?php echo $order['total']; ?></div>
<div><strong>Status:</strong> <?php echo $order['status']; ?></div>
<div class="editPan"><a class="" title="Edit" href="<?php echo $order['href']; ?>">Edit</a></div>
</li>
<?php } ?>
<?php }else{?> <li>You have no pending orders.</li><?php } ?>
</ul>
</div>
近期订单
-
顺序:#
日期:
金额:
状态:
- 您没有未完成的订单
在account.tpl中添加此代码
<div id="resent_order" class="recent_order">
<a style="float:right; margin-bottom:15px;" href="<?php echo $manage_order; ?>" class="button">Pending orders</a>
<h4>Recent Order</h4>
<ul style="clear:both;">
<?php if( isset($orders) && count($orders > 0 ) ){
foreach ($orders as $order) { ?>
<li>
<div><strong>Order:#</strong><?php echo $order['order_id']; ?></div>
<div><strong>Date:</strong> <?php echo $order['date_added']; ?></div>
<div><strong>Amount:</strong> <?php echo $order['total']; ?></div>
<div><strong>Status:</strong> <?php echo $order['status']; ?></div>
<div class="editPan"><a class="" title="Edit" href="<?php echo $order['href']; ?>">Edit</a></div>
</li>
<?php } ?>
<?php }else{?> <li>You have no pending orders.</li><?php } ?>
</ul>
</div>
近期订单
-
顺序:#
日期:
金额:
状态:
- 您没有未完成的订单
在account.tpl中添加此代码
<div id="resent_order" class="recent_order">
<a style="float:right; margin-bottom:15px;" href="<?php echo $manage_order; ?>" class="button">Pending orders</a>
<h4>Recent Order</h4>
<ul style="clear:both;">
<?php if( isset($orders) && count($orders > 0 ) ){
foreach ($orders as $order) { ?>
<li>
<div><strong>Order:#</strong><?php echo $order['order_id']; ?></div>
<div><strong>Date:</strong> <?php echo $order['date_added']; ?></div>
<div><strong>Amount:</strong> <?php echo $order['total']; ?></div>
<div><strong>Status:</strong> <?php echo $order['status']; ?></div>
<div class="editPan"><a class="" title="Edit" href="<?php echo $order['href']; ?>">Edit</a></div>
</li>
<?php } ?>
<?php }else{?> <li>You have no pending orders.</li><?php } ?>
</ul>
</div>
近期订单
-
顺序:#
日期:
金额:
状态:
- 您没有未完成的订单
非常感谢您友好的回答。这里有一些问题。它在没有“if($result['status']=!5)”的情况下工作。如果我这样做,结果只会显示“您最近没有订单”。如果我不使用“if($result['status']=!5)”,则会显示所有订单。你知道如何解决这个问题吗?在查询0,5或0,10中设置限制非常感谢你友好的回答。这里有一些问题。它在没有“if($result['status']=!5)”的情况下工作。如果我这样做,结果只会显示“您最近没有订单”。如果我不使用“if($result['status']=!5)”,则会显示所有订单。你知道如何解决这个问题吗?在查询0,5或0,10中设置限制非常感谢你友好的回答。这里有一些问题。它在没有“if($result['status']=!5)”的情况下工作。如果我这样做,结果只会显示“您最近没有订单”。如果我不使用“if($result['status']=!5)”,则会显示所有订单。你知道如何解决这个问题吗?在查询0,5或0,10中设置限制非常感谢你友好的回答。这里有一些问题。它在没有“if($result['status']=!5)”的情况下工作。如果我这样做,结果只会显示“您最近没有订单”。如果我不使用“if($result['status']=!5)”,则会显示所有订单。知道如何解决这个问题吗?在查询0,5或0,10中设置限制