Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add line breaks to comments during checkout


Recommended Posts

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...