Varianten Buttoms

Hallo,

ich habe das Dawn Theme und möchte auf den Produktkarten farbige Variantenbuttom und In den Warenkorb buttom haben. Geht das?

Hi @Vinestro.de

Yes In the Dawn theme you can absolutely add colored variant swatches and an “Add to Cart” button directly on your product cards (collection page). It just requires a bit of Liquid + CSS customization.

Color Variant Buttons (Swatches)

Inside your card-product.liquid (or snippets/card-product.liquid depending on your Dawn version), add a loop for the color variants. For example:

{% if product.options_by_name['Color'] %}
  <div class="color-swatches">
    {% for variant in product.variants %}
      {% if variant.available %}
        <span 
          class="color-swatch" 
          style="background-color: {{ variant.option1 | downcase }};" 
          title="{{ variant.option1 }}">
        </span>
      {% endif %}
    {% endfor %}
  </div>
{% endif %}

Basic styling for round color swatches:

.color-swatch {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #ccc;
  margin-right: 5px;
  cursor: pointer;
}

Add to Cart Button (Quick Add)

Dawn already supports a quick add feature, but you can insert a direct “Add to Cart” form under the product card:

<form method="post" action="/cart/add">
  <input type="hidden" name="id" value="{{ product.variants.first.id }}">
  <button type="submit" class="quick-add-btn">
    Add to Cart
  </button>
</form>

Button styling:

.quick-add-btn {
  background: #000;
  color: #fff;
  padding: 8px 16px;
  border-radius: 5px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.quick-add-btn:hover {
  background: #333;
}

Each product card will show colored variant swatches.
Below it, you’ll have a working “Add to Cart” button.

Note: If you’d like my help with your store customization, feel free to contact me at devcodersp@gmail.com

Please like and accept my solution.

You can do that by adding this code to the Custom CSS of your theme settings in Sales channels > Online Store > Themes > Customize > Theme settings.

.product .product-form__submit { background-color: #121212 !important; }

Best,

Dan from Ryviu: Reviews & QA

Hallo @Vinestro.de

Du kannst ganz einfach Farbvarianten mit der App Easify Product Options erstellen – kein Code erforderlich, super einfach zu benutzen und es beeinflusst dein Theme nicht :artist_palette:

Den „In den Warenkorb“-Button kannst du direkt im Theme-Editor anpassen.

Ich hoffe, diese Antwort hilft dir, das Problem zu lösen. Wenn du weitere Unterstützung brauchst, kannst du dich jederzeit an Easify wenden!