thirdweb-example / shopify-sell-nfts

Sell NFTs in FIAT currency using a Shopify store and webhooks!
17 stars 13 forks source link

Issue: <span> tags in NFT metadata #4

Open IamDushu opened 1 year ago

IamDushu commented 1 year ago

Problem: While setting the product information as the metadata for the NFT, the product information showcased in the NFT metadata is enclosed within span tags.

example:<span>This is Product Information being shown in NFT metadata</span>

IamDushu commented 1 year ago

Solution :

The issue lies in productQuery.body.product.body_html, this returns a string with <span> tags in it. which is then sent as a description. const metadata = { name: productQuery.body.product.title, description: productQuery.body.product.body_html, image: productQuery.body.product.image.src, };

Change description: productQuery.body.product.body_html to description: productQuery.body.product.body_html.replace("<span>", "").replace("</span>", ""),