View Full Version : Adding a postcode / zipcode to an email subject line

09-09-2011, 09:25 AM
I am presently using opencart, and need to add a postcode / zipcode to the subject line that the admin gets (when an order is placed)

and the line is

$subject = sprintf($language->get('text_new_subject'), $order_info['store_name'], $order_id);I think the database wording is

but Im guessing the correct variable will be somewhere in the file below

how do I do this

any help greatly appreciated

the script is attached as its to long to post


09-09-2011, 04:19 PM
To update it properly you should change the format of text_new_subject and add an argument to the sprintf() (http://php.net/sprintf) function. But, you can simply append it like so:

$subject = sprintf($language->get('text_new_subject'), $order_info['store_name'], $order_id) . ' Postal Code: ' . $order_info['payment_postcode'];
// Or
$subject = sprintf($language->get('text_new_subject'), $order_info['store_name'], $order_id);
$subject .= ' Postal Code: ' . $order_info['payment_postcode'];

09-09-2011, 06:31 PM
Thank you so much, it works perfectly !!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum