Auto add extra amount on Custom Field

  • Posts: 11
  • Thank you received: 0
5 years 3 months ago #301976

-- HikaShop version -- : 4.0.1
-- Joomla version -- : 3.9.1
-- PHP version -- : 7.2.1
-- Browser(s) name and version -- : Firefox 64.0

LS,

I have created a product page with two custom fields("Te borduren tekst" and "Extra tekst") as can be seen in the attachement.
All is working well except that I would like to automatically add an amount on top of the price when the second custom field "Extra tekst" is used.

So if only the custom field "" is used the price remains €15,00. When the second custom field "Extra tekst" is used, €4,00 should be added to the price. So total should read €19,00

How can this be accomplished or is there an other way to do this.
Please advice.

With regards
Webdexter

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
5 years 3 months ago #301982

Hi,

If you want to do that with a custom item field, you'll have to develop a plugin to do that.
We actually have many "shop custom" plugins that change the price of the product based on custom fields on our marketplace:
www.hikashop.com/marketplace/category/39-products.html
For example, this one www.hikashop.com/marketplace/product/221...quantity-plugin.html multiply the price of the product by the number entered in a custom field.
If you know a bit of programing you can easily modify that plugin for your needs.

However, HikaShop has an options system which is made especially to be able to add an amount to the price of a product when the option is selected, so I would rather recommand using that:
demo.hikashop.com/index.php/en/hikashop/...ct-page/with-options
www.hikashop.com/support/documentation/i...ct-form.html#options

Please Log in or Create an account to join the conversation.

  • Posts: 11
  • Thank you received: 0
5 years 3 months ago #301990

Hello Nicolas,

Thank you for your answer. I have looked at "options" but I see no way to create an option and have a free text field where the client can put a random string into the textbox when the option is selected. Is there a way I don't know off?

Regards
Webdexter

Last edit: 5 years 3 months ago by Webdexter.

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
5 years 3 months ago #301994

Hi,

I didn't understand that there was a dependence between your custom fields.
It's indeed not possible to do that with an option (unless you add custom javascript code to hide/display the input field of the custom field when the option dropdown is changed).
Again, it's not particularily difficult to do if you know a bit about programming:
stackoverflow.com/a/16016019/6390007
However, in that case, I would rather recommend the plugin solution I was talking about at the beginning of my previous message. It will be simpler.

Please Log in or Create an account to join the conversation.

Time to create page: 0.049 seconds
Powered by Kunena Forum