I followed this tutorial on creating a custom module for a new tab and input in the back office
I don't want anything to do with languages - I have a simple text input where the user will input an INT.
In the tutorial it has us update the hookActionProductUpdate method:
public function hookActionProductUpdate($params)
{
// get the lines
// store the new field
$id_product = (int)Tools::getValue('id_product');
if(!Db::getInstance()->update('number_lines', array('number_lines'=> pSQL(Tools::getValue('number_lines'))).' AND id_product = ' .$id_product ))
$this->context->controller->_errors[] = Tools::displayError('Error: ').mysql_error();
}
When I click 'save & stay' nothing happens.
My .tpl is showing it like this:
<div class="col-lg-1">
<input type="text" name="number_lines" id="number_lines" value="{$number_lines|htmlentities}" />
</div>
Any help would be appreciated.
Overall purpose is just to have a text field that the user can enter a number into and it's saved into the database in the back office of a product.