Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $results = $this->model_account_order->getOrders(($page - 1) * 10, 10);
- foreach ($results as $result) {
- $prod = $this->model_account_order->getOrderProducts($result['order_id']);
- foreach ($prod as $product) {
- $option_data = array();
- $product_info = $this->model_catalog_product->getProduct($product['product_id']);
- if ($product_info['image']) {
- $image = $this->model_tool_image->resize($product_info['image'], $this->config->get('theme_' . $this->config->get('config_theme') . '_image_wishlist_width'), $this->config->get('theme_' . $this->config->get('config_theme') . '_image_wishlist_height'));
- } else {
- $image = false;
- }
- $options = $this->model_account_order->getOrderOptions($result['order_id'], $product['order_product_id']);
- foreach ($options as $option) {
- if ($option['type'] != 'file') {
- $value = $option['value'];
- } else {
- $upload_info = $this->model_tool_upload->getUploadByCode($option['value']);
- if ($upload_info) {
- $value = $upload_info['name'];
- } else {
- $value = '';
- }
- }
- $option_data[] = array(
- 'name' => $option['name'],
- 'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value)
- );
- }
- $data['total'][] = array(
- 'name_product' => $product['name'],
- 'thumb' => $image,
- // 'option' => $option_data,
- 'quantity_prod' => $product['quantity'],
- 'price' => $product['price'],
- );
- }
- $product_total = $this->model_account_order->getTotalOrderProductsByOrderId($result['order_id']);
- $voucher_total = $this->model_account_order->getTotalOrderVouchersByOrderId($result['order_id']);
- $data['orders'][] = array(
- 'total_or' => $data['total'],
- 'payment_method' => $result['payment_method'],
- 'shipping_method' => $result['shipping_method'],
- 'value' => $result['value'],
- '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']),
- 'view' => $this->url->link('account/order/info', 'order_id=' . $result['order_id'], true),
- );
Advertisement
Add Comment
Please, Sign In to add comment