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.

Add compare_at_price to api

Prakash Poudelb93fa70576e3
diff --git a/api/app/serializers/spree/v2/storefront/product_serializer.rb b/api/app/serializers/spree/v2/storefront/product_serializer.rb
index 265188083e..9fcb935938 100644
--- a/api/app/serializers/spree/v2/storefront/product_serializer.rb
+++ b/api/app/serializers/spree/v2/storefront/product_serializer.rb
@@ -5,8 +5,8 @@ module Spree
set_type :product
attributes :name, :description, :price, :currency, :display_price,
- :available_on, :slug, :meta_description, :meta_keywords,
- :updated_at
+ :compare_at_price, :display_compare_at_price, :available_on,
+ :slug, :meta_description, :meta_keywords, :updated_at
attribute :purchasable, &:purchasable?
attribute :in_stock, &:in_stock?
diff --git a/core/app/models/spree/product.rb b/core/app/models/spree/product.rb
index edffb3699b..ec970fb8e4 100644
--- a/core/app/models/spree/product.rb
+++ b/core/app/models/spree/product.rb
@@ -123,7 +123,7 @@ module Spree
end
delegate :display_amount, :display_price, :has_default_price?,
- :images, to: :find_or_build_master
+ :display_compare_at_price, :images, to: :find_or_build_master
alias master_images images