0
votes

Where in the admin panel can I setup some kind of product returns text and then call it in the product.liquid template?

I've setup a new tab for the product description now I need to find a way to setup and pull the returns text information.

<div class="tabs">
   {% if product.description.size > 0 %}
      <div class="tab" id="product-description-tab">
         <div class="tab-title">Description</div>
         <div class="tab-content">
            {{ product.description }}
         </div>
      </div>
   {% endif %}
</div>
1
Is the return content the same for all products?Alice Girard
@AliceGirard yes, but should be able to be changed in the admin panelAndré Ferraz

1 Answers

0
votes

So to answer question, if content is always the same for all products:

First solution, you may use a page content :

  • Create a page with needed content
  • Add theme option allowing theme user to choose the page content to display
  • Retrieve settings to display page content wherever you need in your product template - To do it clean, add a condition to display nothing if settings value is empty.

Second solution:

  • Create theme setting with textarea type
  • Retrieve setting to display content wherever you want in your product template
  • Add a condition to display nothing if setting value is blank.

Documentation about settings_schema.json is available here: https://help.shopify.com/themes/development/theme-editor/settings-schema

HTH