Hi, I'm wondering if you can provide some guidance. I'm trying to modify the code so that I can retrieve various order attributes, and reference them in the HTML and text files. I've been using the [coupon] as a reference, but I'm a low-level hack at PHP.
I'd like to get one attribute working, and then duplicate it. I'm starting with an attribute called RecipientName, and I wrote some SQL to retrieve it. I know the SQL code works, and tried to follow your example for the PHP syntax. I put the code right after the retrieval of the customer name.
Code:
/* First, let's get the customer's name */
//If in order mode
if ($this_auto_state == 'order') {
$sql3="select customers_name from " . AUTO_TABLE_ORDERS . " where orders_id='".$result->fields['orders_id']."'";
$result3=$db->Execute($sql3);
$name=$result3->fields['customers_name'];
//AAE - Retrieve RecipientName
$SQL-AAE-Recipient = "select products_options_values from " . AUTO_TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id='".$result->fields['orders_id']."'" AND products_options_id = 45";
$ResultRecipientName=$db->Execute($SQL-AAE-Recipient);
$RecipientName=$ResultRecipientName->fields['RecipientName'];
However, I'm unclear what I'd need to do to reference it by typing [RecipientName]. I duplicated what you had for the coupon by typing
Code:
//This can be changed here if desired.
$coupon_key = "[coupon]";
// AAE - Set Recipient Name keyword.
$RecipientNameKey = "[RecipientName]";
Can you help me connect the dots? What am I missing? What else do I need to do? Do you see any syntax errors? Thanks.
Bookmarks