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.

Bring back `Product#featured_image` for backward compatibility

Damian Legawieca8b9b7d7557b
diff --git a/core/app/models/spree/product.rb b/core/app/models/spree/product.rb
index 0c4e22ca5a..423d0d49e8 100644
--- a/core/app/models/spree/product.rb
+++ b/core/app/models/spree/product.rb
@@ -367,6 +367,14 @@ module Spree
variant_for_images&.primary_image
end
+ # Backward compatibility for Spree 5.2 and earlier.
+ # @deprecated Use Spree::Product#default_image instead.
+ def featured_image
+ Spree::Deprecation.warn('Spree::Product#featured_image is deprecated and will be removed in Spree 5.5. Please use Spree::Product#default_image instead.')
+
+ default_image
+ end
+
# Returns secondary Image for Product (for hover effects).
# @return [Spree::Image, nil]
def secondary_image