Add product Weight in featured collections in Express Theme

Solved
grubio
Tourist
21 0 1

I want to add the product weight in gr. next the product price.

I tried after reading another question by adding <p>{{ variant.weight }}</p> in featured -product.liquid, but didn't work.

Anyone knows how I can do it?

Thanks

0 Likes
JHKCreate
Shopify Partner
2479 426 581

Hi @grubio 

What theme are you using? Where did you paste the piece of code? Are you products variant dependent or just one version is available?

- Did we solve your issue? Like & Mark As Solution to help the community
- Should you need any direct help: contact@jhkcreate.com
0 Likes
grubio
Tourist
21 0 1

Hi @JHKCreate 

I'm using Express Theme.

Below  {% render 'product-price', variant: current_variant, product: product, show_vendor: section.settings.show_vendor %}

Only 1 version.

Thanks!

0 Likes
g33kgirl
Shopify Partner
211 51 63

Add this code:

{{ product.variants.first.weight | weight_with_unit }}
If you found my answer helpful, please LIKE and ACCEPT.
buymeacoffee.com/g33kgirl ☕
If you're not comfortable with code, please modify code files at your own risk.
Do NOT give out your passwords unless absolutely necessary.
0 Likes
grubio
Tourist
21 0 1

Hi @g33kgirl 

Thanks for your reply.

I added the snipped code in the same place and I cannot see the weight yet.

Section-> featured -product.liquid
Below -> {% render 'product-price', variant: current_variant, product: product, show_vendor: section.settings.show_vendor %}

Any other idea?

 

 

0 Likes
g33kgirl
Shopify Partner
211 51 63

@grubio,  that should have worked. Try this:

 

<p>{{ current_variant.weight }}</p>

 

 

If you found my answer helpful, please LIKE and ACCEPT.
buymeacoffee.com/g33kgirl ☕
If you're not comfortable with code, please modify code files at your own risk.
Do NOT give out your passwords unless absolutely necessary.
0 Likes
grubio
Tourist
21 0 1

Hi @g33kgirl 

It doesn't. I should do something wrong then.

Probably I'm not adding the code in the right place

Screenshot 2021-04-28 at 20.19.52.pngScreenshot 2021-04-28 at 20.22.33.png

0 Likes
g33kgirl
Shopify Partner
211 51 63

I installed the Express Theme on my development store and it shows the weight on featured-product section on homepage:

Screenshot 2021-04-28 at 7.35.04 pm.png

Screenshot 2021-04-28 at 7.35.11 pm.png

 

Have you added the featured-product section component on your homepage?

If you found my answer helpful, please LIKE and ACCEPT.
buymeacoffee.com/g33kgirl ☕
If you're not comfortable with code, please modify code files at your own risk.
Do NOT give out your passwords unless absolutely necessary.
grubio
Tourist
21 0 1

Thanks @g33kgirl 

I don't see what I do wrong.

The code is the same in the same place:

Screenshot 2021-04-28 at 20.48.45.png

I have a weight for this product

Screenshot 2021-04-28 at 20.48.57.png

Which I can see in the product page (in kg, what I think this another issue)

Screenshot 2021-04-28 at 20.49.14.png

But in the featured collection

Screenshot 2021-04-28 at 20.49.23.png

I tried a different browser because the cache and on... and nothing. Doesn't work. 

Any idea?

Thanks a lot!!!!

0 Likes
g33kgirl
Shopify Partner
211 51 63

Are you adding this section to your homepage?

Screenshot 2021-04-28 at 10.58.25 pm.png

If you found my answer helpful, please LIKE and ACCEPT.
buymeacoffee.com/g33kgirl ☕
If you're not comfortable with code, please modify code files at your own risk.
Do NOT give out your passwords unless absolutely necessary.
0 Likes