Parent Product Name in email order create

  • Posts: 20
  • Thank you received: 0
6 years 2 months ago #287566

-- HikaShop version -- : 3.2.2
-- Joomla version -- : 3.8.5

Hi Guys I am creating an email override for the Order Create and I would like to echo the parent product name on the email order as well as the existing $item->order_product_name;

I had a look at $item and I can't see information about the parent element.

How would I go about that?

Changing templaes via hikashop > System > Emails.

Thanks

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

  • Posts: 81540
  • Thank you received: 13069
  • MODERATOR
6 years 2 months ago #287572

Hi,

The information is not loaded.
You need to use the $item->product_id to load the data of the product from hikashop_product with a MySQL query.
Then, run a second MySQL query on hikashop_product using this time the product_parent_id of the result of the first query.
The product name of the parent will then be in the result of the second query in product_name

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

Time to create page: 0.057 seconds
Powered by Kunena Forum