The product admin area has a lot of fields that aren't displayed on the catalog side. Things like weight, sku, dimensions, location, etc.
This is in part due to too much micro-managing the data. The model function pulls all the data from the database for the product. But the controller then filters that and sets individual variables for each, instead of just formatting certain values and passing the rest through.
A better method, and one that is easily modded into the existing code, is to simply pass that initial array of data directly to the view and allow easy display of any field that exists in the database.
For example, if you want to display the "SKU" on the product page:
1. EDIT: catalog/controller/product/product.php
2. FIND:
Code: Select all
$product_info = $this->model_catalog_product->getProduct($product_id);
Code: Select all
$this->data['product_info'] = $product_info;
4. EDIT: catalog/view/theme/YOURTHEME/template/product/product.tpl
5. FIND:
Code: Select all
<tr>
<td><b><?php echo $text_model; ?></b></td>
<td><?php echo $model; ?></td>
</tr>
Code: Select all
<tr>
<td><b>SKU:</b></td>
<td><?php echo $product_info['sku']; ?></td>
</tr>
Do the same for all other fields you want to show. You only have to change the first 3 steps once to display all the fields you want.
You can also call conversion functions as well for things like weight
Code: Select all
<tr>
<td><b>Weight:</b></td>
<td><?php echo $this->weight->format(product_info['weight'], 4); ?></td>
</tr>