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

#   Hide empty custom field from checkout cart

##

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

Less More

- Posts: 1195
- Thank you received: 13
-
-

1 year 4 months ago [\#367836](#367836) by [verzevoul](/forum/user/8351-verzevoul "View verzevoul's Profile")  *[Hide empty custom field from checkout cart](/forum/27-checkout/909567-hide-empty-custom-field-from-checkout-cart#367836 "-- HikaShop version -- : 6.0.0 -- Joomla version -- : 3.10.12  Hi!  I added two product custom fields to the checkout cart. I want to ask if it's possible to hide them if they have no value. For example one field is in some products but not the other is not, so they are both in the cart but one column looks empty.  Thank you!")* was created by *[verzevoul](/forum/user/8351-verzevoul "View verzevoul's Profile")*

-- HikaShop version -- : 6.0.0
-- Joomla version -- : 3.10.12

Hi!

I added two product custom fields to the checkout cart.
I want to ask if it's possible to hide them if they have no value.
For example one field is in some products but not the other is not, so they are both in the cart but one column looks empty.

Thank you!

- [ ![cart&#95;2025-07-14.jpg](/forum/attachment/60661) ](/forum/attachment/60661 "...2025-07-14.jpg") [ ](/forum/attachment/60661?download=1 "...2025-07-14.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0LzkwOTU2Ny1oaWRlLWVtcHR5LWN1c3RvbS1maWVsZC1mcm9tLWNoZWNrb3V0LWNhcnQ/dG1wbD1tYXJrZG93bg==) 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: 86581
- Thank you received: 14322
-
-

1 year 4 months ago [\#367843](#367843) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Hide empty custom field from checkout cart](/forum/27-checkout/909567-hide-empty-custom-field-from-checkout-cart#367843 "-- HikaShop version -- : 6.0.0 -- Joomla version -- : 3.10.12  Hi!  I added two product custom fields to the checkout cart. I want to ask if it's possible to hide them if they have no value. For example one field is in some products but not the other is not, so they are both in the cart but one column looks empty.  Thank you!")*

Hi,

Try adding the code: Code:

if(!empty($this-&gt;extraFields['product'])) { $remove = []; $config = hikashop_config(); $group = $config-&gt;get('group_options', 0); foreach($this-&gt;extraFields['product'] as $fieldname =&gt; $field) { $hide = true; foreach($products as $i =&gt; $product) { if(empty($product-&gt;cart_product_quantity)) continue; if($group &amp;&amp; !empty($product-&gt;cart_product_option_parent_id)) continue; if(empty($product-&gt;$fieldname)) continue; $hide = false; } if($hide) { $remove[] = $i; } } if(count($remove)) { foreach($remove as $k) { unset($this-&gt;extraFields['product'][$k]); } } }

after the line: Code:

$this-&gt;extraFields['product'] = $this-&gt;fieldClass-&gt;getFields('display:checkout=1', $products, 'product');

in the file components/com_hikashop/views/checkout/view.html.php
It should hopefully do it.
We can include this code on our end for the next version if it works fine.

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

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

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