diff --git a/app/assets/javascripts/admin/orders/directives/customer_search_override.js.coffee b/app/assets/javascripts/admin/orders/directives/customer_search_override.js.coffee index 6f36322d91..08d4ceeb5d 100644 --- a/app/assets/javascripts/admin/orders/directives/customer_search_override.js.coffee +++ b/app/assets/javascripts/admin/orders/directives/customer_search_override.js.coffee @@ -1,5 +1,7 @@ angular.module("admin.orders").directive 'customerSearchOverride', -> restrict: 'C' + scope: + distributorId: '@' link: (scope, element, attr) -> formatCustomerResult = (customer) -> customerTemplate @@ -9,13 +11,14 @@ angular.module("admin.orders").directive 'customerSearchOverride', -> element.select2 placeholder: Spree.translations.choose_a_customer + minimumInputLength: 3 ajax: url: '/admin/search/customers.json' datatype: 'json' data: (term, page) -> { q: term - distributor_id: $('#distributor_id').val() # modified + distributor_id: scope.distributorId # modified } results: (data, page) -> { results: data } diff --git a/app/overrides/spree/admin/orders/customer_details/edit/replace_customer_search.html.haml.deface b/app/overrides/spree/admin/orders/customer_details/edit/replace_customer_search.html.haml.deface index db8cebfb0e..1fb13ef009 100644 --- a/app/overrides/spree/admin/orders/customer_details/edit/replace_customer_search.html.haml.deface +++ b/app/overrides/spree/admin/orders/customer_details/edit/replace_customer_search.html.haml.deface @@ -3,6 +3,4 @@ - content_for :app_wrapper_attrs do = 'ng-app=admin.orders' -= hidden_field_tag :customer_search_override, nil, :class => 'fullwidth title customer-search-override' - -= hidden_field_tag :distributor_id, @order.distributor_id += hidden_field_tag :customer_search_override, nil, distributor_id: @order.distributor_id, :class => 'fullwidth title customer-search-override'