Refactoring digital shipping calculation and display
* removed the deface override that modified the checkout/_delivery partial * created custom digital delivery calculator * removed digital_shipping_method from Spree::Order. Moved logic to available_shipping_methods monkey patch The main goal was to eliminate the shipping method detection logic from the _delivery partial. This was a bit of a hack all along and didn't really present the correct information to the underlying order logic (i.e. rate_hash.blank? would return true when there was no shipping options available). This should be more future proof and make overriding another aspect of the delivery process easier.
This commit is contained in:
@@ -4,14 +4,13 @@ module SpreeDigital
|
||||
|
||||
config.autoload_paths += %W(#{config.root}/lib)
|
||||
|
||||
# Use RSpec for tests
|
||||
config.generators do |g|
|
||||
g.test_framework :rspec
|
||||
end
|
||||
|
||||
initializer "spree.spree_digital.preferences", :after => "spree.environment" do |app|
|
||||
Spree::DigitalConfiguration = Spree::SpreeDigitalConfiguration.new
|
||||
end
|
||||
|
||||
initializer "spree.register.digital_shipping", :after => 'spree.register.calculators' do |app|
|
||||
app.config.spree.calculators.shipping_methods << Spree::Calculator::DigitalDelivery
|
||||
end
|
||||
|
||||
def self.activate
|
||||
Dir.glob(File.join(File.dirname(__FILE__), "../../app/**/*_decorator*.rb")) do |c|
|
||||
|
||||
Reference in New Issue
Block a user