Liquid, JavaScript, themes, sales channels
Hi,
We need to adjust our theme's product template to include the product title at the end of a button's URL. The button links out to an external form and we want to pass the product title into the form, and have that product title change based on which product detail page the customer is on.
I've tried adding product.title to the end of the URL, inside the quotes (following the format I see in other places in the template where product info is referenced), but get the error:
Code example is below from our product json template:
"db3e4b3f-a90f-4e06-96c2-247072ce9d75": {
"type": "button",
"settings": {
"text": "Learn More",
"url": "https:\/\/forms.zohopublic.com\/ourcompany\/form\/InquiryForm\/formperma\/_131?topic={{ product.title }}",
"btn_style": "solid",
"icon": "none",
}
},
I'm not sure how to add this dynamic URL parameter, any help would be appreciated. Thank you!
Solved! Go to the solution
This is an accepted solution.
You can use theme customise option and use metafield as URL.
This is an accepted solution.
You can use theme customise option and use metafield as URL.
Thanks, I did end up using a metafield solution even though it means more to manage on each product.
User | RANK |
---|---|
36 | |
27 | |
14 | |
13 | |
9 |
Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023