• Resolved cybokron

    (@cybokron)


    Hello,

    I created 1 form. 1 dropdown (A Product, B Product) and 1 Quantity field (Single text)

    How do I get the sum of both the B product quantities fields?

    For example:

    [gravitywp_count formid=”24″ filter_field2=’11’ filter_value2=’B Product’ filter_field2=’18’ filter_value2=’18’]

    Form ID: 24
    Product Name Dropdown ID: 11
    Quantity Single Text box ID: 18

    Number or logical Single Text box make sense? Which box is healthier to use?
    How should I create it?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author GravityWP

    (@gravitywp)

    Hi @cybokron

    Do you have an example form for us to have a look. I see that in your shortcode you use filter_field2 en filter_value2 twice, so that won’t work.

    Thread Starter cybokron

    (@cybokron)

    [gravitywp_count formid=”24″ filter_field2=’11’ filter_value2=’B Product’ filter_field3=’18’ filter_value3=’18’]

    Form ID: 24
    Product Name Dropdown ID: 11
    Quantity Single Text box ID: 18

    Example these.

    STEP:

    First, chooses 1 product from the dropdown. Second, entering how many quantities there in the textbox.

    DEMO:
    https://www.dropbox.com/s/bra2r5usjnc0rue/2021-04-10_01-08-21.jpg?dl=0

    1 product selected in product name is entered 5 times. I want to get the sum of the quantity of this product.

    For example 3 same product entries:

    B Product = Quantity 1000
    B Product = Quantity 500
    B Product = Quantity 10

    Total B Product Quantity= 1060

    How do I get this quantity total?

    FIELD IDS:

    Form ID: 24
    Product Name Dropdown ID: 11
    Quantity Single Text box ID: 18

    Thread Starter cybokron

    (@cybokron)

    I’m waiting for your answer. Thanks.

    Thread Starter cybokron

    (@cybokron)

    Does anyone know?

    Plugin Author GravityWP

    (@gravitywp)

    Still not sure if I fully understand what you are trying to achieve, but this might be what you are looking for:
    [gravitywp_count formid=”24″ number_field=”18″ filter_field2=”11″ filter_value2=”B Product”]

    The number_field parameter represents the field being totalled. It also works on text fields, but note that numbers with invalid format will be ignored. Better is to use a number field. The filter_field parameter enables you to select a subset of all entries.

    Plugin Author GravityWP

    (@gravitywp)

    I noticed the quotes are being changed by this forum. Maybe this works better: [gravitywp_count formid="24" number_field="18" filter_field2="11" filter_value2="B Product"]

    Otherwise be sure to change them when you copy/paste

    Thread Starter cybokron

    (@cybokron)

    Working. Thanks.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Count of single text field (Quantity)’ is closed to new replies.