Add Custom Fields to Order Summary Email

  • Posts: 214
  • Thank you received: 1
11 years 2 days ago #134007

Hi There,

I'm wondering if this is possible. Firstly, see the following screen shots





What I've been asked to do is add the brewery name to the order summary email, in this case it's the text "Wold Top -".

Now I've already created a custom field in the products table, and I'm inserting it into product > listing > img_title.php to display the brewery on the product listing page. So my question is can I use this same code (which is <?php echo $this->row->brewer; ?>) to display that custom field on the order summary email or do I have to do something different?

Kind Regards,

Matthew

Attachments:

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

  • Posts: 12953
  • Thank you received: 1778
11 years 2 days ago #134019

Hi,

Note that if you use a custom field from the "Item" table, your custom field will automatically show through your invoice and emails.

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

  • Posts: 214
  • Thank you received: 1
11 years 2 days ago #134024

Hi Mohamed,

I wasn't looking to create another new custom field, I was looking to insert a custom field I had already created into an email if that makes sense?

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

  • Posts: 13201
  • Thank you received: 2322
11 years 1 day ago #134103

Hi,

In the email you can add the following tag:

{LINEVAR:product.CUSTOM_FIELD_NAME}
after this line:
{LINEVAR:PRODUCT_NAME}<!--{IF:ORDER_PRODUCT_CODE}--> {LINEVAR:PRODUCT_CODE}<!--{ENDIF:ORDER_PRODUCT_CODE}-->

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

  • Posts: 214
  • Thank you received: 1
11 years 1 day ago #134107

Hi Xavier,

I'm afraid I don't see the line

{LINEVAR:PRODUCT_NAME}<!--{IF:ORDER_PRODUCT_CODE}--> {LINEVAR:PRODUCT_CODE}<!--{ENDIF:ORDER_PRODUCT_CODE}-->

I assume I should be looking in the email 'Order creation notification'?

Attachments:
Last edit: 11 years 1 day ago by matps.

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

  • Posts: 214
  • Thank you received: 1
10 years 11 months ago #134398

Hi Guys, wondering if I could have abit more help with this?

I tried putting {LINEVAR:product.CUSTOM_FIELD_NAME} after it says {LINEVAR:PRODUCT_NAME} which didn't seem to work, but I'm not sure if I'm looking in the right place?

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

  • Posts: 82868
  • Thank you received: 13378
  • MODERATOR
10 years 11 months ago #134469

Xavier was correct and wrong in his answer :)
The problem with what he told you is that the tags he gave you will only exist in next version of HikaShop.
With the current version of HikaShop, such modification is much more complex as you also need to edit the preload file corresponding to the email in the folder media/com_hikashop/mail/ in order to add php code to generate the var tag that you'll be able to use on the email template. If you're well versed into programming, look at what we do for the product_name field and do the same for your custom field column name and that will work. If not, then I would recommend to wait for next version of HikaShop in one or two weeks in order to be able to do what Xavier explained.

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

  • Posts: 214
  • Thank you received: 1
10 years 11 months ago #134535

While I am starting to understand PHP a lot more then I did thanks to the help from all you guys, I certainly wouldn't call myself "well versed" at all! I'll look into what you suggested, as I like to give things a go, but I think it would probably make sense to wait for the next update!

Thanks Guys

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

Time to create page: 0.113 seconds
Powered by Kunena Forum