Skip to main content

custom product fields not displaying in emails

More
15 years 1 month ago #23176 by MinnieMouse
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.

More
15 years 1 month ago #23178 by MinnieMouse
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.

More
15 years 1 month ago #23190 by nicolas
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.

More
15 years 1 month ago #23192 by MinnieMouse
i suspected as much.. just wasnt sure how to go about it.. thanks!

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

More
15 years 1 month ago #23194 by MinnieMouse
is there a way to retrieve the products category?

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

More
15 years 1 month ago #23196 by nicolas
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.

More
15 years 1 month ago #23197 by MinnieMouse
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.

More
15 years 1 month ago #23211 by nicolas
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.211 seconds
Powered by Kunena Forum