cDGo IT Consultancy Posted August 2, 2018 Share Posted August 2, 2018 Hi, I'm trying to add some text to the comments during checkout. The only issue which occurs is that line breaks do not work. \n or <br> are plain visible, while the "shift enter" linebreaks from the textarea input just work as expected. It sounds really easy to do, but I'm overseeing it, any help is appreciated. Link to comment Share on other sites More sharing options...
burt Posted August 2, 2018 Share Posted August 2, 2018 Try nl2br Link to comment Share on other sites More sharing options...
cDGo IT Consultancy Posted August 2, 2018 Author Share Posted August 2, 2018 Hi Burt, Tried that before, but didn't work, but maybe doing it on the wrong place or wrong way. On checkout_shipping.php page I manually enter: Line 1 Line 2 Line 3 In checkout_shipping.php: $comments = ''; if (tep_not_null($_POST['comments'])) { $comments .= tep_db_prepare_input($_POST['comments']); } After that I'm trying to do something like: $comments .= '\n\r' . $key . ': ' . $value; On the checkout_payment.php page the comments look like: Line 1 Line 2 Line 3\n\rkey: value Link to comment Share on other sites More sharing options...
burt Posted August 2, 2018 Share Posted August 2, 2018 $comments .= $key . ': ' . $value . PHP_EOL; Link to comment Share on other sites More sharing options...
cDGo IT Consultancy Posted August 2, 2018 Author Share Posted August 2, 2018 You solved it like a boss! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.