What i'm trying to do is edit the product_list.tpl file within Opencart (admin panel) to show the product attribute in a column.
Here is a before and after screenshot of what Im trying to achieve. (done badly in photoshop)
Now, im kinda ok with PHP. i don't need the exact code for laying out in a table.
Currently to make this list is the code below.
<?php foreach ($products as $product) { ?>
<tr>
<td style="text-align: center;"><?php if ($product['selected']) { ?>
<input type="checkbox" name="selected[]" value="<?php echo $product['product_id']; ?>" checked="checked" />
<?php } else { ?>
<input type="checkbox" name="selected[]" value="<?php echo $product['product_id']; ?>" />
<?php } ?></td>
<td class="center"><img src="<?php echo $product['image']; ?>" alt="<?php echo $product['name']; ?>" /></td>
<td class="left"><?php echo $product['name']; ?></td>
<td class="left"><?php echo $product['model']; ?></td>
<td class="left"><?php if ($product['special']) { ?>
<span style="text-decoration: line-through;"><?php echo $product['price']; ?></span><br/>
<span style="color: #b00;"><?php echo $product['special']; ?></span>
<?php } else { ?>
<?php echo substr($product['price'], 0, -2); ?> (ex. VAT)
<?php } ?></td>
<td class="right"><?php if ($product['quantity'] <= 0) { ?>
<span style="color: #FF0000;"><?php echo $product['quantity']; ?></span>
<?php } elseif ($product['quantity'] <= 5) { ?>
<span style="color: #FFA500;"><?php echo $product['quantity']; ?></span>
<?php } else { ?>
<span style="color: #008000;"><?php echo $product['quantity']; ?></span>
<?php } ?></td>
<td class="left"><?php echo $product['status']; ?></td>
<td class="right"><?php foreach ($product['action'] as $action) { ?>
<a class="editbutton" href="<?php echo $action['href']; ?>"><?php echo $action['text']; ?></a>
<?php } ?></td>
</tr>
<?php } ?>
This is the loop that it does foreach product in the list. now within editing a product, you can see the attributes, the handle to get the attributes is
<?php echo $product_attribute['name']; ?>
but if i put this within the Product_list.tpl file, I get php errors, im guessing i have to somehow modify the controller file that serves data to the product_list.tpl and add in a function to get the product attribute, but im unsure on how to do this?
Can anyone help?