Skip to content

Commit

Permalink
Display error messages for longer, and scroll into view
Browse files Browse the repository at this point in the history
  • Loading branch information
iesus committed Oct 22, 2019
1 parent 2c9410e commit 626c9df
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ $sveaOrderId = ($quote->getPaymentReference())
var sveacheckout = new SveaCheckout({
postUrl: '<?= Mage::getUrl('sveacheckout/updateCart/updateCheckout', array('_secure' => true)) ?>',
htmlAlert: null,
messageTimeout: 2000,
messageTimeout: 20000,
sveaOrderId: '<?= $sveaOrderId ?>',
inCheckout: 1,
debug: 0
Expand Down
7 changes: 3 additions & 4 deletions js/Svea/Checkout/sveacheckout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -230,8 +230,6 @@ SveaCheckout.prototype = {
* Update Address
*/
updateAddress: function (event) {
console.log('waaaat');

if (typeof event == 'undefined') {
return;
}
Expand Down Expand Up @@ -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');
Expand All @@ -507,4 +506,4 @@ SveaCheckout.prototype = {
tryLater: function () {
this.initObservers();
},
};
};

0 comments on commit 626c9df

Please sign in to comment.