Categories
Development

PayPal Buy Now add quantity with HTML

I was working on a project where PayPal Buy Now buttons were being generated by a widget and not allowing the quantity option to be used when a user was making a purchase. PayPal’s button generator does easily allow for quantities to be enabled with simple click, but this wasn’t an option for me in this case.

It was fairly difficult finding the tag to add to enable quantity on checkout, so I figured I’d share in case someone else ran into the same issue. Official documentation was eventually found.

It’s a very basic input that must be included with the form:

<input type="hidden" name="undefined_quantity" value="1">

<input type=”hidden” name=”undefined_quantity” value=”1″>

That’s all, just include that with the form and you’re all set.

3 replies on “PayPal Buy Now add quantity with HTML”

Hi,

Can you give me any advise as to where to add your code to my ‘add to cart’ below to allow the customer to add the quantity of rope required. Thanks, Colm.

Please select option
10mm 3 Strand Navy Nylon €1.50
12mm 3 Strand Navy Nylon €1.99
14mm 3 Strand Navy Nylon €2.66 (Out of Stock)

This is weird. There is an option to add hidden fields, such as undefined_quantity, in PayPal’s button generator, but it does not seem to work.

I added that field in step 3 where you can define advanced variables. Yet they do not appear.

Sometime I think it is easier to use the generator at PayPal, then add in those little tidbits. It may not be right, but heck, it works.

Thanks for the snippet, it opened my eyes.

Leave a Reply

Your email address will not be published. Required fields are marked *