Amazon clone using react question

Guys, thx for the awesome tutorial, I have followed it but have encountered a problem. When I click the ‘ok’ button, metamask window doesn’t pop-up to complete the transfer…did it exactly the way shown in the tutorial, the only difference is that am using Polygon mainnet instead o Mumbai testnet. Here is the code from purchase.js file.

type or  const handleOk = async () => {
   // Get The Price of MATIC

   const options = {
     address: '0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0',
     chain: 'eth',
   }
   const price = await Moralis.Web3API.token.getTokenPrice(options)
   const priceMatic = book.price / price.usdPrice

   // Send Matic to book store owner address

   const options1 = {
     type: 'native',
     amount: Moralis.Units.ETH(priceMatic),
     receiver: '0xf6aE1d525c27Dd2fd4Fc71ce56a7e10Eb71d2***',
   }
   let result = await Moralis.transfer(options1)paste code here

in the VS code, “let result” part is underlined, saying the variable is defined but never used…maybe it is related to the problem am having? Any ideas what might be wrong?

Thanks in advance

you may need to use Moralis.enableWeb3() before running that Moralis.transfer

Thanks for reply, Sir

That was not mentioned in the tutorial at all:(

So, you mean before typing ‘let result = await Moralis.transfer(options1)’, I need to to write ‘await Moralis.transfer’? where to put that exactly at? and how to put it properly? in a “let” variable again?

Thx

I wanted to say to use Moralis.enableWeb3()

you can also look in your browser console to see if there are any errors

well, don’t know exactly how to use Moralis.enableWeb3() but I will search more on it. Thx for reply. It’s strange in the tutorial dude didn’t mention or use any Moralis.enableWeb3() but it worked fine for him)))

you only have to write that line with await, like: await Moralis.enableWeb3() and that is all

Okay, Thanks again:)

let result = await Moralis.enableWeb3().Moralis.transfer(options1)

like this? haha, didn’t work out…

no, different line, not on same line

If different lines, both with “let result” or second one need to define a new variable like “let bububu = await Moralis.enableWeb3()” ?

however you want to do it, you can test both cases

didn’t fix the issue… but thanks for your time man, appreciate it.

I am having issues with listing products above $100 on the Amazon boilerplate…it won’t be displayed. What should I do to kill this bug???