Virtuemart Customer Note "rn" Issue
Written by Alex (nedge2k)   
Tuesday, 13 January 2009 11:21
Virtuemart (1.1.2) allows shoppers to leave a message to the seller via a "customer_note" textarea. The value of this, along with all other $_POST variables gets shunted into the $d array. The issue comes when customers hit return in the textarea to get a new line. This "return" is stored as "\r\n" but when $_POST['customer_note'] is added to the $d array, the slashes are stripped out, leaving just the "rn"....which can be confusing for the recipient of the note. Now, you could spend ages going through all the code and finding exactly where  $_POST['customer_note'] gets added to the $d array or you could simply do this: In  /administrator/components/com_virtuemart/classes/ps_checkout.php, find:
L990 'customer_note' => htmlspecialchars(strip_tags($d['customer_note']), ENT_QUOTES ),
and change to:
L990 'customer_note' => htmlspecialchars(strip_tags($_POST['customer_note']), ENT_QUOTES ),
Simple! Now when you receive an order via email, if your customer has left a note, it will make a bit more sense ;)
Last Updated on Wednesday, 04 March 2009 09:01