PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, May 9, 2022

[FIXED] How to make product description tabs in Shopify with out APP?

 May 09, 2022     product, shopify, shopify-template, tabs     No comments   

Issue

Need help to make product description tabs in Shopify with out APP. Just to using heading tags i.e. H4 and h5.

I don't want to use html code in description area.


Solution

Thanks for all for your help. But i have created a proper solution i hope it will help.

  • In the {% section 'product-template' %} file find the following code:

    {{ product.description }}

Replace it with:

{%- assign product_description_content = product.description -%}

{%-if section.settings.enable_description_tabs -%}
  {%- assign product_description_content = product_description_content | split: '<h6>' | first -%}
{%- endif -%}

{% if product_description_content != '' %}
  <div id="product-description">
    {{ product.description }}
  </div>
{% endif %}

{%-if section.settings.enable_description_tabs and product_description_content == '' -%}
  <div id="product-description">
    {% include 'product-tabs' %}
  </div>
{% endif  %}
  • In schema append the following object in the settings array (to Enable/Disable the tabs):

{"type": "checkbox", "id": "enable_description_tabs", "label": "Enable Description Tabs", "default": true, "info": "Heading 6 titles will be converted to tab headings, tab content will be everything between the Heading 6 titles." }

  • Create a snippet named it 'product-tabs' and put the following code in it: product-tabs.liquid

Now in Shopify product description assign h6 for the heading and on the next line put the content.

Make description as heading

Add h6 tag for heading

I Hope this will also be helpful for other.



Answered By - Jahanzaib Muneer
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing