tukkie Posted December 2, 2013 Share Posted December 2, 2013 I defined a custom text field at a product, to enter by ordering. This field can can contain more than one line, seperated by carriage returns. This works fine by filling in, but after saving the carriage returns seemed to be lost. Is this a bug or a strange behaviour? Who can help me? Link to comment Share on other sites More sharing options...
El Patron Posted December 2, 2013 Share Posted December 2, 2013 I defined a custom text field at a product, to enter by ordering. This field can can contain more than one line, seperated by carriage returns. This works fine by filling in, but after saving the carriage returns seemed to be lost. Is this a bug or a strange behaviour? Who can help me? This is not a bug but possibly a strange behavior. controllers/front/ProductController.php you will find code that replaces the <br /> with "\n" foreach ($texts as $text_field) $text_fields['textFields_'.$this->product->id.'_'.$text_field['index']] = str_replace('<br />', "\n", $text_field['value']); you can remove this at your own risk. I do not know exactly why this is done. Link to comment Share on other sites More sharing options...
tukkie Posted December 3, 2013 Author Share Posted December 3, 2013 This is not a bug but possibly a strange behavior. controllers/front/ProductController.php you will find code that replaces the <br /> with "\n" foreach ($texts as $text_field) $text_fields['textFields_'.$this->product->id.'_'.$text_field['index']] = str_replace('<br />', "\n", $text_field['value']); you can remove this at your own risk. I do not know exactly why this is done. I deleted this part, but resulting in not saving custom field anymore, very strange! Link to comment Share on other sites More sharing options...
Recommended Posts