How to minus only 1 from the stock

  • peterallankelly
    Asked on July 2, 2024 at 7:41 PM

    Hi, The form I am trying to make us for our church camp registration. Two of the overnight options we have are for a cabin and retreat rooms. There are 6 cabins in total,

    There are 6 retreat rooms in total

    What we want to do is when people pick either a cabin or retreat room depending on how many they pick (for example 3 people) we only want to minus 1 from the stock and the issue we keep running into is that it keeps taking away 3 from the total stock not 1 so then we keep running into problems.


    Ive added the form condition but now its not adding up my final amount at the bottom. Can you please help me? Is there something else I need to do?


  • Jessica JotForm Support
    Replied on July 2, 2024 at 11:31 PM

    Hi peterallankelly,

    Thanks for reaching out to Jotform Support. After checking your form, it looks like your form is using Product List element. When using Product List element, when a product is selected, it will only deduct 1 stock from the product rather than 2 or more. But if the user select 2 product, then both of the product will deduct 1 stock. Additionally, the total will appear as the selected product. I see that it is working without any issue.

    Could you explain to us more on how you would like the form to work? For example, would you like the calculation to be "Number of people in retreat room" multiple by the price of Retreat Room or Cabin?

    Once we heard back from you, we'll be able to help you with it.

  • peterallankelly
    Replied on July 2, 2024 at 11:46 PM

    Thank you,

    Yes that's what I would like to do because right now the final total does not add up at the bottom. I want the calculation to be for example as you said "Number of people in retreat room" multiplied by the price of Retreat Room or Cabin. Can you help me with that?

    Thanks,

    Peter

  • Jessica JotForm Support
    Replied on July 3, 2024 at 12:05 AM

    Hi peterallankelly,

    We’ll need a bit of time to look into this. We'll get back to you as soon as we can.

    We appreciate your patience and understanding in this.

  • Peter
    Replied on July 3, 2024 at 1:02 AM

    Thanks, I look forward to hearing back.

  • peterallankelly
    Replied on July 3, 2024 at 7:44 AM

    Hi, just wondering if you were able to come up with a solution solution?

  • peterallankelly
    Replied on July 3, 2024 at 9:47 PM

    Hi, just wondering if there’s been any progress made on this?

  • Jessica JotForm Support
    Replied on July 3, 2024 at 10:20 PM

    Hi peterallankelly,

    Thank you for your patience as we look into this. It's not possible to do calculate outside field times the product within Product List. However, there is a workaround by using the following to achieve that:

    1. Inventory widget for stock control
    2. Form calculation to calculate the total amount
    3. Pass the calculated value to payment integration to process the payment.

    You can check on this demo form that I have created, and you can also clone the demo form to check on the form's setting.

    How to minus only 1 from the stock Image 1 Screenshot 20

    If this suit what you are looking for, please let us know through this thread, and we'll also be happy to provide step-by-step guide for you.

    Let us know if you need more help.

  • peterallankelly
    Replied on July 3, 2024 at 10:46 PM

    Yes, that seems to be what i'm looking for. Can you please provide a step-by-step guide for me to do this.

    Thanks,

    Peter

  • peterallankelly
    Replied on July 3, 2024 at 11:19 PM

    There seems to be an issue with the calculation for the cabin on my end. It doesn't seem to be adding up. Can you take a look? It works for the retreat room but not for the cabin.

    We would also like to have a selection for day time guests and for people wanting to tent. Would I just need to repeat the steps with what was done for the cabins and the retreat room?

  • Jessica JotForm Support
    Replied on July 3, 2024 at 11:30 PM

    Hi peterallankelly,

    Let me guide you step-by steps on how to setup this form:

    First, we'll need to add and configure Inventory widget:

    1. In Form Builder, click on Add Form Element+.
    2. Click on Widget tab.
    3. Type Inventory in search tab.
    4. Click or drag and drop to add it to your form.
      How to minus only 1 from the stock Image 1 Screenshot 140
    5. The widget setting will appear on the right side of your screen. Configure as the following:
    6. Description: Retreat room or Cabin
    7. Available Quantity: According to your preferences
    8. Quantity Range: 0-1
    9. Then, click on Update Widget. You can repeat the same for the other Inventory's widget.
      How to minus only 1 from the stock Image 2 Screenshot 151

    Second, we'll need to add Number field and Conditional Logic Update/Calculate to calculate the total for each Retreat Room and Cabin:

    1. In Form Builder, click on Add Form Element+.
    2. Click on Basic tab.
    3. Scroll down to find Number.
    4. Click or drag and drop to add it to your form. 
    5. Repeat the process twice to add "Total for Retreat Room" and "Total for Cabin"
      How to minus only 1 from the stock Image 3 Screenshot 162
    6. Click on Settings on the top orange navigation bar.
    7. Click on Condition on the left sidebar.
    8. Click on Add Condition.
    9. Click on Update/Calculate Field.
      How to minus only 1 from the stock Image 4 Screenshot 173
    10. Add the following conditions:
      How to minus only 1 from the stock Image 5 Screenshot 184
    11. Click on Save.
    12. Repeat step 8 to 11 for another following conditions:
      How to minus only 1 from the stock Image 6 Screenshot 195

    You can delete the previous Condition Logic Show/Hide and add a new one:

    1. Select the previous Conditional Logic Show/Hide.
    2. Click on Delete on the toolbar to remove it.
      How to minus only 1 from the stock Image 7 Screenshot 206
    3. Click on Add Condition.
    4. Click on Show/Hide Field.
    5. Add the following condition:
      How to minus only 1 from the stock Image 8 Screenshot 217
    6. Click on Save.
    7. Repeat step 3 to 6 for another following conditions:
      How to minus only 1 from the stock Image 9 Screenshot 228

    Third, we'll need to add Form Calculation to calculate the grand total.

    1. In Form Builder, click on Add Form Element+.
    2. Click on Widget tab.
    3. Select or drag and drop Form Calculation to add into your form.
      How to minus only 1 from the stock Image 10 Screenshot 239
    4. In widget setting on the right, add the following formula:
      How to minus only 1 from the stock Image 11 Screenshot 2410
    5. Click on Save.

    Fourth, we'll need to pass the calculated value to payment integration.

    1. Click on your Product List element.
    2. Click on Wand icon.
    3. Your element's setting should appear on the right screen.
    4. Click on gear icon on the top-right.
    5. Select dropdown under Payment Type and choose User Defined Amount.
    6. Additional field of Get Price From should appear.
    7. Select dropdown under Get Price From and choose Form Calculation that was set previously.
    8. Then, reconnect your payment processor to complete the wizard.

    How to minus only 1 from the stock Image 12 Screenshot 2511

    Lastly, we can hide the unnecessary fields such as:

    • Total for Retreat Room
    • Total for Cabin
    • Form Calculation

    It's easy to do this, let me show you how:

    1. Right-click on the element you want to hide.
    2. Click on Hide, and you can repeat for the other field.

    How to minus only 1 from the stock Image 13 Screenshot 2612

    And that's it. The form should be working without an issue.

    Give it a try and let us know if you need more help.

  • Jessica JotForm Support
    Replied on July 3, 2024 at 11:33 PM

    Hi peterallankelly,

    Could you share with us the form URL that you are looking for so we can look into it for you? Additionally, if you need to add additional selection, you can repeat the steps for Retreat Room and Cabins.

    Once we heard back from you, we'll be able to help you with it.

 
Your Answer