controller:
Code: Select all
if (!empty($this->request->post['quantity'])) {
foreach ($this->request->post['quantity'] as $key => $value) {
$this->session->data['wishlist'][$key] = (int)$value;
$this->data['wishlist'] = array();
}
}
$this->data['products'] = array();
$this->data['action'] = $this->url->link('account/wishlist');
// if ($product_info) stuffs
$this->data['products'][] = array(
'key' => $product_info['product_id'],
'product_id' => $product_info['product_id'],
'thumb' => $image,
'name' => $product_info['name'],
'model' => $product_info['model'],
'quantity' => $product_info['quantity'],
'stock' => $stock,
'price' => $price,
'special' => $special,
'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id']),
'remove' => $this->url->link('account/wishlist', 'remove=' . $product_info['product_id'])
Code: Select all
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data">
<div class="wishlist-info">
<table>
<thead>
<tr>
<td class="image"><?php echo $column_image; ?></td>
<td class="name"><?php echo $column_name; ?></td>
<td class="model"><?php echo $column_model; ?></td>
<td class="stock"><?php echo $column_stock; ?></td>
<td class="price"><?php echo $column_price; ?></td>
<td class="quantity">Quantidade</td>
<td class="action"><?php echo $column_action; ?></td>
</tr>
</thead>
<?php foreach ($products as $product) { ?>
<tbody id="wishlist-row<?php echo $product['product_id']; ?>">
<tr>
<td class="image"><?php if ($product['thumb']) { ?>
<a href="<?php echo $product['href']; ?>"><img src="<?php echo $product['thumb']; ?>" alt="<?php echo $product['name']; ?>" title="<?php echo $product['name']; ?>" /></a>
<?php } ?></td>
<td class="name"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a></td>
<td class="model"><?php echo $product['model']; ?></td>
<td class="stock"><?php echo $product['stock']; ?></td>
<td class="price"><?php if ($product['price']) { ?>
<div class="price">
<?php if (!$product['special']) { ?>
<?php echo $product['price']; ?>
<?php } else { ?>
<s><?php echo $product['price']; ?></s> <b><?php echo $product['special']; ?></b>
<?php } ?>
</div>
<?php } ?></td>
<td class="quantity"><input style="width: 100px;" type="text" name="quantity[<?php echo $product['key']; ?>]" value="<?php echo $product['quantity']; ?>" size="1" /></td>
<td class="action">
<input type="image" src="catalog/view/theme/default/image/update.png" alt="<?php echo $button_update; ?>" title="<?php echo $button_update; ?>" /><img src="catalog/view/theme/default/image/cart-add.png" alt="<?php echo $button_cart; ?>" title="<?php echo $button_cart; ?>" onclick="addToCart('<?php echo $product['product_id']; ?>');" /> <a href="<?php echo $product['remove']; ?>"><img src="catalog/view/theme/default/image/remove.png" alt="<?php echo $button_remove; ?>" title="<?php echo $button_remove; ?>" /></a></td>
</tr>
</tbody>
<?php } ?>
</table>
</div>
</form>