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

#   Custom fields for product in order variable

##

- **[tgdkere2](/forum/user/8136-tgdkere2 "View tgdkere2's Profile")**
- [![tgdkere2's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/8136-tgdkere2 "View tgdkere2's Profile") Topic Author
- [ Offline](/forum/user/8136-tgdkere2)

Less More

- Posts: 82
- Thank you received: 5
-
-

4 years 7 months ago [\#340633](#340633) by [tgdkere2](/forum/user/8136-tgdkere2 "View tgdkere2's Profile")  *[Custom fields for product in order variable](/forum/31-development/904211-custom-fields-for-product-in-order-variable#340633 "Hi,  I created a custom field for the product table which I would need in the order variable: $order&#95;full = $orderClass-&gt;loadFullOrder($order-&gt;order&#95;id, true, false);  This custom field is also displayed on the frontend.  I need this custom field for the product in the function: onAfterOrderUpdate(&amp;$order, &amp;$send&#95;email)  But the custom field is not available in the order variable.  Why not and how can I add it , so that I can use it in the function onAfterOrderUpdate ???  Thanks and br Rene")* was created by *[tgdkere2](/forum/user/8136-tgdkere2 "View tgdkere2's Profile")*

Hi,

I created a custom field for the product table which I would need in the order variable:
$order_full = $orderClass-&gt;loadFullOrder($order-&gt;order_id, true, false);

This custom field is also displayed on the frontend.

I need this custom field for the product in the function: onAfterOrderUpdate(&amp;$order, &amp;$send_email)

But the custom field is not available in the order variable.

Why not and how can I add it , so that I can use it in the function onAfterOrderUpdate ???

Thanks and br
Rene

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwNDIxMS1jdXN0b20tZmllbGRzLWZvci1wcm9kdWN0LWluLW9yZGVyLXZhcmlhYmxlP3RtcGw9bWFya2Rvd24=) 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: 86541
- Thank you received: 14304
-
-

4 years 7 months ago -  4 years 7 months ago [\#340651](#340651) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Custom fields for product in order variable](/forum/31-development/904211-custom-fields-for-product-in-order-variable#340651 "Hi,  I created a custom field for the product table which I would need in the order variable: $order&#95;full = $orderClass-&gt;loadFullOrder($order-&gt;order&#95;id, true, false);  This custom field is also displayed on the frontend.  I need this custom field for the product in the function: onAfterOrderUpdate(&amp;$order, &amp;$send&#95;email)  But the custom field is not available in the order variable.  Why not and how can I add it , so that I can use it in the function onAfterOrderUpdate ???  Thanks and br Rene")*

Hi,

Well, the whole product data in not loaded with the order. That's because this is usually not needed.
You can do this in your code: Code:

$productClass = hikashop_get('class.product); foreach( $order_full-&gt;products as $product) { $productData = $productClass-&gt;get($product-&gt;product_id); echo $productData-&gt;xxx; }

where xxx is the column name of your custom field of the table "product".

Last edit: 4 years 7 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

The following user(s) said Thank You: [tgdkere2](/forum/user/8136-tgdkere2 "View tgdkere2's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50LzkwNDIxMS1jdXN0b20tZmllbGRzLWZvci1wcm9kdWN0LWluLW9yZGVyLXZhcmlhYmxlP3RtcGw9bWFya2Rvd24=) 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.044 seconds

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