custom product fields not displaying in emails

  • Posts: 102
  • Thank you received: 0
13 years 3 months ago #23176

hi, i have the business edition. i would like my custom product table fields to display in the confirmation emails. how do i get that to happen?
Liz

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

  • Posts: 102
  • Thank you received: 0
13 years 3 months ago #23178

i have tried simply entering the $row->MYFIELD into the cart template and it works in the cart but then is not passed to the email.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 3 months ago #23190

That information is not loaded in the notification email. Thus you first need to load it from the database:
$productClass = hikashop::get('class.product');
$product = $productClass->get($row->product_id);
echo $product->MYFIELD;

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

  • Posts: 102
  • Thank you received: 0
13 years 3 months ago #23192

i suspected as much.. just wasnt sure how to go about it.. thanks!

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

  • Posts: 102
  • Thank you received: 0
13 years 3 months ago #23194

is there a way to retrieve the products category?

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 3 months ago #23196

Everything is possible but that's more complicated. You need to do yourself the MySQL query on the table hikashop_product_category with a left join on hikashop_category in order to get the category data and then display it.

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

  • Posts: 102
  • Thank you received: 0
13 years 3 months ago #23197

gotcha.. can i do that query in the template or do i need to add it to one of the helper files?

also the code above is not working. i added it in to the template but i dont get any result on it.

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

  • Posts: 82868
  • Thank you received: 13376
  • MODERATOR
13 years 3 months ago #23211

You can do that directly in the template.

The code is not working ? are you sure that you have something in $row->product_id ?
Otherwise, that won't work...
By default, it should be $item->product_id not $row->product_id but I adapted the code as apparently you had $row and not $item.

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

Time to create page: 0.065 seconds
Powered by Kunena Forum