Custom button linked to action metafield file

Hi i need help with the following button

I added this button on a custom product template.

the code is :

Download Now

However i need the button to action a free instant download when clicked, linked to my metafile i created product.metafields.custom.printable_button

every product has a different download file in the metafile section.

unsure how to do this

i dont want a link it needs to be a button they press

Please help

Hi @elfboss

Please refer to the below code update with your exsisting hopefully you will understand you just need to call the metafieldkey in the given code.


Download Now

Thanks

Hi i tried adding this new code you recommended and it didn’t work button when clicked does no command. Can you confirm where this should be put?

Download Now

@elfboss

No worries just let me know if i can fix it for you

Thanks

Yes i would love assistance. As my previous reply

@elfboss

Do you want me to fix this? for you ?

Thanks

yes please

Hi are you still able to help

Its all ok. i fixed it myself

Hi, can I ask how you fixed it? I want to achieve the same thing.

1 Like