Adding a Featured Benefits Section in Shopify can elevate your product page by highlighting the key features of your products with visually appealing layouts. Here's a step-by-step guide on how to create a professional-looking product benefits section using Shopify's custom sections and schema settings.
Step-by-Step Guide to Creating a Featured Benefits Section
Access Your Shopify Theme
- Log in to your Shopify Admin and navigate to Online Store > Themes.
- Click Actions > Edit Code on your active theme.
Create a New Section
- Under the Sections directory, click Add a new section and name it something relevant, like
featured-benefits. - This will create a
.liquidfile where you will define the structure, styles, and schema settings.
- Under the Sections directory, click Add a new section and name it something relevant, like
Define the Section Layout
- Copy the provided Liquid and CSS code below into your new section file. This will create a flexible and responsive 3-column layout: left, center, and right.
{% assign header_font = section.settings.heading_font %}
{% assign header_font_one = section.settings.text_font_heading %}
{% assign header_font_two = section.settings.text_font_description %}
<style>
{{ header_font | font_face }}
{{ header_font_one | font_face }}
{{ header_font_two | font_face }}
.fp-page-width--{{section.id}} {
max-width: 1620px !important;
padding: 0 50px;
margin: 0 auto;
}
.fp-image--{{section.id}}{
height: 437px;
width: 100%;
text-align: center;
}
.fp-image--{{section.id}} img, .fp-image--{{section.id}} svg{
max-width: 100%;
height: 100%;
object-fit: contain;
}
.fp-feature-icon--{{section.id}}{
width: {{ section.settings.icon_width }}px;
}
.fp-feature-icon--{{section.id}} img{
max-width: 100%;
object-fit: cover;
}
.main-heading--{{section.id}} h2, .custom-featured-collection h2, .page-collection .rich-text__heading {
font-weight: 700;
font-size: 36px;
line-height: 52px;
color: {{ section.settings.heading_color }};
letter-spacing: 0;
text-align: center;
margin: 0 0 15px;
font-family: {{ header_font.family}}, {{ header_font.fallback_families }} !important;
}
.fp-inner-content--{{section.id}} h3 {
font-weight: 700;
font-size: 20px;
line-height: 29px;
color: {{ section.settings.text_color }};
letter-spacing: 0;
margin: 0 0 8px;
font-family: {{ header_font_one.family}}, {{ header_font_one.fallback_families }} !important;
}
.fp-inner-content--{{section.id}} p {
font-weight: 400;
font-size: 16px;
line-height: 23px;
color: {{ section.settings.text_color }};
letter-spacing: 0;
margin: 0;
font-family: {{ header_font_two.family}}, {{ header_font_two.fallback_families }} !important;
}
.fp-left-col--{{section.id}} .fp-inner-content--{{section.id}} p, .fp-left-col--{{section.id}} .fp-inner-content--{{section.id}} h3 {
text-align: right;
}
.fp-grid-col--{{section.id}} {
display: flex;
align-items: center;
gap: {{ section.settings.gap_between_columns }}px;
padding: 30px 0 0;
}
.fp-image-content-wrapper--{{section.id}} {
display: flex;
align-items: center;
gap: 16px;
}
.fp-right-col--{{section.id}} .fp-image-content-wrapper--{{section.id}} {
flex-direction: row-reverse;
}
.fp-left-col--{{section.id}} {
width: 30%;
}
.fp-center-column--{{section.id}} {
width: 40%;
}
.fp-right-col--{{section.id}} {
width: 30%;
}
.fp-content--{{section.id}} {
display: flex;
flex-direction: column;
gap: 70px;
}
.fp-section--{{section.id}} {
padding: {{ section.settings.section_padding_top }}px 0 {{ section.settings.section_padding_bottom }}px;
background-repeat: no-repeat;
background-size: cover;
}
{% if section.settings.background_image %}
.fp-section--{{section.id}} {
background-image: url({{ section.settings.background_image | img_url:'master' }});
}
{% endif %}
.mob-fp-img--{{section.id}} {
display: none ;
}
/*** MEDIA ***/
@media only screen and (max-width: 1199px) {
.fp-content--{{section.id}} {
gap: 30px;
}
}
@media only screen and (max-width: 989px) {
.fp-content--{{section.id}} {
gap: {{ section.settings.reduce_gap }}px;
}
.fp-left-col--{{section.id}} .fp-content--{{section.id}} .fp-image-content-wrapper--{{section.id}}:last-child {
margin-bottom: {{ section.settings.reduce_gap }}px;
}
.fp-feature-icon--{{section.id}}{
width: {{ section.settings.icon_width_tab }}px;
}
.fp-center-column--{{section.id}} {
width: 100%;
}
.fp-image--{{section.id}} img {
max-width: 370px;
margin: 0 auto;
display: table;
}
.fp-left-col--{{section.id}} {
width: 100%;
}
.fp-right-col--{{section.id}} {
width: 100%;
}
.fp-right-col--{{section.id}} .fp-image-content-wrapper--{{section.id}} {
flex-direction: row-reverse;
justify-content: left;
}
.fp-image-content-wrapper--{{section.id}} {
flex-direction: row-reverse;
justify-content: left;
}
.fp-left-col--{{section.id}} .fp-inner-content--{{section.id}} p, .fp-left-col--{{section.id}} .fp-inner-content--{{section.id}} h3 {
text-align: left;
}
.fp-grid-col--{{section.id}} {
padding: 30px 0 60px;
}
.mob-fp-img--{{section.id}} {
display: block;
}
.web-fp-img--{{section.id}} {
display: none !important;
}
.fp-page-width--{{section.id}} {
padding: 0 30px;
}
/* Mobile-first: Reorder columns */
.fp-grid-col--{{section.id}} {
flex-direction: column;
gap: 0;
}
/* Center image comes first */
.fp-center-column--{{section.id}} {
order: 1;
width: 100%;
}
/* Left column comes second */
.fp-left-col--{{section.id}} {
order: 2;
width: 100%;
text-align: left;
}
/* Right column comes third */
.fp-right-col--{{section.id}} {
order: 3;
width: 100%;
}
}
@media (max-width:749px) {
.main-heading--{{section.id}} h2, .custom-featured-collection h2, .page-collection .rich-text__heading {
font-size: 28px;
line-height: 37px;
}
.fp-image--{{section.id}} img {
max-width: 280px;
}
.fp-section--{{section.id}} {
padding: 4rem 0 0rem;
background: #f6f5f8;
background-image: none !important;
}
}
@media only screen and (max-width: 480px) {
.fp-feature-icon--{{section.id}}{
width: {{ section.settings.icon_width_mob }}px;
}
}
</style>
<section class="fp-section--{{section.id}}">
<div class="fp-page-width--{{section.id}}">
<div class="fp-wrapper--{{section.id}}">
<div class="main-heading--{{section.id}}">
{% if section.settings.section_heading %}
<h2>{{ section.settings.section_heading }}</h2>
{% endif %}
</div>
<div class="fp-grid-col--{{section.id}}">
<!-- Left Column -->
<div class="fp-left-col--{{section.id}} ">
<div class="fp-content--{{section.id}}">
{% for block in section.blocks %}
{% if block.settings.feature_position == 'left' %}
<div class="fp-image-content-wrapper--{{section.id}}">
<div class="fp-inner-content--{{section.id}}">
<h3>{{ block.settings.feature_title }}</h3>
<p>{{ block.settings.feature_description }}</p>
</div>
{% if block.settings.feature_icon %}
<div class="fp-feature-icon--{{section.id}}">
<img
src="{{ block.settings.feature_icon | img_url:'master' }}"
alt="{{ block.settings.feature_title }}"
>
</div>
{% endif %}
</div>
{% endif %}
{% endfor %}
</div>
</div>
<!-- Center Image Column -->
<div class="fp-center-column--{{section.id}} ">
<div class="fp-image--{{section.id}}">
{% if section.settings.product_image_desktop %}
<img
src="{{ section.settings.product_image_desktop | img_url:'master' }}"
alt="feature-image"
class="web-fp-img--{{section.id}}"
>
{% else %}
{{ 'product-apparel-1' | placeholder_svg_tag: 'placeholder-svg' }}
{% endif %}
{% if section.settings.product_image_mobile %}
<img
src="{{ section.settings.product_image_mobile | img_url:'master' }}"
alt="feature-image-mobile"
class="mob-fp-img--{{section.id}}"
>
{% endif %}
</div>
</div>
<!-- Right Column -->
<div class="fp-right-col--{{section.id}} ">
<div class="fp-content--{{section.id}}">
{% for block in section.blocks %}
{% if block.settings.feature_position == 'right' %}
<div class="fp-image-content-wrapper--{{section.id}}">
<div class="fp-inner-content--{{section.id}}">
<h3>{{ block.settings.feature_title }}</h3>
<p>{{ block.settings.feature_description }}</p>
</div>
{% if block.settings.feature_icon %}
<div class="fp-feature-icon--{{section.id}}">
<img
src="{{ block.settings.feature_icon | img_url:'master' }}"
alt="{{ block.settings.feature_title }}"
>
</div>
{% endif %}
</div>
{% endif %}
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</section>
{% schema %}
{
"name": "Product Features Section",
"settings": [
{
"type": "text",
"id": "section_heading",
"label": "Section Heading",
"default": "Super Easy To Install"
},
{
"type": "image_picker",
"id": "background_image",
"label": "Background Image"
},
{
"type": "color",
"id": "background_color",
"label": "Background Color",
"default": "#ffffff"
},
{
"type": "range",
"id": "section_padding_top",
"label": "Section Padding Top",
"min": 0,
"max": 100,
"unit": "px",
"default": 50
},
{
"type": "range",
"id": "section_padding_bottom",
"label": "Section Padding Bottom",
"min": 0,
"max": 100,
"unit": "px",
"default": 10
},
{
"type": "range",
"id": "gap_between_columns",
"label": "Gap Between Columns",
"min": 0,
"max": 100,
"unit": "px",
"default": 38
},
{
"type": "color",
"id": "heading_color",
"label": "Heading Color",
"default": "#2a2a2a"
},
{
"type": "font_picker",
"id": "heading_font",
"label": "Heading Font",
"default": "sans-serif"
},
{
"type": "font_picker",
"id": "text_font_heading",
"label": "Block Text heading",
"default": "sans-serif"
},
{
"type": "font_picker",
"id": "text_font_description",
"label": "Block text description",
"default": "sans-serif"
},
{
"type": "color",
"id": "text_color",
"label": "Text Color",
"default": "#000000"
},
{
"type": "image_picker",
"id": "product_image_desktop",
"label": "Product Image (Desktop)"
},
{
"type": "image_picker",
"id": "product_image_mobile",
"label": "Product Image (Mobile)"
},
{
"type": "range",
"id": "icon_width",
"label": "Icon Width (Desktop)",
"min": 10,
"max": 101,
"unit": "px",
"default": 50
},
{
"type": "range",
"id": "icon_width_tab",
"label": "Icon Width (Tablet)",
"min": 10,
"max": 101,
"unit": "px",
"default": 50
},
{
"type": "range",
"id": "icon_width_mob",
"label": "Icon Width (Mobile)",
"min": 10,
"max": 101,
"unit": "px",
"default": 50
},
{
"type": "range",
"id": "reduce_gap",
"label": "Gap Reduction b/w text(Mobile)",
"min": 0,
"max": 100,
"step": 1,
"default": 35,
"unit": "px"
}
],
"blocks": [
{
"type": "product_feature",
"name": "Product Feature",
"settings": [
{
"type": "text",
"id": "feature_title",
"label": "Feature Title",
"default": "Case Friendly"
},
{
"type": "textarea",
"id": "feature_description",
"label": "Feature Description",
"default": "Compatible with most cases. Weat it with a Ringke case for a perfect fit."
},
{
"type": "image_picker",
"id": "feature_icon",
"label": "Feature Icon"
},
{
"type": "select",
"id": "feature_position",
"label": "Feature Position",
"default": "left",
"options": [
{
"value": "left",
"label": "Left"
},
{
"value": "right",
"label": "Right"
}
]
}
]
}
],
"presets": [
{
"name": "Product Features Section",
"category": "Custom Sections",
"blocks": [
{
"type": "product_feature"
},
{
"type": "product_feature"
},
{
"type": "product_feature"
},
{
"type": "product_feature",
"settings": {
"feature_position": "right"
}
},
{
"type": "product_feature",
"settings": {
"feature_position": "right"
}
},
{
"type": "product_feature",
"settings": {
"feature_position": "right"
}
}
]
}
]
}
{% endschema %}
Comments
Post a Comment