How can I limit quantity for a buy button redemption?

heavysoundlabs
New Member
5 0 0

Hi,

We are using a buy button in our webapp to allow users to redeem points in our community for a $0 tshirt that is only available through a buy button which we display if they have enough points. 

Fix I am trying to make is making sure that users only order one tshirt. I found apps that limit order quantities for a product, but I read that those plugins don't work for buy buttons. 

Anyone have a fix for my problem here?

Replies 3 (3)

OliUK
Shopify Partner
234 2 48

Hi @heavysoundlabs ,

I had a think about this and nothing obvious came to mind, but I do have one idea...

The issue as I see it is that you could hide the quantity button, but the customer would always be able to increase the quantity at the cart level.

Have you considered hiding the product from all collections and then using a constructed payment URL instead? There's a type of payment URL that locks in the order quantity and only displays the checkout page. This is how it's constructed:

'https://shopwebsite.com/cart/' + variant id + ':' + quantity

So, an example could be:

https://thebeststore.com/cart/31917583734253:1

You could then include this in an email or even create a 'fake' buy button linking to it, just for the product in question.

 

Cheers,

Oli

 

——————————

Founder @ www.preproduct.io

Test and make sales for future products

 

 

HF23
Visitor
1 0 0

@heavysoundlabs 
@RichAP 

Only being able to display the inventory_quantity inside embedded product elements might be sufficient. 

I tried embedding 
{{ product.variants.first.inventory_quantity }}

(different for each theme, might be 

{{ current_variant.inventory_quantity }}
in others)

into 
{{ product.description  }}
since I can display the product description in the Shopify Buy Button code.
but just couldnt find the right spot in the code.

@OliUK : Is any of this possible? Do you have an idea of storing inventory_quantity in a way that can be displayed externally within Shopify Buy Button widget? e.g. find a way to insert it into product description?

If so:
Even if Users are dumb enough to set an amount higher than the one being displayed, the payment pop-up corrects the set quantity. Meaning if I have only 11 in stock but i check out with 12 in my cart, i get an error message (which can be edited in shop > theme > standard theme texts editor) and the set amount corrected to the max available amount 11. With one more click the user can continue with the corrected amount or is able to close the payment window and reselect with different amount or product. This would still suck if its not possible to display inventory_quantity though.

resources:
https://github.com/Shopify/buy-button-js/blob/master/docs/configuration/index.html
https://shopify.github.io/buy-button-js/customization/

RichAP
Tourist
8 1 3

I tried the above Limit Quantity Purchase by Magecomp and according to their support team, it does NOT work with Shopify Buy Buttons. Wasted about 2 hours trying to get it to work.