Eamil Customization

  • Posts: 10
  • Thank you received: 0
10 years 7 months ago #150203

Couple questions on customizing emails.

1. On email #14 (Market: Order status notification) I need to add a custom field. The custom field is in the vendor table, column name "acct_number". I've tried {VAR:vendor.acct_number} and {VAR:plg.hikamarket.vendor.acct_number} but no luck. (I've successfully added other custom fields from the order table (such as {VAR:order.gift_message}) but I can't get this one from the vendor table to work...)

2. How can I add that custom field to the email subject? I'd like the subject line to be something like "Purchase Order: ID (acct_number)-(order number)". Would prfer to do this without hacking any core...

3. I'd like to just reference the order number in the HTML. What's the field name?

Thanks much!

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 7 months ago #150268

Hi,

Adding vendor data in the email
Please edit the email "preloader" and replace the content

$vars = array(
	'LIVE_SITE' => HIKASHOP_LIVE,
	'URL' => $order_url,
	'ORDER_PRODUCT_CODE' => (bool)$shopConfig->get('show_product_code', false),
	'order' => $data->cart,
	'billing_address' => @$data->cart->billing_address,
	'shipping_address' => @$data->cart->shipping_address,
);
By
$vars = array(
	'LIVE_SITE' => HIKASHOP_LIVE,
	'URL' => $order_url,
	'ORDER_PRODUCT_CODE' => (bool)$shopConfig->get('show_product_code', false),
	'order' => $data->cart,
	'billing_address' => @$data->cart->billing_address,
	'shipping_address' => @$data->cart->shipping_address,
	'vendor' => $data->vendor
);
(this modification will be include in the next HikaMarket release).
Once the "vendor" variable created, you will be able to use a tag like {VAR:vendor.acct_number} to access to the "acct_number" custom field of the vendor.

Override of the email subject
To change the email subject, the best is to add some code in the preload part in order to create it dynamically.
You have to put your content in the variable
$mail->subject = "Purchase Order: ID " . $vendor->acct_number . " - " . $data->order->order_number

Accessing to the order number
The order_number is a field of the order object. You can access it through {VAR:order.order_number}

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Last edit: 10 years 7 months ago by Jerome.
The following user(s) said Thank You: bearingsnorth

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 0
10 years 7 months ago #150298

Awesome. Thanks so much for the quick, clear reply! Works great.

Please Log in or Create an account to join the conversation.

Time to create page: 0.048 seconds
Powered by Kunena Forum