A space to discuss online store customization, theme development, and Liquid templating.
Hi Experts,
I am customizing a Shopify 2.0 theme for the first time and trying first on the Dawn Theme.
I need to add a block to Main Product section to expose a "Rating Snipp" from a third party .
ON the old days we just add any code like bellow to product-template.liquid
<script>
......
</script>
Does anybody knows how to adapt this to Shopify 2.0 Themes ?
Thanks in advance
If the third party has a shopify app they should be encouraged to use app-blocks.
If it's a script,css , or html hook meant to be embedded use either a custom-liquid block or section in the product templates theme settings.
Or in some cases a dynamic source for and text input setting.
If it needs to be inside the buy buttons form for the dawn based themes you will have to add it to the respective area in main-product.liquid section.
If it needs to be a literal setting block you'll have to learn to implement them.
https://shopify.dev/docs/themes/architecture/sections
https://shopify.dev/docs/themes/architecture/sections/section-schema#blocks
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Hey @PaulNewton thanks a lot per response ...
The full code is some js operations and a code from a cdn
I will check docs links ... Thanks a lot
<script type="text/javascript">
window._trustvox = [];
_trustvox.push(['_storeId', 'ID-LOJA']);
_trustvox.push(['_productId', productId]);
_trustvox.push(['_productName', productName]);
_trustvox.push(['_productPhotos', [url.image]]);
</script>
<script async="true" type="text/javascript" src="//static.trustvox.com.br/sincero/sincero.js"></script>
Yes just add that to a custom-liquid block in the themes settings and test.
Good hunting.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org