0

I've got the following product form tag for adding multiple items (Donations) to a cart but can't figure out how to allow the user to input the price.

    {exp:store:product_form}
    {exp:channel:entries channel="{donation_channel}" dynamic="no"}
        {exp:store:product entry_id="{entry_id}" disable_form="yes" }

            <input type="hidden" name="items[{count}][entry_id]" value="{entry_id}" />

            <label class="field_label" for="price">{donation-description}
            <input type="text" name="items[{count}][item_qty]" value="" />
            </label>

            {/exp:store:product}
        {/exp:channel:entries}

           <input type="submit" name="submit" value="Make Donation" class="button expand" />

{/exp:store:product_form}

1 Answer 1

1

You need to add a price input for each item.

<input type="text" name="items[{count}][price]" value="" />

And of course you need the Store field for that channel set to allow user prices.

3
  • Thanks Derek. Store field {donation-donation} is set to allow user prices. Added name="items[{count}][price]" to inputs but now not adding anything to cart.
    – MBM
    Commented Jan 19, 2015 at 19:52
  • You added a new input for the price, correct? Is your item_qty a separate input and a positive integer? Commented Jan 19, 2015 at 20:20
  • Ah now I'm with you Derek. added an input with price and all good. Just wondering I don't rurally want to show the quantity but I guess I have too. If I give it a value then all the donations get added with that qualtity.
    – MBM
    Commented Jan 19, 2015 at 20:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.