PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Product Quantity not prepopulating correctly

  1. I have a hidden product field with the following parameter names:
    Name: ticket_name
    Price: ticket_price
    Quantity: ticket_quantity

    Name and price are prepopulating correctly, but no matter what I do with quantity, it doesn't catch. I've tried prepopulating through the function call:

    $prepopulate = array( 'ticket_quantity' => 6 );
    gravity_form(5, false, false, false, $prepopulate , false);

    And doing it through the field_value action:

    add_action('gform_field_value_ticket_quantity', 'sftpay_ticket_quantity');
    function sftpay_ticket_quantity($value) {
        return 6;

    But the form continues to output a value of 1 for the quantity:

    <input type="hidden" name="input_1.3" value="1" class="ginput_quantity_5_1 gform_hidden">
    <input type="hidden" name="input_1.1" value="The Musical" class="gform_hidden">
    <input name="input_1.2" id="ginput_base_price_5_1" type="hidden" value="$10.00" class="gform_hidden ginput_amount">

    Not sure if I'm missing something?

    Posted 10 years ago on Tuesday April 17, 2012 | Permalink
  2. No, you aren't missing anything. There is indeed a bug related to dynamically populating the quantity of a hidden Product Field via code and via the query string.

    The good news is we have already patched this bug in the latest build of Gravity Forms v1.6.4 which is currently a beta release. The patch will be included in the final Gravity Forms v1.6.4 release which will be coming this week.

    You also submitted this via Priority Support and I will reply to your Priority Support request and send you a copy of the Gravity Forms v1.6.4 beta build that has already corrected this bug.

    For anyone else encountering this bug, it is something that the final Gravity Forms v1.6.4 release will patch. It will be released via automatic update later this week.

    Posted 10 years ago on Tuesday April 17, 2012 | Permalink

This topic has been resolved and has been closed to new replies.