Kerm Posted April 25, 2011 Share Posted April 25, 2011 Hello,I want create new field in product with html suppport, i made one, but i can only put inside text or numbers, if i put html it dont safe info..What i do:First i have 1.4.0.17.In AdminProducts.php i add field: '.$this->l('Field 1').' <input type="text" name="price_prof" value="'.htmlentities($this->getFieldValue($obj, 'price_prof'), ENT_COMPAT, 'UTF-8').'" /> '.$this->l('Price-prof').' After in classes/product.php i add: /** @var string price_prof */ public $price_prof; where public function getFields() i add: $fields['price_prof'] = psql($this->price_prof); In my theme product.tpl i add: {if not $product->price_prof==0}Field 1: {$product->price_prof} {/if} In phpmyadmin, i add new field in ps_product table, with name price_prof with this parameters:Type: TEXT, utf8_general_ci, NULL Yes, default NULLAs i say with numbers, text all ok. If i put html in field, it donst safe field info. Link to comment Share on other sites More sharing options...
Burhan BVK Posted April 27, 2011 Share Posted April 27, 2011 PHP is case insensitive, it does not matter if you use the same capitalization. Link to comment Share on other sites More sharing options...
Kerm Posted April 29, 2011 Author Share Posted April 29, 2011 Thx for answers i will try it Link to comment Share on other sites More sharing options...
Kerm Posted April 29, 2011 Author Share Posted April 29, 2011 Dont work...i do all what u say but its still no HTML support..i can safe text/numbers but if i put in input tag text like test, it save test but no tags.. Link to comment Share on other sites More sharing options...
Kerm Posted April 29, 2011 Author Share Posted April 29, 2011 i will try, thx Link to comment Share on other sites More sharing options...
Kerm Posted April 30, 2011 Author Share Posted April 30, 2011 To angoraMate why u think that $ean13 field support "html special characters symbols" ?Btw for this: Find:public function addProductAttribute(and insert an argument for $prod_prof,anda few lines down, findDb::getInstance()->AutoExecute( and insert ‘price_prof’ => pSQL($price_prof), need made special field with name "prod_prof" in mysql base in "ps_product_attribute" or site dont work, for what i need 2 fields? i alrdy made one with same name in "ps_product". Btw nvm it still dont work.. Link to comment Share on other sites More sharing options...
Kerm Posted April 30, 2011 Author Share Posted April 30, 2011 troubleshooting:Using phpmyadmin, examine the price_prof value as stored in the database.Does the stored string contain the span tags you entered, or is the stored string just plain text?Also, try this:change<input type="text" name="price_prof" value="'.htmlentities($this->getFieldValue($obj, 'price_prof'), ENT_COMPAT, 'UTF-8').'" />to<input type="text" name="price_prof" value="'.htmlentities(stripslashes($this->getFieldValue($obj, 'price_prof')), ENT_COMPAT, 'UTF-8').'" /> Dont help, i try use test or text but it safe only text...and in Myphpadmin too only word text...If i write text direct from Phpmyadmin it safe all and on site on product page i see text...But if in admin panel on product page i press button safe it delete tags text from base and i again see only word "text" w/o tags Link to comment Share on other sites More sharing options...
Kerm Posted April 30, 2011 Author Share Posted April 30, 2011 i can safe also that symbols _@#)(*&^%!~/",';}{ | ] [but i cant safe this "<" ">" Link to comment Share on other sites More sharing options...
Burhan BVK Posted April 30, 2011 Share Posted April 30, 2011 You need to change this: $fields['price_prof'] = psql($this->price_prof); to this: $fields['price_prof'] = psql($this->price_prof, true); And you should use a textarea instead of a text input. Link to comment Share on other sites More sharing options...
Kerm Posted May 1, 2011 Author Share Posted May 1, 2011 thx! it works! 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