• Resolved jeroenroelofsen

    (@jeroenroelofsen)


    I have a subscription form for a dog show. So different sexe, different variaty and different classes.

    If I do a total count this works fine;
    [gravitywp_count formid=’5′ filter_field=”9″ filter_value=”Tervuerense”]

    And then when I want to select a bitches, this works fine as well;
    [gravitywp_count formid=’5′ filter_field=”9″ filter_value=”Tervuerense” filter_field2=”8″ filter_value2=”Teef”]

    But then, if I want to select al bitches in classe 5 open class it doesn’t work;
    [gravitywp_count formid=’5′ filter_field=”9″ filter_value=”Tervuerense” filter_field2=”8″ filter_value2=”Teef” filter_field3=”34″ filter_value3=”5 Open klasse (€ 45.00)”]

    The output gives 0, how ever I am 100% certain that there is at least 1 entry that matches the criterea.

    What goes wrong?

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

    (@gravitywp)

    Hi @jeroenroelofsen,

    It needs some more investigation. Our first guess is that the filter_value3 has some characters that maybe cause the problem, but we’re not sure. You could try yourself defining a more clean value for the filter choice (this is always good practice).

    Could you provide us with an export of the form (mail to [email protected] and add the link to this topic)? Than we can try it ourselves.

    Thread Starter jeroenroelofsen

    (@jeroenroelofsen)

    I tried a more simple value for this field allready. But it is a product field, so the price is added to the value in the database. I don’t think this can be over ruled.

    I did sent the json output to the mail.

    Plugin Author GravityWP

    (@gravitywp)

    Hi @jeroenroelofsen,

    Your observation about how the value is stored in the database is true and indeed also the cause of this problem as Count uses ‘is’ as search operator.

    Examples of the value in the database:
    2 Puppy klasse|2500
    5 Open klasse|4500

    It is still possible to count them, like this:

    [gravitywp_count formid='5' filter_field3="34" filter_value3="5 Open klasse|4500"]
    
    [gravitywp_count formid='5' filter_field3="34" filter_value3="2 Puppy klasse|2500"]

    Hope this helps, good luck!

    Thread Starter jeroenroelofsen

    (@jeroenroelofsen)

    Unfortunately this didn’t work either. Can it be because of it’s a product field? Is it possible to use wildcards (* %?)?

    Plugin Author GravityWP

    (@gravitywp)

    I tested it with the form-export you emailed us, and it did work for me.

    The productfield stores value + price in the database value, which is different from other fields. What you can do is look up how the values are stored in the entry_meta table and match these in the filter. If that doesn’t work I don’t have a quick solution, other than using another field type.

    Thread Starter jeroenroelofsen

    (@jeroenroelofsen)

    In the end I got it to work
    [gravitywp_count formid='5' filter_field="9" filter_value="Groenendaeler" filter_field2="8" filter_value2="Reu" filter_field3="34" filter_value3="1 Jongste pup|0"]

    Plugin Author GravityWP

    (@gravitywp)

    Hi @jeroenroelofsen

    Good to hear you got it working with the value + price combination as filter_value (value|price) in combination with other filters. Leave a review if you liked our support.

    And good luck with your dogs shows.
    Of in Nederlands, veel succes met je hondenshows!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘count price field’ is closed to new replies.