Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Fixed color swatches on storefront image check

Damian Legawiec83e6c808095e
diff --git a/storefront/app/views/themes/default/spree/products/_color_swatches.html.erb b/storefront/app/views/themes/default/spree/products/_color_swatches.html.erb
index 632acf6b27..ce6ad95b2c 100644
--- a/storefront/app/views/themes/default/spree/products/_color_swatches.html.erb
+++ b/storefront/app/views/themes/default/spree/products/_color_swatches.html.erb
@@ -31,7 +31,7 @@
color_preview_container_class: "lg:w-[28px] lg:h-[28px]",
color_preview_class: "lg:top-[2px] lg:left-[2px]" %>
<% end %>
- <% if selected_variant.has_images? %>
+ <% if selected_variant.has_images? || selected_variant.default_image.present? %>
<template data-featured-image-template>
<%= render 'spree/products/featured_image',
object: selected_variant %>