【问题标题】:What to Order Status in Opencart My Account pageOpencart 我的帐户页面中的订单状态
【发布时间】:2015-04-14 21:03:37
【问题描述】:

感谢任何帮助我或为我指明正确方向的人。

我想在 opencart 用户(我的帐户)页面中显示订单状态。它将按状态 ID 显示状态。我的待处理状态 ID:1,我只想显示待处理状态。其他状态不会出现。

<a href="#"><?php echo $order_statuses['order_status_id']; ?></a>

我把它放在 account.tpl 但结果错误。请帮我。

可能需要修改

*英文/account/account.php

controller/account/account.php

模板/模块/account.tpl*

带有自定义主题的我的打开购物车版本 1.5.6.3。

【问题讨论】:

标签: opencart status account


【解决方案1】:

在 account.php 你已经添加了这个。

$this->load->model('account/order');
        $results = $this->model_account_order->getOrders(0, 5);

        foreach ($results as $result) {
            $product_total = $this->model_account_order->getTotalOrderProductsByOrderId($result['order_id']);
            $voucher_total = $this->model_account_order->getTotalOrderVouchersByOrderId($result['order_id']);
            $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')
            );
        }

In account.tpl add this code

<div id="resent_order" class="recent_order">
                <a style="float:right; margin-bottom:15px;" href="<?php echo $manage_order; ?>" class="button">Manage your 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 recent orders.</li><?php }  ?>


                </ul>

            </div>

【讨论】:

  • 谢谢您,这在我的帐户页面中有效,但我只想显示待处理订单,但它显示了所有订单。你能给我一个只显示挂单的方法吗?再次感谢
  • order_status != 5 时添加条件,因为如果订单状态为 5 表示您的订单已完成。试试这个可能会有帮助。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-01-17
  • 1970-01-01
  • 1970-01-01
  • 2020-08-18
  • 1970-01-01
  • 2014-04-13
  • 2017-02-03
相关资源
最近更新 更多