From 626c9dff4699f06eedc45bfdc83dba387c262d4c Mon Sep 17 00:00:00 2001 From: iesus Date: Tue, 22 Oct 2019 10:24:42 +0200 Subject: [PATCH] Display error messages for longer, and scroll into view --- .../community/Svea/Checkout/Model/Payment/CreateOrder.php | 1 + .../Svea/Checkout/controllers/UpdateCartController.php | 4 ++-- .../frontend/base/default/template/sveacheckout.phtml | 2 +- js/Svea/Checkout/sveacheckout.js | 7 +++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/code/community/Svea/Checkout/Model/Payment/CreateOrder.php b/app/code/community/Svea/Checkout/Model/Payment/CreateOrder.php index c484cdd..acc2de7 100755 --- a/app/code/community/Svea/Checkout/Model/Payment/CreateOrder.php +++ b/app/code/community/Svea/Checkout/Model/Payment/CreateOrder.php @@ -80,6 +80,7 @@ public function createOrder($quote, $orderData, $orderQueueItem) ->save(); Mage::logException($e); + $logger->writeToLog('Error while creating order' . $e->getMessage() . ' from quote ' . $quote->getId()); $error = $e->getMessage(); } diff --git a/app/code/community/Svea/Checkout/controllers/UpdateCartController.php b/app/code/community/Svea/Checkout/controllers/UpdateCartController.php index 292a07f..32ef270 100644 --- a/app/code/community/Svea/Checkout/controllers/UpdateCartController.php +++ b/app/code/community/Svea/Checkout/controllers/UpdateCartController.php @@ -280,13 +280,13 @@ protected function _updateQuoteCart() $this->_addResponseMessage( self::SVEA_CHECKOUT_RESPONSE_SUCCESS, "Cart updated", - "Successful cart update" + __("Successful cart update") ); $code = 200; } else { $this->_addResponseMessage( self::SVEA_CHECKOUT_RESPONSE_ERROR, - "Cart updated unsuccessful", + __("Cart updated unsuccessful"), $this->_getQuoteErrors() ); $this->_addAlertBlockToResponse(); diff --git a/app/design/frontend/base/default/template/sveacheckout.phtml b/app/design/frontend/base/default/template/sveacheckout.phtml index 95135b2..4ecabb5 100644 --- a/app/design/frontend/base/default/template/sveacheckout.phtml +++ b/app/design/frontend/base/default/template/sveacheckout.phtml @@ -39,7 +39,7 @@ $sveaOrderId = ($quote->getPaymentReference()) var sveacheckout = new SveaCheckout({ postUrl: ' true)) ?>', htmlAlert: null, - messageTimeout: 2000, + messageTimeout: 20000, sveaOrderId: '', inCheckout: 1, debug: 0 diff --git a/js/Svea/Checkout/sveacheckout.js b/js/Svea/Checkout/sveacheckout.js index b85d968..391fa99 100644 --- a/js/Svea/Checkout/sveacheckout.js +++ b/js/Svea/Checkout/sveacheckout.js @@ -29,7 +29,7 @@ SveaCheckout.prototype = { this.opt.postUrl = this.opt.postUrl || '/sveacheckout/cart/updateCheckout/'; this.opt.htmlAlert = this.opt.htmlAlert || 0; this.opt.sveaDebug = this.opt.sveaDebug || 0; - this.opt.messageTimeout = this.opt.messageTimeout || 5000; + this.opt.messageTimeout = this.opt.messageTimeout || 20000; this.opt.debug = this.opt.debug || 0; this.opt.inCheckout = this.opt.inCheckout || 0; @@ -230,8 +230,6 @@ SveaCheckout.prototype = { * Update Address */ updateAddress: function (event) { - console.log('waaaat'); - if (typeof event == 'undefined') { return; } @@ -481,6 +479,7 @@ SveaCheckout.prototype = { messageBox.removeClassName('hide'); messageBox.setAttribute('data-style', type); messageBox.show(); + messageBox.scrollIntoView(); if (this.opt.messageTimeout !== 0) { setTimeout(function () { messageBox.fade().addClassName('hide'); @@ -507,4 +506,4 @@ SveaCheckout.prototype = { tryLater: function () { this.initObservers(); }, -}; \ No newline at end of file +};