From fffc5e0267d301bc5af661c140cca49d95d251d0 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 27 Oct 2021 15:58:32 -0300 Subject: [PATCH] de almacoop: reiniciar el contador del carrito al confirmar --- _packs/controllers/cart_confirmation_controller.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/_packs/controllers/cart_confirmation_controller.js b/_packs/controllers/cart_confirmation_controller.js index 74e4d48..1b138ca 100644 --- a/_packs/controllers/cart_confirmation_controller.js +++ b/_packs/controllers/cart_confirmation_controller.js @@ -4,7 +4,10 @@ export default class extends CartBaseController { static targets = [ 'order' ] async connect () { - if (this.clear) this.storage.clear() + if (this.clear) { + this.storage.clear() + window.dispatchEvent(new CustomEvent('cart:counter', { detail: { item_count: 0 }})) + } if (!this.template) return