How to add product description to admin email

  • Posts: 12
  • Thank you received: 0
11 years 4 months ago #137618

I created an item in Hikashop to act as a bundle, so I figured out how to get all of the product description (which contains a list of all of the items in the bundle) to show up in the checkout page by going into views and modifying the checkout -> cart PHP. However, we need that description to also be in the email that goes out to the admin, as that is what we use to enter the order details in our other system. So how do I get the product description to show up in the admin email? Currently I am doing this with an "If statement" so it only does this for this specific item number.

Here's my code I added to the checkout page:
if($row->product_code == "1290") {
echo $row->product_description;
}

And this is what I have tried so far in the admin email PHP but haven't gotten to work:
if($item->order_product_code == "1290") {
echo $item->order_product_description;
}

Not sure what I am doing wrong. Please help.

Thanks.

-- HikaShop version -- : latest
-- Joomla version -- : latest
-- PHP version -- : 5.3

Last edit: 11 years 4 months ago by printco.

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

  • Posts: 83766
  • Thank you received: 13555
  • MODERATOR
11 years 4 months ago #137639

Hi,

There is no order_product_description which exists in the database so you can't do that.
You would need first to load the description of the product:

if($item->order_product_code == "1290") {
$productClass = hikashop_get('class.product');
$productData = $productClass->get($item->product_id);
echo $productData->product_description;
}

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

Time to create page: 0.055 seconds
Powered by Kunena Forum