Conditional custom field display

  • Posts: 63
  • Thank you received: 1
  • Hikashop Business
10 years 5 months ago #197111

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1
-- PHP version -- : 5.4
-- Browser(s) name and version -- : firefox 36.0.4

We are running an obstacle course race.
The purpose of the cart is for customers to buy places in the race.
A customer can book up to 10 places at once in a race.
We would like to capture the name (and ideally email address) of each runner.
I have created an 'Item' custom field for capturing the runner's name (singular).
What I would like to do now is to create 9 more custom fields, which will be used to record names of runners 2,3,4 ... depending on the number of 'entries' required. How can I make the display of a mandatory custom field be dependent on the number of items ordered?
If that's possible can that be extended to also include a 'runner's email' field.
Look forward to hearing form you.
Mike

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

  • Posts: 84304
  • Thank you received: 13698
  • MODERATOR
10 years 5 months ago #197116

Hi,

There is no option to dynamically display the fields based on the quantity since the fields are displayed before the quantity.
What you can do however is to have only one field and remove the display of the quantity field with the option "Display the quantity field on the product page" of the HikaShop configuration.
That way, the customers will have to add the product one by one to his cart, and each time, he will be able to enter one name (and potentially one email).
That would also allow you to easily get the list of all the names and emails when exporting the orders in the backend as they will all be in one column in the CSV.

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

  • Posts: 63
  • Thank you received: 1
  • Hikashop Business
10 years 5 months ago #197536

Nicolas

Thank you.

I have implemented your suggestion, which seems to work OK with a bit of extra signposting.

I note that when the customer gets to the Cart that the Qty function now reappears. is it possible to turn it off at this stage as well?

Kind regards

Mike

Last edit: 10 years 5 months ago by mikekiy.

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

  • Posts: 12953
  • Thank you received: 1778
10 years 5 months ago #197559

Hello,
Are you talking about your cart module quantity field ? If that's the case, note that you can directly remove that field by using the "Show quantities in the cart" option of your HIkashop cart module configuration page

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

Time to create page: 0.059 seconds
Powered by Kunena Forum