This is the code from the product section in question, where I want to add the “View more” button:
section-product-v2.liquid
{% if section.settings.title_heading != blank %}
### {{section.settings.title_heading}}
{% endif %}
{% if section.blocks.size > 0 %}
{%- assign i = 1 -%}
{% for block in section.blocks %}
- {{block.settings.tab_title}}
{%- assign i = i | plus : 1 -%}
{% endfor %}
{% endif %}
{% if section.blocks.size > 0 %}
{%- assign i = 1 -%}
{% for block in section.blocks %}
{% assign products_limit = block.settings.tab_limit %}
{% assign col = block.settings.tab_collection %}
{% for product in collections[col].products limit: products_limit %}
{% include 'product-item-v1' %}
{% else %}
{% for i in (1..8) %}
{% include 'empty-product-item' %}
{% endfor %}
{% endfor %}
{%- assign i = i | plus : 1 -%}
{% endfor %}
{% endif %}
{% schema %}
{
"name": "PRODUCT V2",
"settings": [
{
"type": "header",
"content": "Section Space"
},
{
"type": "text",
"id": "margin_top",
"label": "Margin Top",
"info": "Defined in pixels. Do not add the 'px' unit."
},
{
"type": "text",
"id": "margin_bottom",
"label": "Margin Bottom",
"info": "Defined in pixels. Do not add the 'px' unit."
},
{
"type": "text",
"id": "title_heading",
"label": "Title Section",
"default": "Our Best Seller"
},
{
"type": "color",
"id": "color_title",
"label": "Color",
"default": "#222"
}
],
"blocks": [
{
"type": "tab",
"name": "Tab",
"settings": [
{
"type": "text",
"id": "tab_title",
"label": "Title Tab",
"default": "NEW ARRIVALS"
},
{
"type": "collection",
"id": "tab_collection",
"label": "Chose Collection"
},
{
"type": "range",
"id": "tab_limit",
"min": 2,
"max": 50,
"step": 1,
"label": "Limit Products",
"default": 8
}
]
}
],
"presets": [
{
"name": "PRODUCT V2",
"category": "HOME",
"blocks": [
{
"type": "tab",
"settings": {
"tab_title": "NEW ARRIVALS"
}
},
{
"type": "tab",
"settings": {
"tab_title": "BEST SELLERS"
}
},
{
"type": "tab",
"settings": {
"tab_title": "TOP RATES"
}
}
]
}
]
}
{% endschema %}
The following CSS is for a “View products” button that is on another product section (V4), I can use the same style:
.section-product-v4 .view-products a {
font-weight: 500;
color: #fff;
background: #000;
display: inline-block;
margin-bottom: 25px;
line-height: 1;
font-size: 14px;
letter-spacing: 1px;
padding: 15px 40px;
transition: all 0.5s cubic-bezier(0.420, 0.000, 0.580, 1.000);
position: relative;
z-index: 0;
}
.section-product-v4 .view-products a:after {
content: "";
position: absolute;
top: 0;
left: 0;
width: 0;
height: 100%;
mix-blend-mode: lighten;
background: #000;
transition: all 0.5s cubic-bezier(0.420, 0.000, 0.580, 1.000);
}
@media (max-width: 576px) {
.section-product-v4 .view-products a {
padding: 15px 30px;
}
}
.section-product-v4 .view-products a:hover {
background: transparent;
}
.section-product-v4 .view-products a:hover:after {
width: 100%;
height: 100%;
z-index: 1;
}
@media (max-width: 575.98px) {
.section-product-v4 .col-6:nth-child(odd) {
padding-right: 7.5px;
}
.section-product-v4 .col-6:nth-child(even) {
padding-left: 7.5px;
}
}
@media (min-width: 576px) and (max-width:767.98px) {
.section-product-v4 .col-6:nth-child(odd) {
padding-right: 7.5px;
}
.section-product-v4 .col-6:nth-child(even) {
padding-left: 7.5px;
}
}
This V4 section with the button looks like this:
To sum up: on the homepage from my website, I have the V2 section (shown in my previous reply), which enables to display products in tabs.
However the developers of the theme didn’t make it possible to add a “View more” button like in the V4 section (screen just above).
I’d like to add this button to make it easier for my visitors to get to the collections. The url from the button must change dynamically when user change from one tab to another.
Thanks in advance to anyone that could help.