Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buy more than 1 nft per transaction #11

Open
DanOlise opened this issue Sep 21, 2021 · 3 comments
Open

Buy more than 1 nft per transaction #11

DanOlise opened this issue Sep 21, 2021 · 3 comments

Comments

@DanOlise
Copy link

Hi guys,

Does anyone know what changes are required to change the buy button section to allow the user to buy more than one nft at a time? The current set-up only allows 1 nft to be purchased per transaction

Thanks in advance

@iulianba
Copy link

iulianba commented Sep 21, 2021

Hello,

You can do this:

const [nft_quantity, setQuantity] = useState(1);

function checkQuantity(value) {
// here you can add some checks to not have values greater than your max mint amount. if everything is ok, call

setQuantity(value);
}

The actual input:

<input name="nft-quantity"
onChange={e => checkQuantity(e.target.value)}
value={nft_quantity}
/>

Mint button onClick action:

claimNFTs(nft_quantity);

Hope this helps you get an idea on how to achieve this.

@DanOlise
Copy link
Author

Thanks so much, will give this a try now.

@rrrrrrraaaaaaaaaaa
Copy link

Hello,

You can do this:

const [nft_quantity, setQuantity] = useState(1);

function checkQuantity(value) { // here you can add some checks to not have values greater than your max mint amount. if everything is ok, call

setQuantity(value); }

The actual input:

<input name="nft-quantity" onChange={e => checkQuantity(e.target.value)} value={nft_quantity} />

Mint button onClick action:

claimNFTs(nft_quantity);

Hope this helps you get an idea on how to achieve this.

Hey, could you please explain more in detail?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants