Shopify themes, liquid, logos, and UX
i am using shopify impact theme . my store is femiroom.com . i want to add color swatches on my product page .please check my attachment and the store language is datch. i try to add this type of color swatches to my product page but i am not able to do it please help me how can i show this type of color swatches. also i need one more help that is When a customer clicks the Add to Cart button, taking them to the checkout page. it means add to cart button link to checkout page directly. so how can i do those 2 things if anyone have solution please help me give me solution as soon as possible
Hello there
you can use a Shopify app or custom code
theme.scss.liquid
file to open it.
.swatch {
margin-right: 10px;
display: inline-block;
}
.color-swatch {
display: inline-block;
height: 25px;
width: 25px;
border-radius: 50%;
margin-right: 5px;
margin-bottom: 5px;
}
.color-swatch--red {
background-color: red;
}
.color-swatch--blue {
background-color: blue;
}
.color-swatch--green {
background-color: green;
}
product-template.liquid
file to open it.product-form
element in the file, which will look something like this:
<form action="/cart/add" method="post" enctype="multipart/form-data" class="product-form product-form--stacked">
...
</form>
{% if product.options contains 'Color' %}
{% assign option_index = 0 %}
{% for option in product.options %}
{% assign option_index = option_index | plus: 1 %}
{% if option == 'Color' %}
<div class="swatch">
{% for value in product.variants[0].options[option_index] %}
<div class="color-swatch color-swatch--{{ value | handle }}">
</div>
{% endfor %}
</div>
{% endif %}
{% endfor %}
{% endif %}
theme.scss.liquid
and product-template.liquid
files, and then preview your product page to see the color swatches.
If this fixed your issue, likes and accepting as a solution are highly appreciated
| Build an online presence with our custom-built Shopify Theme: EcomifyTheme
| Check out our reviews: Trustpilot Reviews
| We are Shopify Partners: EcomGraduates Shopify Partner
What if it is individual product you want to set it up with
Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025