this time, I am writing about the orders products page show product images as the attachment file.
-------------------------------------------------------------------------------
new update file for opencart v1.5.1.1 7/8/2011
-------------------------------------------------------------------------------
there are 3 files need to be modified.
opencart_v1.4.x\admin\view\template\sale\order_form.tpl
opencart_v1.4.x\admin\controller\sale\order.php
opencart_v1.4.x\admin\model\sale\order.php
opencart_v1.4.x\admin\view\template\sale\order_form.tpl
find
Code: Select all
<div id="tab_product" class="vtabs_page">
Code: Select all
<div id="tab_product" class="vtabs_page">
<table id="product" class="list">
<thead>
<tr>
[b]<td class="left"> </td>[/b]
<td class="left"><?php echo $column_product; ?></td>
<td class="left"><?php echo $column_model; ?></td>
<td class="right"><?php echo $column_quantity; ?></td>
<td class="right"><?php echo $column_price; ?></td>
<td class="right" width="1"><?php echo $column_total; ?></td>
</tr>
</thead>
<?php foreach ($products as $product) { ?>
<tbody>
<tr>
[b]<td width="80"><img src="<?php echo $product['thumb']; ?>" /></td>[/b]
<td class="left"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a>
<?php foreach ($product['option'] as $option) { ?>
<br />
<small> - <?php echo $option['name']; ?> <?php echo $option['value']; ?></small>
<?php } ?></td>
<td class="left"><?php echo $product['model']; ?></td>
<td class="right"><?php echo $product['quantity']; ?></td>
<td class="right"><?php echo $product['price']; ?></td>
<td class="right"><?php echo $product['total']; ?></td>
</tr>
</tbody>
<?php } ?>
Modify opencart_v1.4.x\admin\controller\sale\order.php
find
Code: Select all
$this->load->model('sale/customer_group');
Code: Select all
$this->load->model('tool/image');
find
Code: Select all
$this->data['products'][] = array(
Code: Select all
if ($product['image']) {
$image = $product['image'];
} else {
$image = 'no_image.jpg';
}
add
Code: Select all
'thumb' => $this->model_tool_image->resize($image, $this->config->get('config_image_cart_width'), $this->config->get('config_image_cart_height')),
Code: Select all
$this->data['products'][] = array(
Code: Select all
'name' => $product['name'],
modify
Code: Select all
public function getOrderProducts($order_id) {
to
Code: Select all
public function getOrderProducts($order_id) {
$query = $this->db->query("SELECT op.*,p.image FROM " . DB_PREFIX . "order_product op LEFT JOIN " . DB_PREFIX . "product p ON op.product_id=p.product_id WHERE order_id = '" . (int)$order_id . "'");
return $query->rows;
}
Good day,
Ady
http://www.trait-tech.com