- Posts: 102
- Thank you received: 0
custom product fields not displaying in emails
- MinnieMouse
-
Topic Author
- Offline
Less
More
15 years 1 month ago #23176
by MinnieMouse
custom product fields not displaying in emails was created 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
Liz
Please Log in or Create an account to join the conversation.
- MinnieMouse
-
Topic Author
- Offline
Less
More
- Posts: 102
- Thank you received: 0
15 years 1 month ago #23178
by MinnieMouse
Replied by MinnieMouse on topic Re: custom product fields not displaying in emails
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.
15 years 1 month ago #23190
by nicolas
Replied by nicolas on topic Re: custom product fields not displaying in emails
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;
$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.
- MinnieMouse
-
Topic Author
- Offline
Less
More
- Posts: 102
- Thank you received: 0
15 years 1 month ago #23192
by MinnieMouse
Replied by MinnieMouse on topic Re: custom product fields not displaying in emails
i suspected as much.. just wasnt sure how to go about it.. thanks!
Please Log in or Create an account to join the conversation.
- MinnieMouse
-
Topic Author
- Offline
Less
More
- Posts: 102
- Thank you received: 0
15 years 1 month ago #23194
by MinnieMouse
Replied by MinnieMouse on topic Re: custom product fields not displaying in emails
is there a way to retrieve the products category?
Please Log in or Create an account to join the conversation.
15 years 1 month ago #23196
by nicolas
Replied by nicolas on topic Re: custom product fields not displaying in emails
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.
- MinnieMouse
-
Topic Author
- Offline
Less
More
- Posts: 102
- Thank you received: 0
15 years 1 month ago #23197
by MinnieMouse
Replied by MinnieMouse on topic Re: custom product fields not displaying in emails
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.
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.
15 years 1 month ago #23211
by nicolas
Replied by nicolas on topic Re: custom product fields not displaying in emails
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.
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