diff --git a/app/assets/javascripts/darkswarm/services/cart.js.coffee b/app/assets/javascripts/darkswarm/services/cart.js.coffee index d63351ba67..55f7f6da1a 100644 --- a/app/assets/javascripts/darkswarm/services/cart.js.coffee +++ b/app/assets/javascripts/darkswarm/services/cart.js.coffee @@ -1,4 +1,4 @@ -Darkswarm.factory 'Cart', (CurrentOrder, Variants, $timeout, $http, $modal, $rootScope, $resource, localStorageService) -> +Darkswarm.factory 'Cart', (CurrentOrder, Variants, $timeout, $http, $modal, $rootScope, $resource, localStorageService, RailsFlashLoader) -> # Handles syncing of current cart/order state to server new class Cart dirty: false @@ -50,6 +50,7 @@ Darkswarm.factory 'Cart', (CurrentOrder, Variants, $timeout, $http, $modal, $roo @popQueue() if @update_enqueued .error (response, status)=> + RailsFlashLoader.loadFlash({error: t('js.cart.add_to_cart_failed')}) @update_running = false compareAndNotifyStockLevels: (stockLevels) => diff --git a/config/locales/en.yml b/config/locales/en.yml index e84c10c022..ad8802ae2b 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2438,6 +2438,10 @@ See the %{link} to find out more about %{sitename}'s features and to start using resolve_errors: Please resolve the following errors more_items: "+ %{count} More" default_card_updated: Default Card Updated + cart: + add_to_cart_failed: > + There was a problem adding this product to the cart. + Perhaps it has become unavailable or the shop is closing. admin: enterprise_limit_reached: "You have reached the standard limit of enterprises per account. Write to %{contact_email} if you need to increase it." modals: