diff --git a/lib/core_charges_hooks.rb b/lib/core_charges_hooks.rb deleted file mode 100644 index 2d1a7d6..0000000 --- a/lib/core_charges_hooks.rb +++ /dev/null @@ -1,12 +0,0 @@ -class CoreChargesHooks < Spree::ThemeSupport::HookListener - - insert_after :admin_product_form_right do - '<%= f.label :core_amount, t("core_amount") %>
- <%= f.select :core_amount, [nil, 25.0, 50.0, 75.0, 100.0, 150.0, 200.0], :class => "text " %> - <%= f.error_message_on :core_amount %>' - end - -# insert_after :cart_items do -# '<%- if @order.core_charges.any? -%>

<%= t("core_charge_total") -%>: <%= number_to_currency(@order.core_charges.map(&:amount).sum) -%>

<%- end -%>' -# end -end diff --git a/lib/spree_core_charges.rb b/lib/spree_core_charges.rb index d041c53..e6a34ba 100644 --- a/lib/spree_core_charges.rb +++ b/lib/spree_core_charges.rb @@ -1,10 +1,11 @@ require 'spree_core' -require 'core_charges_hooks' +require 'core_charges_overrides' module SpreeCoreCharges class Engine < Rails::Engine def self.activate + Adjustment.class_eval do scope :core, lambda { where('label like ?',"#{I18n.t(:core_charge)}%") } end