Allow customer to select quantity?

Created on 10 February 2022, almost 3 years ago
Updated 29 August 2024, 3 months ago

Is it possible to allow a customer to select a quantity and have that multiply the price of the product SKU they have chosen?

For example, I would like to allow customers to sign up for a dinner event, and to allow them to sign up their friends. I only need the customer's info (the webform fields); I do not need the friends' info. However, each person's admission must be paid via the webform.

If an admission costs $20, and the customer is signup up themselves and 2 guests, I need for them to be charged $60 (preferably by way of providing a Quantity: 3 input.

πŸ’¬ Support request
Status

Active

Version

3.1

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States hockey2112

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • First commit to issue fork.
  • πŸ‡ΊπŸ‡ΈUnited States joshuasosa

    I would like this ability as well. I would think it should be built-in that if a number field is used, the price attached to the field should automatically multiply by the number entered. Or add a checkbox to enable that capability.

    As it is, the only thing I could see is the suggestion to custom code an order item event per #3256022: Number field Price multiply from user input? β†’ .

  • πŸ‡ΊπŸ‡ΈUnited States joshuasosa

    joshuasosa β†’ changed the visibility of the branch 3263728-allow-customer-to to hidden.

  • πŸ‡­πŸ‡ΊHungary nagy.balint

    I think this will require more conception, as currently we can freely define many different price fields (checkboxes, radios etc).

    Maybe we could define the mapping on the handler, to set which webform component holds the quantity and also which one should be multiplied.

  • πŸ‡ΊπŸ‡ΈUnited States joshuasosa

    With a field of type Number, I'm not sure what the current purpose of it is when adding a price to it. A user is presented the open number field to enter their own number, and the price just adds a singular value to the total. My thought would be to multiply number field by default. But of course, there could be some scenario where someone needs it as-is.

    I would propose a checkbox to enable multiply on certain fields, at least on the Number field. I can imagine a dropdown being useful to select a number instead of having an open number field but can't guarantee the values of the dropdown options are numeric to be able to multiply by.

    I'm not sure multiply is needed on radios or checkboxes.

    A handler could be ok if it can show the breakout of quantity multiplied by cost on the checkout page.

  • πŸ‡­πŸ‡ΊHungary nagy.balint

    So if I understand correctly, we could have a checkbox on the handler config.
    If that is checked then it will multiply any number component with the related price.

  • πŸ‡ΊπŸ‡ΈUnited States joshuasosa

    Something like that could work. Really anything to try would be better than nothing.

Production build 0.71.5 2024