Re: Adding widget to a single product page

How to add a widget to a specific product page only?

Oneg
Tourist
35 0 2

hey, i added a widget from a review app, it appears in the page i want it to be in (different template than the other ones). But it also appears at the bottom of the other product pages, and the Products page, and Track Order page. I need it to go away from the other pages and stay only in that specific product page. I pasted the widget in theme.liquid line 315 (no reason, i just tried something)

 

Oneg_1-1700679048065.png

 

 

the only page i want it to be in: https://bedsights.com/products/ray-the-astronaut

password: nohphu

 

btw i want it to be before the related products, and the way i pasted the code doesn't allow it.

 

Thank you!

Replies 4 (4)

StephensWorld
Shopify Partner
1389 169 349

Hey Oneg,

 

You shouldn't be adding coding for the reviews app to the "theme.liquid" file -- that's the base of your site and effects all pages. In fact, you probably shouldn't be adding ANY coding to your theme's files to work with a reviews app. 

 

You should be adding the block/section via the theme editor instead (Admin > Online Store > Themes > Customize). 

 

And then if you only want to add it on a specific product page (not all product pages), then you'd want to create a custom product page template. 

 

https://help.shopify.com/en/manual/online-store/themes/theme-structure/templates

 

Once you've made the custom template, you can edit just that template, to have your reviews block/section on it. You'll also be able to drag-and-drop the reviews block/section to be above the related products. 

 

Then from there, you'd assign the custom template to only the products you want to use it. 

 

If you're having issues getting the reviews app to work without adding coding to the theme, then you should be able to reach out to Trustoo's support team directly (support@trustoo.io) and they'll be able to assist you. 

 

Hope the above points you in the right direction! 🙂

 

Cheers,

Stephen

★ Did my post help? If yes, then please like and accept solution. ★

https://stephens.world
support@stephensworld.ca

Oneg
Tourist
35 0 2

Hey, thank you for the reply!

 

Thing is, something's pretty weird about this widget - it doesn't show in the theme editor side menu ! which makes it impossible to drag and drop easily like you normally would.

 

About the template, I've already created a template specifically for the product i want to have the widget for.

But, when looking in the code editor, I found the template i created but i don't know what to do with it and where i should paste the code. It's a .json file. 

 

Any idea?

they couldn't help me in Trustoo.

StephensWorld
Shopify Partner
1389 169 349

My suggestions would be to use a different reviews app. 

 

I recommend Judge.Me (https://apps.shopify.com/judgeme). 

 

You shouldn't have to be messing around with any coding for this to work. 

★ Did my post help? If yes, then please like and accept solution. ★

https://stephens.world
support@stephensworld.ca

Peter_Canada
Excursionist
23 0 11

judgeme is asking me to add code to my templates/product.liquid and I haven't been able to find that specific location which is frustrating, even tho they provide a link.

 

Under {% section 'product-template' %}, add the following code: xxxxx

I don't have a "product-template" section in my liquid product code. ??