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

#   custom field with price

##

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

Less More

- Posts: 26
- Thank you received: 1
-
-

10 years 2 weeks ago [\#255230](#255230) by [jannick](/forum/user/33157-jannick "View jannick's Profile")  *[custom field with price](/forum/27-checkout/887480-custom-field-with-price#255230 "-- HikaShop version -- : HikaShop Business 2.6.4 -- Joomla version -- : 3.6.4 -- PHP version -- : 5.6.26 -- Browser(s) name and version -- : Chrome newest  Hi,  Question 1  I need the customer to be able to choose a packing: normal, luxe etc. Each packing has it's own price. I dont want to use the Characteristics because this will result in to many variations. I've created a custom dropdown field to achieve this option. This custom field is using the donation plugin of hikashop to calculate the new price for each product. This plugin comes with the following problem: the plugin uses the option value, when someone changes the value in the html, this value wil be used. The customer can easily &quot;hack&quot; the packing dropdown is this way. Is there a way to secure this?  Question 2  For one product i want te customer to select the quantity 1 or a minimum of 10. So 2 - 9 have to be disabled. Is there a proper way to achieve this?  Question 3  When a customer selects quantity 1 the customer has to be restricted to the deluxe packing. For quantity 10 or higher the customer can select every packing method. Is it possible to have related dropdown selections?  I'm sorry for this many questions.  I'm looking forward to the answers!  Thanks!!")* was created by *[jannick](/forum/user/33157-jannick "View jannick's Profile")*

-- HikaShop version -- : HikaShop Business 2.6.4
-- Joomla version -- : 3.6.4
-- PHP version -- : 5.6.26
-- Browser(s) name and version -- : Chrome newest

Hi,

**Question 1**

I need the customer to be able to choose a packing: normal, luxe etc. Each packing has it's own price. I dont want to use the Characteristics because this will result in to many variations. I've created a custom dropdown field to achieve this option. This custom field is using the donation plugin of hikashop to calculate the new price for each product. This plugin comes with the following problem: the plugin uses the option value, when someone changes the value in the html, this value wil be used. The customer can easily "hack" the packing dropdown is this way. Is there a way to secure this?

**Question 2**

For one product i want te customer to select the quantity 1 or a minimum of 10. So 2 - 9 have to be disabled. Is there a proper way to achieve this?

**Question 3**

When a customer selects quantity 1 the customer has to be restricted to the deluxe packing. For quantity 10 or higher the customer can select every packing method. Is it possible to have related dropdown selections?

I'm sorry for this many questions.

I'm looking forward to the answers!

Thanks!!

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

10 years 2 weeks ago [\#255269](#255269) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[custom field with price](/forum/27-checkout/887480-custom-field-with-price#255269 "-- HikaShop version -- : HikaShop Business 2.6.4 -- Joomla version -- : 3.6.4 -- PHP version -- : 5.6.26 -- Browser(s) name and version -- : Chrome newest  Hi,  Question 1  I need the customer to be able to choose a packing: normal, luxe etc. Each packing has it's own price. I dont want to use the Characteristics because this will result in to many variations. I've created a custom dropdown field to achieve this option. This custom field is using the donation plugin of hikashop to calculate the new price for each product. This plugin comes with the following problem: the plugin uses the option value, when someone changes the value in the html, this value wil be used. The customer can easily &quot;hack&quot; the packing dropdown is this way. Is there a way to secure this?  Question 2  For one product i want te customer to select the quantity 1 or a minimum of 10. So 2 - 9 have to be disabled. Is there a proper way to achieve this?  Question 3  When a customer selects quantity 1 the customer has to be restricted to the deluxe packing. For quantity 10 or higher the customer can select every packing method. Is it possible to have related dropdown selections?  I'm sorry for this many questions.  I'm looking forward to the answers!  Thanks!!")*

Hi,

1. If you know a bit of PHP it's easy to change the plugin to avoid that.
For example, instead of directly using the value like the plugin does now with the code: Code:

switch($taxes){ case 2: $product-&gt;prices[$k]-&gt;price_value = $currencyClass-&gt;getUntaxedPrice(hikashop_toFloat($product-&gt;$column),hikashop_getZone(),$product-&gt;product_tax_id); $product-&gt;prices[$k]-&gt;taxes=$currencyClass-&gt;taxRates; $product-&gt;prices[$k]-&gt;price_value_with_tax = hikashop_toFloat($product-&gt;$column); break; case 1: $product-&gt;prices[$k]-&gt;price_value = hikashop_toFloat($product-&gt;$column); $product-&gt;prices[$k]-&gt;price_value_with_tax = $currencyClass-&gt;getTaxedPrice(hikashop_toFloat($product-&gt;$column),hikashop_getZone(),$product-&gt;product_tax_id); $product-&gt;prices[$k]-&gt;taxes=$currencyClass-&gt;taxRates; break; case 0: default: $product-&gt;prices[$k]-&gt;price_value = hikashop_toFloat($product-&gt;$column); $product-&gt;prices[$k]-&gt;price_value_with_tax = hikashop_toFloat($product-&gt;$column); break; }

, you could do it like that: Code:

switch($product-&gt;$column){ case 'first': $value = 18.99; break; case 'second': default: $value = 28.99; break; } switch($taxes){ case 2: $product-&gt;prices[$k]-&gt;price_value = $currencyClass-&gt;getUntaxedPrice(hikashop_toFloat($value),hikashop_getZone(),$product-&gt;product_tax_id); $product-&gt;prices[$k]-&gt;taxes=$currencyClass-&gt;taxRates; $product-&gt;prices[$k]-&gt;price_value_with_tax = hikashop_toFloat($value); break; case 1: $product-&gt;prices[$k]-&gt;price_value = hikashop_toFloat($value); $product-&gt;prices[$k]-&gt;price_value_with_tax = $currencyClass-&gt;getTaxedPrice(hikashop_toFloat($value),hikashop_getZone(),$product-&gt;product_tax_id); $product-&gt;prices[$k]-&gt;taxes=$currencyClass-&gt;taxRates; break; case 0: default: $product-&gt;prices[$k]-&gt;price_value = hikashop_toFloat($value); $product-&gt;prices[$k]-&gt;price_value_with_tax = hikashop_toFloat($value); break; }

And thus, that would only allow the values "first" and "second" in the custom field for the override of the price of the product.

2. and 3. If the avalailable choices have to be tied to the quantity selected, I would recommend to also use a custom item field for the selection of the quantity (and turn off the display of the quantity input field in the HikaShop configuration) and use the "display limited to" setting of your custom fields in order to display different fields based on what is selected in the first one. Then, in your price override (donation) plugin, you can take the custom fields values and based on them, set the price you want for the product.

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

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

Less More

- Posts: 26
- Thank you received: 1
-
-

10 years 2 weeks ago [\#255275](#255275) by [jannick](/forum/user/33157-jannick "View jannick's Profile")  Replied by *[jannick](/forum/user/33157-jannick "View jannick's Profile")* on topic *[custom field with price](/forum/27-checkout/887480-custom-field-with-price#255275 "-- HikaShop version -- : HikaShop Business 2.6.4 -- Joomla version -- : 3.6.4 -- PHP version -- : 5.6.26 -- Browser(s) name and version -- : Chrome newest  Hi,  Question 1  I need the customer to be able to choose a packing: normal, luxe etc. Each packing has it's own price. I dont want to use the Characteristics because this will result in to many variations. I've created a custom dropdown field to achieve this option. This custom field is using the donation plugin of hikashop to calculate the new price for each product. This plugin comes with the following problem: the plugin uses the option value, when someone changes the value in the html, this value wil be used. The customer can easily &quot;hack&quot; the packing dropdown is this way. Is there a way to secure this?  Question 2  For one product i want te customer to select the quantity 1 or a minimum of 10. So 2 - 9 have to be disabled. Is there a proper way to achieve this?  Question 3  When a customer selects quantity 1 the customer has to be restricted to the deluxe packing. For quantity 10 or higher the customer can select every packing method. Is it possible to have related dropdown selections?  I'm sorry for this many questions.  I'm looking forward to the answers!  Thanks!!")*

Hi Nicolas,

Thanks for the response!

I actually dont want the hard coded price solution but if this is the most easy way to acomplish the wanted result i will do it this way.

Thanks!

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

10 years 1 week ago [\#255277](#255277) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[custom field with price](/forum/27-checkout/887480-custom-field-with-price#255277 "-- HikaShop version -- : HikaShop Business 2.6.4 -- Joomla version -- : 3.6.4 -- PHP version -- : 5.6.26 -- Browser(s) name and version -- : Chrome newest  Hi,  Question 1  I need the customer to be able to choose a packing: normal, luxe etc. Each packing has it's own price. I dont want to use the Characteristics because this will result in to many variations. I've created a custom dropdown field to achieve this option. This custom field is using the donation plugin of hikashop to calculate the new price for each product. This plugin comes with the following problem: the plugin uses the option value, when someone changes the value in the html, this value wil be used. The customer can easily &quot;hack&quot; the packing dropdown is this way. Is there a way to secure this?  Question 2  For one product i want te customer to select the quantity 1 or a minimum of 10. So 2 - 9 have to be disabled. Is there a proper way to achieve this?  Question 3  When a customer selects quantity 1 the customer has to be restricted to the deluxe packing. For quantity 10 or higher the customer can select every packing method. Is it possible to have related dropdown selections?  I'm sorry for this many questions.  I'm looking forward to the answers!  Thanks!!")*

Hi,

You can always create custom product fields to enter the prices in the product and have the plugin uses these instead of hard coding them in the plugin.

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

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