Just so you know, Jerome, you're speaking to someone who as a professional technical writer has written Developer-level documentation for Microsoft and Amazon. I'm used to figuring things out, so if I am confused, other people reading this will be also. I'm thinking of their needs, not just my own.
The salient point left out here is WHERE one edits the address_template. The correct answer is:
1. In Hikashop, click the Display menu, then Views.
2. Select template you use for your web from the middle dropdown "All templates". That filters the available views for your particular template.
3. Click on address_template to open the editor.
4. Insert the fieldname surrounded by curly braces at the location where you want the data to appear. Click Save and Close to save your work.
OK, that takes care of adding the field in the address_template (which subsequently appears on emails, invoices, etc), but it still doesn't help me with getting the custom fields into the invoice email. I still don't have a clear answer on how to include the custom fields.
In looking at the Preload file, I see a variable called
that appears to contain all of the customer data.
$customer = $data->customer;
Elsewhere I see things like:
$customer_name = @$customer->name;
Which leads me to believe that if I need to pull up the 2 User Custom Fields (licensetype and licensenum), I should add variables to this array:
$vars = array(
'LIVE_SITE' => HIKASHOP_LIVE,
'URL' => $order_url,
'order' => $data->cart,
'ORDER_PRODUCT_CODE' => (bool)$config->get('show_product_code', false),
'user' => $customer,
'billing_address' => @$data->cart->billing_address,
'shipping_address' => @$data->cart->shipping_address,
'customer_licentype' = @$customer->licensetype,
'customer_licennum' = @$customer->licensenum,
);
Am I on the right track to include these custom fields at this level? If not, what should the code be?
I tried adding the custom field placeholders {field_name} in
Configuration | Emails | Order notification | HTML Email in the HTML email as {user.licensenum} and {user.licensetype} and Hikashop simply throws away the code and doesn't display anything. This procedure is not documented, and I'm beyond frustrated.
Can you advise?
Toolie