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.

Spree::ProductHelper#product_variants_matrix - pass an instance of current_store

Nathaniel Nande5e09bc2dde47
diff --git a/core/app/helpers/spree/products_helper.rb b/core/app/helpers/spree/products_helper.rb
index a831db2c84..208c7a4711 100644
--- a/core/app/helpers/spree/products_helper.rb
+++ b/core/app/helpers/spree/products_helper.rb
@@ -110,7 +110,8 @@ module Spree
variants: @variants,
is_product_available_in_currency: is_product_available_in_currency,
current_currency: current_currency,
- current_price_options: current_price_options
+ current_price_options: current_price_options,
+ current_store: current_store
).call.to_json
end
diff --git a/core/app/presenters/spree/variant_presenter.rb b/core/app/presenters/spree/variant_presenter.rb
index 70375e0960..8ee21cc0ad 100644
--- a/core/app/presenters/spree/variant_presenter.rb
+++ b/core/app/presenters/spree/variant_presenter.rb
@@ -3,13 +3,14 @@ module Spree
include Rails.application.routes.url_helpers
include Spree::BaseHelper
- attr_reader :current_currency, :current_price_options
+ attr_reader :current_currency, :current_price_options, :current_store
def initialize(opts = {})
@variants = opts[:variants]
@is_product_available_in_currency = opts[:is_product_available_in_currency]
@current_currency = opts[:current_currency]
@current_price_options = opts[:current_price_options]
+ @current_store = opts[:current_store]
end
def call