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

#   Show custom field based on characteristics

##

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

Less More

- Posts: 11
- Thank you received: 0
-
-

13 years 2 months ago [\#121376](#121376) by [Jeroen](/forum/user/21342-jeroen "View Jeroen's Profile")  *[Show custom field based on characteristics](/forum/4-how-to/861590-show-custom-field-based-on-characteristics#121376 "-- url of the page with the problem -- : currently local, but can make available online if required -- HikaShop version -- : 2.2.1 (Business) -- Joomla version -- : 3.1 -- PHP version -- : 5.3.13 -- Browser(s) name and version -- : Mozilla/5.0 (Firefox)  Hi,  I am developing a shop to send hand written cards. However I haven't been able to find out the following.  The product page should work for the user in the following way: 1. User selects a product. 2. User selects additional options (gifts) 3. User selects if he wants to add a personal message to the post card 4a. if yes, additional field shows up to add the message 4b. if no, nothing happens 5. user adds product to cart 6. proper price is calculated. Price is increased when the user requires a personal message on the card.  Currently I have succeeded in step 1 to 4b by using the standard functionality as well as two custom fields for step 3 and 4. Field1: Personal message yes/no. Field2 appears when selecting yes in field one. Thereafter obviously step 5 is also succesful, but I am not able to update the price (or add an additional product with the correct price) to the cart  Additionally I have tried to add another option to the main-product, then the price is calculated correctly, but I can't add a specific text message.  Any help or ideas on how to solve this is highly appreciated!")* was created by *[Jeroen](/forum/user/21342-jeroen "View Jeroen's Profile")*

-- url of the page with the problem -- : currently local, but can make available online if required
-- HikaShop version -- : 2.2.1 (Business)
-- Joomla version -- : 3.1
-- PHP version -- : 5.3.13
-- Browser(s) name and version -- : Mozilla/5.0 (Firefox)

Hi,

I am developing a shop to send hand written cards. However I haven't been able to find out the following.

The product page should work for the user in the following way:
1. User selects a product.
2. User selects additional options (gifts)
3. User selects if he wants to add a personal message to the post card
4a. if yes, additional field shows up to add the message
4b. if no, nothing happens
5. user adds product to cart
6. proper price is calculated. Price is increased when the user requires a personal message on the card.

Currently I have succeeded in step 1 to 4b by using the standard functionality as well as two custom fields for step 3 and 4. Field1: Personal message yes/no. Field2 appears when selecting yes in field one. Thereafter obviously step 5 is also succesful, but I am not able to update the price (or add an additional product with the correct price) to the cart

Additionally I have tried to add another option to the main-product, then the price is calculated correctly, but I can't add a specific text message.

Any help or ideas on how to solve this is highly appreciated!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTU5MC1zaG93LWN1c3RvbS1maWVsZC1iYXNlZC1vbi1jaGFyYWN0ZXJpc3RpY3M/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: 86358
- Thank you received: 14293
-
-

13 years 2 months ago [\#121380](#121380) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Show custom field based on characteristics](/forum/4-how-to/861590-show-custom-field-based-on-characteristics#121380 "-- url of the page with the problem -- : currently local, but can make available online if required -- HikaShop version -- : 2.2.1 (Business) -- Joomla version -- : 3.1 -- PHP version -- : 5.3.13 -- Browser(s) name and version -- : Mozilla/5.0 (Firefox)  Hi,  I am developing a shop to send hand written cards. However I haven't been able to find out the following.  The product page should work for the user in the following way: 1. User selects a product. 2. User selects additional options (gifts) 3. User selects if he wants to add a personal message to the post card 4a. if yes, additional field shows up to add the message 4b. if no, nothing happens 5. user adds product to cart 6. proper price is calculated. Price is increased when the user requires a personal message on the card.  Currently I have succeeded in step 1 to 4b by using the standard functionality as well as two custom fields for step 3 and 4. Field1: Personal message yes/no. Field2 appears when selecting yes in field one. Thereafter obviously step 5 is also succesful, but I am not able to update the price (or add an additional product with the correct price) to the cart  Additionally I have tried to add another option to the main-product, then the price is calculated correctly, but I can't add a specific text message.  Any help or ideas on how to solve this is highly appreciated!")*

Hi,

You won't be able to display/hide a text field based on a characteristic/option value. That's not possible easily.
There are two possibilities:
- the obvious is to always display the text field so that the user can enter something in it when he activate the option and clearly explain to him that the field needs only to be filled in that case.
- you can use only custom item fields and the "display limited to" option of the custom item field of the text to limit it to the option with the personal message. However, custom fields cannot change the price of a product like characteristics or options and in that case, you will want to create a small quantity price calculation override plugin to change the price of the product in the cart based on whether the user entered a personal message or not:
[ www.hikashop.com/support/documentation/6...tation.html#override](http://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#override)
Here is an example of such plugin:
demo.hikashop.com/index.php?option=com_hikashop&amp;ctrl=product&amp;task=show&amp;cid=214

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

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

Less More

- Posts: 198
- Thank you received: 4
-
-

2 years 5 months ago [\#361240](#361240) by [arnask](/forum/user/6752-arnask "View arnask's Profile")  Replied by *[arnask](/forum/user/6752-arnask "View arnask's Profile")* on topic *[Show custom field based on characteristics](/forum/4-how-to/861590-show-custom-field-based-on-characteristics#361240 "-- url of the page with the problem -- : currently local, but can make available online if required -- HikaShop version -- : 2.2.1 (Business) -- Joomla version -- : 3.1 -- PHP version -- : 5.3.13 -- Browser(s) name and version -- : Mozilla/5.0 (Firefox)  Hi,  I am developing a shop to send hand written cards. However I haven't been able to find out the following.  The product page should work for the user in the following way: 1. User selects a product. 2. User selects additional options (gifts) 3. User selects if he wants to add a personal message to the post card 4a. if yes, additional field shows up to add the message 4b. if no, nothing happens 5. user adds product to cart 6. proper price is calculated. Price is increased when the user requires a personal message on the card.  Currently I have succeeded in step 1 to 4b by using the standard functionality as well as two custom fields for step 3 and 4. Field1: Personal message yes/no. Field2 appears when selecting yes in field one. Thereafter obviously step 5 is also succesful, but I am not able to update the price (or add an additional product with the correct price) to the cart  Additionally I have tried to add another option to the main-product, then the price is calculated correctly, but I can't add a specific text message.  Any help or ideas on how to solve this is highly appreciated!")*

its been long time from this post, but today i need the same: to display Text field based on characteristics value. Is there any way i can achieve that?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTU5MC1zaG93LWN1c3RvbS1maWVsZC1iYXNlZC1vbi1jaGFyYWN0ZXJpc3RpY3M/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: 86358
- Thank you received: 14293
-
-

2 years 5 months ago [\#361243](#361243) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Show custom field based on characteristics](/forum/4-how-to/861590-show-custom-field-based-on-characteristics#361243 "-- url of the page with the problem -- : currently local, but can make available online if required -- HikaShop version -- : 2.2.1 (Business) -- Joomla version -- : 3.1 -- PHP version -- : 5.3.13 -- Browser(s) name and version -- : Mozilla/5.0 (Firefox)  Hi,  I am developing a shop to send hand written cards. However I haven't been able to find out the following.  The product page should work for the user in the following way: 1. User selects a product. 2. User selects additional options (gifts) 3. User selects if he wants to add a personal message to the post card 4a. if yes, additional field shows up to add the message 4b. if no, nothing happens 5. user adds product to cart 6. proper price is calculated. Price is increased when the user requires a personal message on the card.  Currently I have succeeded in step 1 to 4b by using the standard functionality as well as two custom fields for step 3 and 4. Field1: Personal message yes/no. Field2 appears when selecting yes in field one. Thereafter obviously step 5 is also succesful, but I am not able to update the price (or add an additional product with the correct price) to the cart  Additionally I have tried to add another option to the main-product, then the price is calculated correctly, but I can't add a specific text message.  Any help or ideas on how to solve this is highly appreciated!")*

Hi,

It's possible to do it with a bit of custom javascript code in a view override:
[ www.hikashop.com/forum/product-category-...characteristics.html](https://www.hikashop.com/forum/product-category-display/901807-dependent-characteristics.html)

Now, I think that in most cases, you should rather use only custom item fields with the "display limited to" setting as I was saying here 10 years ago. Since then, we have released the price calculations plugin ( [ www.hikashop.com/marketplace/product/148...ce-calculations.html](https://www.hikashop.com/marketplace/product/148-price-calculations.html) ) which allows you to provide formulas for overriding the price of the product based on what is selected / entered in the custom item fields. So if you're using characteristics because you need to provide different prices for different variants of the product, a full custom item fields solution with the price calculation plugin is what I would recommend.
Now, if you need to handle other things, like different images for different variants, or different stock for different variants, this won't help and the custom javascript code will be more adapted to your situation.

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

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

Less More

- Posts: 198
- Thank you received: 4
-
-

2 years 5 months ago -  2 years 5 months ago [\#361263](#361263) by [arnask](/forum/user/6752-arnask "View arnask's Profile")  Replied by *[arnask](/forum/user/6752-arnask "View arnask's Profile")* on topic *[Show custom field based on characteristics](/forum/4-how-to/861590-show-custom-field-based-on-characteristics#361263 "-- url of the page with the problem -- : currently local, but can make available online if required -- HikaShop version -- : 2.2.1 (Business) -- Joomla version -- : 3.1 -- PHP version -- : 5.3.13 -- Browser(s) name and version -- : Mozilla/5.0 (Firefox)  Hi,  I am developing a shop to send hand written cards. However I haven't been able to find out the following.  The product page should work for the user in the following way: 1. User selects a product. 2. User selects additional options (gifts) 3. User selects if he wants to add a personal message to the post card 4a. if yes, additional field shows up to add the message 4b. if no, nothing happens 5. user adds product to cart 6. proper price is calculated. Price is increased when the user requires a personal message on the card.  Currently I have succeeded in step 1 to 4b by using the standard functionality as well as two custom fields for step 3 and 4. Field1: Personal message yes/no. Field2 appears when selecting yes in field one. Thereafter obviously step 5 is also succesful, but I am not able to update the price (or add an additional product with the correct price) to the cart  Additionally I have tried to add another option to the main-product, then the price is calculated correctly, but I can't add a specific text message.  Any help or ideas on how to solve this is highly appreciated!")*

i just bought this plugin, looks promising, but for me without coding skills it's quite hard to understand what should i input in formula if i just want to add 60 euros to price if one of dropdown (custom item field value) is selected?

Can you give me at least one real world example?

Last edit: 2 years 5 months ago by [arnask](/forum/user/6752-arnask "View arnask's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTU5MC1zaG93LWN1c3RvbS1maWVsZC1iYXNlZC1vbi1jaGFyYWN0ZXJpc3RpY3M/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: 86358
- Thank you received: 14293
-
-

2 years 5 months ago -  2 years 5 months ago [\#361264](#361264) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Show custom field based on characteristics](/forum/4-how-to/861590-show-custom-field-based-on-characteristics#361264 "-- url of the page with the problem -- : currently local, but can make available online if required -- HikaShop version -- : 2.2.1 (Business) -- Joomla version -- : 3.1 -- PHP version -- : 5.3.13 -- Browser(s) name and version -- : Mozilla/5.0 (Firefox)  Hi,  I am developing a shop to send hand written cards. However I haven't been able to find out the following.  The product page should work for the user in the following way: 1. User selects a product. 2. User selects additional options (gifts) 3. User selects if he wants to add a personal message to the post card 4a. if yes, additional field shows up to add the message 4b. if no, nothing happens 5. user adds product to cart 6. proper price is calculated. Price is increased when the user requires a personal message on the card.  Currently I have succeeded in step 1 to 4b by using the standard functionality as well as two custom fields for step 3 and 4. Field1: Personal message yes/no. Field2 appears when selecting yes in field one. Thereafter obviously step 5 is also succesful, but I am not able to update the price (or add an additional product with the correct price) to the cart  Additionally I have tried to add another option to the main-product, then the price is calculated correctly, but I can't add a specific text message.  Any help or ideas on how to solve this is highly appreciated!")*

Hi,

Suppose that in your custom field, you've configured the column to be "my_field" and that you've added two values 0 and 1 with their titles being respectively "no" and "yes".
You can use this formula: Code:

({my_field}*60+{price})*{cart_product_quantity}

That way, {my_field} will be replaced by either 0 or 1, {price} will be replaced by the base price of the product that you've configured in the product, and {cart_product_quantity} will be replaced by the quantity of the product in the cart (or 1 on the product details page).
So for example, if the base price of the product is 100, if "no" is selected, the price will be: (0*60+100)*1 = 100
And if "yes" is selected, the price will be: (1*60+100)*1 = 160

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

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

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

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