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
What if it is individual product you want to set it up with
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024