Skip to content

Commit

Permalink
Hint at where to patch Spree in controller_helpers/store.rb
Browse files Browse the repository at this point in the history
Just adding something to the Hash won't do the trick. You'll also
have to patch the price generation, copying prices to line items,
the price generation for shipments, and you'll have to subclass the
DefaultTax calculator.
  • Loading branch information
mamhoff committed Aug 6, 2015
1 parent 8652b88 commit e318166
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/lib/spree/core/controller_helpers/store.rb
Expand Up @@ -24,6 +24,16 @@ def current_store
# (to facilitate differing prices depending on VAT rate for digital products in Europe, see
# https://github.com/spree/spree/pull/6295 and https://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
#
def current_price_options
{
tax_zone: current_tax_zone
Expand Down

0 comments on commit e318166

Please sign in to comment.