eFrancesco Posted April 11, 2014 Share Posted April 11, 2014 Hello, I've read this topic but it seems not to work in PS 1.5.6.2 First of all I've added a column (text) to ps_message table in the database. Then in order-address.tpl I've added the following line <p class="textarea"><textarea cols="60" rows="3" name="campo_custom"></textarea></p> right after the text area for customer message: <p class="textarea"><textarea cols="60" rows="3" name="message">{if isset($oldMessage)}{$oldMessage}{/if}</textarea></p> In class/Message.php I've changed the INSERT INTO statement this way: INSERT INTO '._DB_PREFIX_.'message_readed (id_message , id_employee , date_add, campo_custom) VALUES ('.(int)$id_message.', '.(int)$id_employee.', NOW(),'.$campo_custom.'); '); I've added the following line to public static $definition = array (that can be found at about #58) (maybe the TYPE_STRING or its length could be not so good for my needs... but please note that I have to add 4 new fields and this is a test... I guess they will be INPUT TEXT) 'campo_custom' => array('type' => self::TYPE_STRING, 'validate' => 'isCampoCustom', 'size' => 600), and I've declared this: public $campo_custom; in Validate.php I've added this: public static function isCampoCustom($campo_custom) { return !preg_match('/[<>{}]/i', $campo_custom); } My campo_custom is still empty.At the beginning (right before the code I've posted here) campo_custom used to stay "NULL" but after some managing it appears void but not null....Any suggestion? Link to comment Share on other sites More sharing options...
eFrancesco Posted April 11, 2014 Author Share Posted April 11, 2014 Hmm, ok, if I give a value to campo_custom var in message Class it is written in db coloums (Eg: public $campo_custom="test One two three"; ) So maybe The problem is how to get that value... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now