本博客基于Opencart2.1.0.1源码,架设在阿里云香港机房!  技术交流QQ群:103164069

vim admin/controller/sale/order.php

980 if ($upload_info) {
981 $option_data[] = array(
982 'name' => $option['name'],
983 'value' => $upload_info['name'],
984 'type' => $option['type'],
985 'href' => $this->url->link('tool/upload/download', 'token=' . $this->session->data['token'] . '&code=' . $upload_info['code'], 'SSL')
986 );
987 }
988 }
989 }
$query = $this->db->query("select image from oc_product where product_id='{$product['product_id']}'");//添加开始
foreach ($query->rows as $result) {
//$image=$result['image'];
}
$this->load->model('tool/image');
if (is_file(DIR_IMAGE . $result['image'])) {
$image = $this->model_tool_image->resize($result['image'], 40, 40);
} else {
$image = $this->model_tool_image->resize('no_image.png', 40, 40);
} //添加结束

1000 $data['products'][] = array(
1001 'order_product_id' => $product['order_product_id'],
1002 'product_id' => $product['product_id'],
1003 'main_image' => $image,//add by joinsen 分配数据

 

vim admin/view/template/sale/order_info.tpl

147 <table class="table table-bordered">
148 <thead>
149 <tr>
150 <td class="text-left"><?php echo $column_product; ?></td>
151 <td class="text-left">图片</td><!--这一行是添加上去的-->
152 <td class="text-left"><?php echo $column_model; ?></td>
153 <td class="text-right"><?php echo $column_quantity; ?></td>
154 <td class="text-right"><?php echo $column_price; ?></td>
155 <td class="text-right"><?php echo $column_total; ?></td>
156 </tr>
157 </thead>
158 <tbody>
159 <?php foreach ($products as $product) { ?>
160 <tr>
161 <td class="text-left"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
162 <?php foreach ($product['option'] as $option) { ?>
163 <br />
164 <?php if ($option['type'] != 'file') { ?>
165 &nbsp;<small> - <?php echo $option['name']; ?>: <?php echo $option['value']; ?></small>
166 <?php } else { ?>
167 &nbsp;<small> - <?php echo $option['name']; ?>: <a href="<?php echo $option['href']; ?>"><?php echo $option['value']; ?></a></small>
168 <?php } ?>
169 <?php } ?></td>
<td class="text-left"><?php //这3个添加上去
echo '<a href="'.$product['href'].'"><img width="40" src="'.$product['main_image'].'"/></a>';
?></td>

Write a review

Please login or register to review
浏览次数:2081

Opencart后台订单显示图片

  • Product Code: Opencart后台订单显示图片
  • Availability: In Stock
  • ¥0.00


Tags: Opencart后台订单显示图片