Re: Move metafield on the right of price

Solved

How can I relocate and apply color to a metafield on my product page?

stefanensko
Explorer
47 0 7

Hi all, i'm trying to move €/capsula (one line text metafield) to the right of the price on product page and maybe apply it a different color brackground (only the metafield background)

 

stefanensko_0-1701266257627.png

https://oj8br0e8p32n1pzu-57179668671.shopifypreview.com

site preview search adagio and u will land on that page

Accepted Solution (1)
Dan-From-Ryviu
Shopify Partner
9668 1936 1971

This is an accepted solution.

Please try to update code like this

{% if template.name == 'product' %}
{{ product.metafields.custom._capsulaprezzo }}
{% endif %}

- Helpful? Like and Accept solution! Support me! Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

View solution in original post

Replies 12 (12)

clavilla57
Explorer
92 0 16

anyone?

Dan-From-Ryviu
Shopify Partner
9668 1936 1971

Hi @clavilla57 

Please move that minefield code to price.liquid file before this line of code

{%- if show_badges -%}

 

- Helpful? Like and Accept solution! Support me! Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

clavilla57
Explorer
92 0 16

yeah i know i'm noob, but its been a long time from my last work on liquid..so how to move it?😅

Dan-From-Ryviu
Shopify Partner
9668 1936 1971

Did you add that metafield code in main-product.liquid file, go there and find that code, cut that code and paste it into price.liquid file

- Helpful? Like and Accept solution! Support me! Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

Dan-From-Ryviu
Shopify Partner
9668 1936 1971

Ahh, you added that meta field in Text block in Product information. Please remove it and then call that code to price.liquid file 

- Helpful? Like and Accept solution! Support me! Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

clavilla57
Explorer
92 0 16

Done it this way

{{ product.metafields.custom._capsulaprezzo }}

now the problem are 2

 

1. It also appear on collection page

2. on product page it's not aligned to the price

 

This is what i'm trying to reach

 

Screenshot 2023-11-28 173649.png

Dan-From-Ryviu
Shopify Partner
9668 1936 1971

Please update the code to this so it will appear on the product only

{% if template == 'product' %}
{{ product.metafields.custom._capsulaprezzo }}
{% endif %}

And add this CSS code to make it align with the price

.product__info-container .price { display: flex; align-items: center; }

- Helpful? Like and Accept solution! Support me! Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

clavilla57
Explorer
92 0 16

by doing this (the first code) metafield disappear

Dan-From-Ryviu
Shopify Partner
9668 1936 1971

This is an accepted solution.

Please try to update code like this

{% if template.name == 'product' %}
{{ product.metafields.custom._capsulaprezzo }}
{% endif %}

- Helpful? Like and Accept solution! Support me! Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

clavilla57
Explorer
92 0 16

ok now i can see it on the product page correctly. i just need to resize it and move it to the right 

 

Immagine (3).png

Dan-From-Ryviu
Shopify Partner
9668 1936 1971

Please update this code 

#shopify-section-template--20214060843353__main .product__info-container .price {
    display: flex;
    align-items: center;
}

To this 

#shopify-section-template--20214060843353__main .product__info-container .price {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

- Helpful? Like and Accept solution! Support me! Buy me coffee
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Ryviu: Aliexpress Reviews - AliExpress Reviews Importer, one-click import aliexpress reviews, export reviews to CSV file.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

clavilla57
Explorer
92 0 16


i've changed css of product information, like this

 

 

 

.product__info-container .price {
  display: flex;
  align-items: center;
  justify-content: space-between;
}