From 2ebc2db286b7601ca408a1e70d07f7b3a4b3c131 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 27 Oct 2021 15:58:51 -0300 Subject: [PATCH] =?UTF-8?q?de=20almacoop:=20recordar=20la=20p=C3=A1gina=20?= =?UTF-8?q?de=20confirmaci=C3=B3n=20al=20volverla=20a=20cargar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cart_confirmation_controller.js | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/_packs/controllers/cart_confirmation_controller.js b/_packs/controllers/cart_confirmation_controller.js index 1b138ca..08e5287 100644 --- a/_packs/controllers/cart_confirmation_controller.js +++ b/_packs/controllers/cart_confirmation_controller.js @@ -11,16 +11,18 @@ export default class extends CartBaseController { if (!this.template) return - const order = this.cart.data.attributes - const products = this.products - const site = await this.site() - const shipping_address = JSON.parse(this.storage.getItem('shipping_address')) + if (this.storage.cart) { - const data = { - order, - products, - site, - shipping_address + const order = this.cart.data.attributes + const products = this.products + const site = await this.site() + const shipping_address = JSON.parse(this.storage.getItem('shipping_address')) + + const data = { order, products, site, shipping_address } + + this.storage.setItem('confirmation', JSON.stringify(data)) + } else { + data = JSON.parse(this.storage.getItem('confirmation')) } this.render(data)