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

#   Get item custom field values in onBeforeCartUpdate

##

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

Less More

- Posts: 13
- Thank you received: 0
-
-

11 years 1 week ago [\#217592](#217592) by [boxcarmib](/forum/user/39131-boxcarmib "View boxcarmib's Profile")  *[Get item custom field values in onBeforeCartUpdate](/forum/31-development/879907-get-item-custom-field-values-in-onbeforecartupdate#217592 "-- HikaShop version -- : 2.6.6 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.6.13 -- Browser(s) name and version -- : safari -- Error-message(debug-mod must be tuned on) -- : N/A  I have products set up with item custom fields which are then used to create a custom file. I need to access those custom fields as the product is being put in the cart so that the image that is displayed in the cart reflects the item values the customer entered for the product.  so far in a plugin on an onBeforeCartUpdate event function I have:  $productClass = hikashop&#95;get('class.product'); $product = $productClass-&gt;get($product&#95;id); var&#95;dump($product);  which displays a lot of product fields but not the item custom values that the user entered before clicking &quot;Add to Cart&quot;.  In my onBeforeCartUpdate function, how do I access the item custom values the customer selected?")* was created by *[boxcarmib](/forum/user/39131-boxcarmib "View boxcarmib's Profile")*

-- HikaShop version -- : 2.6.6
-- Joomla version -- : 3.4.4
-- PHP version -- : 5.6.13
-- Browser(s) name and version -- : safari
-- Error-message(debug-mod must be tuned on) -- : N/A

I have products set up with item custom fields which are then used to create a custom file. I need to access those custom fields as the product is being put in the cart so that the image that is displayed in the cart reflects the item values the customer entered for the product.

so far in a plugin on an onBeforeCartUpdate event function I have:

$productClass = hikashop_get('class.product');
$product = $productClass-&gt;get($product_id);
var_dump($product);

which displays a lot of product fields but not the item custom values that the user entered before clicking "Add to Cart".

In my onBeforeCartUpdate function, how do I access the item custom values the customer selected?

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

11 years 1 week ago [\#217606](#217606) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Get item custom field values in onBeforeCartUpdate](/forum/31-development/879907-get-item-custom-field-values-in-onbeforecartupdate#217606 "-- HikaShop version -- : 2.6.6 -- Joomla version -- : 3.4.4 -- PHP version -- : 5.6.13 -- Browser(s) name and version -- : safari -- Error-message(debug-mod must be tuned on) -- : N/A  I have products set up with item custom fields which are then used to create a custom file. I need to access those custom fields as the product is being put in the cart so that the image that is displayed in the cart reflects the item values the customer entered for the product.  so far in a plugin on an onBeforeCartUpdate event function I have:  $productClass = hikashop&#95;get('class.product'); $product = $productClass-&gt;get($product&#95;id); var&#95;dump($product);  which displays a lot of product fields but not the item custom values that the user entered before clicking &quot;Add to Cart&quot;.  In my onBeforeCartUpdate function, how do I access the item custom values the customer selected?")*

Hi,

If you load the product ; you will load the "product" custom fields.
If you want to access to the "item" custom fields ; you should load the "order product" ; but that's not needed when you have the order object (from a "loadFullCart" because the item custom fields are already loaded there).

Regardsn

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

[](#top)
