How can I display a product description as a metafield?

Solved

How can I display a product description as a metafield?

JB_from_france
Shopify Partner
14 0 6

Hi,

Is there a way to put product description as metafield ? I would like to display description in an accordion. I success to add metafields but i don't find the right code to implement the product description.

Thanks so much for help

Jb from France

Accepted Solution (1)
KetanKumar
Shopify Partner
37618 3670 12162

This is an accepted solution.

@JB_from_france 

oh no its not possible make it automation show metafiles main function each one different text but current store product description show to all 

If helpful then please Like and Accept Solution. Partnership of your ️ Coffee Tips and my code can bring miracles.
Want to modify or custom changes on store Hire Me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing

View solution in original post

Replies 15 (15)

KetanKumar
Shopify Partner
37618 3670 12162

@JB_from_france 

yes please read this article  and modification code

https://shopify.dev/api/liquid/objects/metafield

 

If helpful then please Like and Accept Solution. Partnership of your ️ Coffee Tips and my code can bring miracles.
Want to modify or custom changes on store Hire Me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
JB_from_france
Shopify Partner
14 0 6

Hi,

Thank you for your prompt answer ! I already read this article and i already succeed to implement custom metafields in my profuct page, etc..

I just don't find the right sequence to call description as metafield. I tried {{ product.metafields.product.description }}, {{ product.metafields.description }}, etc... But it doesn't work. 

I would like to automatically display the description of the viewed product in an accordion.

Thank you so much for your help !

JB from France

KetanKumar
Shopify Partner
37618 3670 12162

@JB_from_france 

your have create metafiled on option? please check this 

https://www.youtube.com/watch?v=IPgZuk7Z0SY 

If helpful then please Like and Accept Solution. Partnership of your ️ Coffee Tips and my code can bring miracles.
Want to modify or custom changes on store Hire Me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
JB_from_france
Shopify Partner
14 0 6

Hi,

So i can't display description as metafields automatically ? As vendor metafields or title metafields already displayable on the dawn theme ? I need to create custom metafields and copy/paste description of my +800 products to the custom metafields ?

There is really no way to display automatically the description of the product on a collapsible table on dawn theme ?

Thanks for your help ! 

JB from France

KetanKumar
Shopify Partner
37618 3670 12162

This is an accepted solution.

@JB_from_france 

oh no its not possible make it automation show metafiles main function each one different text but current store product description show to all 

If helpful then please Like and Accept Solution. Partnership of your ️ Coffee Tips and my code can bring miracles.
Want to modify or custom changes on store Hire Me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
CarlosPinedo
Tourist
5 0 2

hi JB, did you ever found the solution to displaying the product description inside an accordion?

KetanKumar
Shopify Partner
37618 3670 12162

@CarlosPinedo 

can you please share store url 

If helpful then please Like and Accept Solution. Partnership of your ️ Coffee Tips and my code can bring miracles.
Want to modify or custom changes on store Hire Me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
Cava
Excursionist
33 0 16

Hi! @JB_from_france 

Were you able to find a solution to this?
I'm having the same struggle too.

KetanKumar
Shopify Partner
37618 3670 12162

@Cava 

can you please share store url

If helpful then please Like and Accept Solution. Partnership of your ️ Coffee Tips and my code can bring miracles.
Want to modify or custom changes on store Hire Me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
Cava
Excursionist
33 0 16
KetanKumar
Shopify Partner
37618 3670 12162

@Cava 

thanks for url can you please share more details 

If helpful then please Like and Accept Solution. Partnership of your ️ Coffee Tips and my code can bring miracles.
Want to modify or custom changes on store Hire Me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing

pralinepanini
Tourist
15 0 2

I have just found a solution to this.

 

In the product template, click "add block" , then add the "description" block.

Once you have added this, click on it and it will show a few options for display style. Here you can select "expandable content - open" or "expandable content-closed".

This displays it as a single accordion.

If you then add a separate block of "expandable content" straight after it, they will display as connected and look like one accordion.

Hope this helps someone!

user96
Visitor
1 0 2

I solved this by adding custom liquid block to product template (through usual shopify UI), and then in custom liquid you add code for whatever block u want to achieve, I wanted collapsible row so I inspected collapsible row and presed copy element and put that into custom liquid (in the UI, not the code tab directly). Then I only had to replace line for text with product.description

joar
Tourist
3 0 5

Hey, trying to achieve the same thing. Can you show the code you used?

BH005
Visitor
1 0 0

Hey, I was facing the same issue, I want to put the description of each product in collapsable block without re-writing them in metafields.

 

So I ve created a collapsable block and named it "Description"

 

After that went to the main-product.liquid and add if statement to check if the heading of the collapsable block is "Description" then put the product description already existing :

 

{%- when 'collapsible_tab' -%}
<div class="product__accordion accordion quick-add-hidden" {{ block.shopify_attributes }}>
<details id="Details-{{ block.id }}-{{ section.id }}">
<summary>
<div class="summary__title">
{% render 'icon-accordion', icon: block.settings.icon %}
<h2 class="h4 accordion__title inline-richtext">
{{ block.settings.heading | default: block.settings.page.title | escape }}
</h2>
</div>
{% render 'icon-caret' %}
</summary>
<div class="accordion__content rte" id="ProductAccordion-{{ block.id }}-{{ section.id }}">
{% if block.settings.heading == 'Description' %}
{{ product.description }}
{% else %}
{{ block.settings.content }}
{{ block.settings.page.content }}
{% endif%}
</div>
</details>
</div>

 

I hope it will helps.