Guest User

Untitled

a guest
Nov 5th, 2020
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. $results = $this->model_account_order->getOrders(($page - 1) * 10, 10);
  2.  
  3. foreach ($results as $result) {
  4. $prod = $this->model_account_order->getOrderProducts($result['order_id']);
  5.  
  6. foreach ($prod as $product) {
  7.  
  8. $option_data = array();
  9.  
  10. $product_info = $this->model_catalog_product->getProduct($product['product_id']);
  11.  
  12. if ($product_info['image']) {
  13. $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'));
  14. } else {
  15. $image = false;
  16. }
  17. $options = $this->model_account_order->getOrderOptions($result['order_id'], $product['order_product_id']);
  18. foreach ($options as $option) {
  19. if ($option['type'] != 'file') {
  20. $value = $option['value'];
  21. } else {
  22. $upload_info = $this->model_tool_upload->getUploadByCode($option['value']);
  23.  
  24. if ($upload_info) {
  25. $value = $upload_info['name'];
  26. } else {
  27. $value = '';
  28. }
  29. }
  30.  
  31. $option_data[] = array(
  32. 'name' => $option['name'],
  33. 'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value)
  34. );
  35.  
  36. }
  37. $data['total'][] = array(
  38. 'name_product' => $product['name'],
  39. 'thumb' => $image,
  40. // 'option' => $option_data,
  41. 'quantity_prod' => $product['quantity'],
  42. 'price' => $product['price'],
  43. );
  44.  
  45. }
  46. $product_total = $this->model_account_order->getTotalOrderProductsByOrderId($result['order_id']);
  47. $voucher_total = $this->model_account_order->getTotalOrderVouchersByOrderId($result['order_id']);
  48.  
  49. $data['orders'][] = array(
  50. 'total_or' => $data['total'],
  51. 'payment_method' => $result['payment_method'],
  52. 'shipping_method' => $result['shipping_method'],
  53. 'value' => $result['value'],
  54. 'order_id' => $result['order_id'],
  55. 'name' => $result['firstname'] . ' ' . $result['lastname'],
  56. 'status' => $result['status'],
  57. 'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
  58. 'products' => ($product_total + $voucher_total),
  59. 'total' => $this->currency->format($result['total'], $result['currency_code'], $result['currency_value']),
  60. 'view' => $this->url->link('account/order/info', 'order_id=' . $result['order_id'], true),
  61. );
  62.  
Advertisement
Add Comment
Please, Sign In to add comment