Module: Spree::Core::ControllerHelpers::Store
- Extended by:
- ActiveSupport::Concern
- Included in:
- BaseController
- Defined in:
- lib/spree/core/controller_helpers/store.rb
Instance Method Summary collapse
- #current_currency ⇒ Object
-
#current_price_options ⇒ Object
Return a Hash of things that influence the prices displayed in your shop.
- #current_store ⇒ Object
Instance Method Details
#current_currency ⇒ Object
13 14 15 |
# File 'lib/spree/core/controller_helpers/store.rb', line 13 def current_currency Spree::Config[:currency] end |
#current_price_options ⇒ Object
Return a Hash of things that influence the prices displayed in your shop.
By default, the only thing that influences prices that is the current order’s tax_zone
(to facilitate differing prices depending on VAT rate for digital products in Europe, see github.com/spree/spree/pull/6295 and github.com/spree/spree/pull/6662).
If your prices depend on something else, overwrite this method and add more key/value pairs to the Hash it returns.
Be careful though to also patch the following parts of Spree accordingly:
-
‘Spree::VatPriceCalculation#gross_amount`
-
‘Spree::LineItem#update_price`
-
‘Spree::Stock::Estimator#taxation_options_for`
-
Subclass the ‘DefaultTax` calculator
37 38 39 40 41 |
# File 'lib/spree/core/controller_helpers/store.rb', line 37 def { tax_zone: current_tax_zone } end |