Been working on this today, and thought it might be useful for some of you.
This is for adding extra fields from your MySQL database to the admin section. You can then echo them accordingly within your product listing template.
This is a rough tutorial based on OpenCart and assumes a basic knowledge of PHP and MySQL. You should be able to make sense of what I have written by referring to the original OpenCart code.
This does not cover echo'ing the information on the product listing or adding the information to the database, as I would assume you already know how if you've come this far!

Step 1
Edit: /admin/controller/catalog/product.php
Find:
Code: Select all
$data['entry_name'] = $this->language->get('entry_name');
Code: Select all
$data['entry_YOUR-ENTRY'] = $this->language->get('entry_YOUR-ENTRY');
Code: Select all
$data['help_keyword'] = $this->language->get('help_keyword');
Code: Select all
$data['help_YOUR-ENTRY'] = $this->language->get('help_YOUR-ENTRY');
Code: Select all
$data['placeholder'] = $this->model_tool_image->resize('no_image.png', 100, 100);
Code: Select all
if (isset($this->request->post['YOUR-ENTRY'])) {
$data['YOUR-ENTRY'] = $this->request->post['YOUR-ENTRY'];
} elseif (!empty($product_info)) {
$data['YOUR-ENTRY'] = $product_info['YOUR-ENTRY'];
} else {
$data['YOUR-ENTRY'] = '';
}
Edit: /admin/language/english/catalog/product.php
Find:
Code: Select all
$_['entry_name'] = 'Product Name';
Code: Select all
$_['entry_YOUR-ENTRY'] = 'Your Entry Name';
Code: Select all
$_['help_keyword'] = 'Do not use spaces, instead replace spaces with - and make sure the keyword is globally unique.';
Code: Select all
$_['help_YOUR-ENTRY'] = 'Your help description';
Edit: /admin/model/catalog/product.php
Find:
Code: Select all
. "', sku = '" . $this->db->escape($data['sku'])
Code: Select all
. "', YOUR-ENTRY = '" . $this->db->escape($data['YOUR-ENTRY'])
Step 4
Edit: /admin/view/template/catalog/product_form.tpl
You can either create your own tab, which is easy to figure out for yourself, or you can add to an existing tab.
Find:
Code: Select all
<div class="tab-pane"
Code: Select all
<div class="form-group">
<label class="col-sm-2 control-label" for="input-YOUR-ENTRY"><span data-toggle="tooltip" title="<?php echo $help_YOUR-ENTRY; ?>"><?php echo $entry_YOUR-ENTRY; ?></span></label>
<div class="col-sm-10">
<input type="text" name="YOUR-ENTRY" value="<?php echo $YOUR-ENTRY; ?>" placeholder="<?php echo $entry_YOUR-ENTRY; ?>" id="input-YOUR-ENTRY" class="form-control" />
</div>
</div>
