OK...
/includes/classes/order.php
I want to suck in an additional field called : gift_message (which is a textarea field on the checkout which we have utilised so that people can add in information about their delivery)... and place this in the confirmation email....
BUT : $db-Execute() is not returning a value for 'gift_message'
I have checked in the database. There is data in this field once the order is submitted... All data and orders get processed just fine.
I have added in 'customers_name' and 'shipping_telephone' to my query below just to see what is going on.
Code:
global $db;
$orderDelvDate_query = "SELECT customers_name, gift_message, shipping_telephone FROM " . TABLE_ORDERS . " WHERE orders_id='" . int($zf_insert_id) . "'";
$orderDelvDate = $db->Execute($orderDelvDate_query);
if (isset($orderDelvDate) && $orderDelvDate!="")
{
foreach ($orderDelvDate->fields as $i => $value)
{
$html_msg['PREFERRED_DELIVERY_DATE'] .= "<br/>" . $i . " = " . $value;
}
}
And, in the email I get:
customers_name = Scott Shaw
gift_message =
shipping_telephone = 448456440537
Key Problem : There should be a value against 'gift_message'.
Has anyone ANY idea why there is no value assigned to this in the Array. Data is in the database 'orders' table. And the field is called 'gift_message'
I have looked at tonnes of other code and they all just do something straightforeward like:
$html_msg['PREFERRED_DELIVERY_DATE'] = $orderDelvDate->fields['gift_message'];
But this just keeps coming up Empty.
Please please please help.
Bookmarks