de almacoop: reiniciar el contador del carrito al confirmar

This commit is contained in:
f 2021-10-27 15:58:32 -03:00
parent 087f1436c5
commit fffc5e0267

View file

@ -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