How to create free text fields for custom themes in shopware?

Create Free Text Fields for Custom Themes

Please go through the below link for creating a shopware theme.

In this blog, We are going to create free text fields for a custom theme that extends the tpl files to be shown on the details page in shopware 5. To create these text fields follow the below steps.

The custom directory is a theme that I created already.

This image has an empty alt attribute; its file name is Screenshot_6-980x449.png

Step 1: Log in to the admin panel and go to the Configuration > Free text field management.

Step 2: Click on the Add item to create new text filed.

Note: Make sure you selected item (s_articles_attributes) table .

Step 3: Fill the required filed. And save it.

Note:

Database configuration:-

Column name: Name the column which is store in the shopware database.

Column type: You can select types of text.

View configuration:-

Label: Name the label shown on the detail pages.

Display in backend: Enable this to display in the backend.

Step 4: Now go to the Items > Overview.

Step 5: Edit the item by clicking on the pencil icon.

Step 6: After clicking on the edit, scroll to the last page. And add value in the Dimension field. Save the items.

Step 7: Go to the shopware theme directory of your website.

Step 8: Create a new file in the theme directory called “buy_container.tpl

File Structure:

themes>Frontend>Custom>frontend>detail>content>buy_container.tpl.

Step 9: In “buy_container.tpl” write this code.

{extends file="parent:frontend/detail/content/buy_container.tpl"}

{block name='frontend_detail_index_buy_container_base_info'}

{$smarty.block.parent}

  {* Product attribute 4 *}
    {if $sArticle.attr4}
      {s name="DetailAttributeField3Label" namespace="frontend/detail/index"}Dimension{/s}:
        {$sArticle.attr4}
    {/if}

{/block}



Save the files and Clear the cache.

Step 10: Open the product which you added in the dimension field.