[Skip to main content](#vessel-content)

#   How to include product category in the Order Administrator Notification

##

- **[a2zcs](/forum/user/33209-a2zcs "View a2zcs's Profile")**
- [![a2zcs's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar33209.jpg)](/forum/user/33209-a2zcs "View a2zcs's Profile") Topic Author
- [ Offline](/forum/user/33209-a2zcs)

Less More

- Posts: 298
- Thank you received: 7
-
-

4 years 6 months ago [\#341751](#341751) by [a2zcs](/forum/user/33209-a2zcs "View a2zcs's Profile")  *[How to include product category in the Order Administrator Notification](/forum/35-orders-management/904434-how-to-include-product-category-in-the-order-administrator-notification#341751 "-- url of the page with the problem -- :   blessedsacramentlibrary.org/  -- HikaShop version -- : 4.5.1 -- Joomla version -- : 4.1.3 -- PHP version -- : 7.4.29 -- Browser(s) name and version -- : Chrome -- Error-message(debug-mod must be tuned on) -- : none  Hi, I can see where I can add the tags for many other fields in the notification, but not for the category of an item. Is this possible? how? Thanks")* was created by *[a2zcs](/forum/user/33209-a2zcs "View a2zcs's Profile")*

-- url of the page with the problem -- : [ blessedsacramentlibrary.org/](https://blessedsacramentlibrary.org/)
-- HikaShop version -- : 4.5.1
-- Joomla version -- : 4.1.3
-- PHP version -- : 7.4.29
-- Browser(s) name and version -- : Chrome
-- Error-message(debug-mod must be tuned on) -- : none

Hi,
I can see where I can add the tags for many other fields in the notification, but not for the category of an item.
Is this possible? how?
Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDQzNC1ob3ctdG8taW5jbHVkZS1wcm9kdWN0LWNhdGVnb3J5LWluLXRoZS1vcmRlci1hZG1pbmlzdHJhdG9yLW5vdGlmaWNhdGlvbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14324
-
-

4 years 6 months ago [\#341755](#341755) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to include product category in the Order Administrator Notification](/forum/35-orders-management/904434-how-to-include-product-category-in-the-order-administrator-notification#341755 "-- url of the page with the problem -- :   blessedsacramentlibrary.org/  -- HikaShop version -- : 4.5.1 -- Joomla version -- : 4.1.3 -- PHP version -- : 7.4.29 -- Browser(s) name and version -- : Chrome -- Error-message(debug-mod must be tuned on) -- : none  Hi, I can see where I can add the tags for many other fields in the notification, but not for the category of an item. Is this possible? how? Thanks")*

Hi,

The data of the categories of each product is loaded but not available as tags.
When you edit an email in the menu System&gt;Emails, you have a "preload" area at the bottom of the edit interface.
There, you have the line: Code:

if(!empty($item-&gt;images[0]-&gt;file_path) &amp;&amp; $config-&gt;get('thumbnail', 1) != 0) {

Just before that line, you can add that code: Code:

$categories = array(); foreach($product-&gt;categories as $cat) { $categories[] = hikashop_translate($cat-&gt;category_name); } $cartProduct['CATEGORIES'] = implode(' / ', $categories);

And then you'll be able to use the tag {LINEVAR:CATEGORIES} in the HTML area of the email.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDQzNC1ob3ctdG8taW5jbHVkZS1wcm9kdWN0LWNhdGVnb3J5LWluLXRoZS1vcmRlci1hZG1pbmlzdHJhdG9yLW5vdGlmaWNhdGlvbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[a2zcs](/forum/user/33209-a2zcs "View a2zcs's Profile")**
- [![a2zcs's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar33209.jpg)](/forum/user/33209-a2zcs "View a2zcs's Profile") Topic Author
- [ Offline](/forum/user/33209-a2zcs)

Less More

- Posts: 298
- Thank you received: 7
-
-

4 years 6 months ago -  4 years 6 months ago [\#341762](#341762) by [a2zcs](/forum/user/33209-a2zcs "View a2zcs's Profile")  Replied by *[a2zcs](/forum/user/33209-a2zcs "View a2zcs's Profile")* on topic *[How to include product category in the Order Administrator Notification](/forum/35-orders-management/904434-how-to-include-product-category-in-the-order-administrator-notification#341762 "-- url of the page with the problem -- :   blessedsacramentlibrary.org/  -- HikaShop version -- : 4.5.1 -- Joomla version -- : 4.1.3 -- PHP version -- : 7.4.29 -- Browser(s) name and version -- : Chrome -- Error-message(debug-mod must be tuned on) -- : none  Hi, I can see where I can add the tags for many other fields in the notification, but not for the category of an item. Is this possible? how? Thanks")*

Hi,
Unfortunately, it doesn't seem to be working.

Last edit: 4 years 6 months ago by [a2zcs](/forum/user/33209-a2zcs "View a2zcs's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDQzNC1ob3ctdG8taW5jbHVkZS1wcm9kdWN0LWNhdGVnb3J5LWluLXRoZS1vcmRlci1hZG1pbmlzdHJhdG9yLW5vdGlmaWNhdGlvbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14324
-
-

4 years 6 months ago [\#341774](#341774) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to include product category in the Order Administrator Notification](/forum/35-orders-management/904434-how-to-include-product-category-in-the-order-administrator-notification#341774 "-- url of the page with the problem -- :   blessedsacramentlibrary.org/  -- HikaShop version -- : 4.5.1 -- Joomla version -- : 4.1.3 -- PHP version -- : 7.4.29 -- Browser(s) name and version -- : Chrome -- Error-message(debug-mod must be tuned on) -- : none  Hi, I can see where I can add the tags for many other fields in the notification, but not for the category of an item. Is this possible? how? Thanks")*

Hi,

where did you add the tag in the HTML ? And could you provide a screenshot of the area where you added the code in the preload ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDQzNC1ob3ctdG8taW5jbHVkZS1wcm9kdWN0LWNhdGVnb3J5LWluLXRoZS1vcmRlci1hZG1pbmlzdHJhdG9yLW5vdGlmaWNhdGlvbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[a2zcs](/forum/user/33209-a2zcs "View a2zcs's Profile")**
- [![a2zcs's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar33209.jpg)](/forum/user/33209-a2zcs "View a2zcs's Profile") Topic Author
- [ Offline](/forum/user/33209-a2zcs)

Less More

- Posts: 298
- Thank you received: 7
-
-

4 years 6 months ago [\#341810](#341810) by [a2zcs](/forum/user/33209-a2zcs "View a2zcs's Profile")  Replied by *[a2zcs](/forum/user/33209-a2zcs "View a2zcs's Profile")* on topic *[How to include product category in the Order Administrator Notification](/forum/35-orders-management/904434-how-to-include-product-category-in-the-order-administrator-notification#341810 "-- url of the page with the problem -- :   blessedsacramentlibrary.org/  -- HikaShop version -- : 4.5.1 -- Joomla version -- : 4.1.3 -- PHP version -- : 7.4.29 -- Browser(s) name and version -- : Chrome -- Error-message(debug-mod must be tuned on) -- : none  Hi, I can see where I can add the tags for many other fields in the notification, but not for the category of an item. Is this possible? how? Thanks")*

Hi thank you,
Here are those screen shots

- [ ![html.JPG](/forum/attachment/54848) ](/forum/attachment/54848 "html.JPG") [ ](/forum/attachment/54848?download=1 "html.JPG")
- [ ![preload.JPG](/forum/attachment/54849) ](/forum/attachment/54849 "preload.JPG") [ ](/forum/attachment/54849?download=1 "preload.JPG")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDQzNC1ob3ctdG8taW5jbHVkZS1wcm9kdWN0LWNhdGVnb3J5LWluLXRoZS1vcmRlci1hZG1pbmlzdHJhdG9yLW5vdGlmaWNhdGlvbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86583
- Thank you received: 14324
-
-

4 years 6 months ago [\#341811](#341811) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to include product category in the Order Administrator Notification](/forum/35-orders-management/904434-how-to-include-product-category-in-the-order-administrator-notification#341811 "-- url of the page with the problem -- :   blessedsacramentlibrary.org/  -- HikaShop version -- : 4.5.1 -- Joomla version -- : 4.1.3 -- PHP version -- : 7.4.29 -- Browser(s) name and version -- : Chrome -- Error-message(debug-mod must be tuned on) -- : none  Hi, I can see where I can add the tags for many other fields in the notification, but not for the category of an item. Is this possible? how? Thanks")*

Hi,

Thanks.
I looked into it and the issue is that in $product-&gt;categories, it's only an array of category ids where I thought it was the whole category object.
So you should use instead this code in the preload: Code:

$categories = array(); $categoryClass = hikashop_get('class.category'); foreach($product-&gt;categories as $cat) { $category = $categoryClass-&gt;get($cat); $categories[] = hikashop_translate($category-&gt;category_name); } $cartProduct['CATEGORIES'] = implode(' / ', $categories);

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50LzkwNDQzNC1ob3ctdG8taW5jbHVkZS1wcm9kdWN0LWNhdGVnb3J5LWluLXRoZS1vcmRlci1hZG1pbmlzdHJhdG9yLW5vdGlmaWNhdGlvbj90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.062 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
