hedera-web/forms/ecomerce/basket/basket.js

39 lines
674 B
JavaScript
Raw Normal View History

2022-05-26 06:08:31 +00:00
Hedera.Basket = new Class({
2016-09-26 09:28:47 +00:00
Extends: Hedera.Form
2022-05-24 10:18:44 +00:00
,open: function() {
this.close();
2015-12-10 13:48:43 +00:00
this.isOpen = true;
2022-05-30 01:30:33 +00:00
Hedera.BasketChecker.check(this.conn, this.hash,
2022-05-24 10:18:44 +00:00
this.onBasketCheck.bind(this));
2015-07-10 12:30:08 +00:00
}
2015-02-01 03:21:54 +00:00
2022-05-24 10:18:44 +00:00
,onBasketCheck: function(isOk) {
2015-12-10 13:48:43 +00:00
if (isOk)
2022-05-24 10:18:44 +00:00
this.loadUi();
2015-02-01 03:21:54 +00:00
}
2016-07-22 20:00:27 +00:00
2022-05-24 10:18:44 +00:00
,activate: function() {
2022-05-28 01:18:06 +00:00
this.$.items.setInfo('bi', 'myBasketItem', 'hedera');
2016-07-22 20:00:27 +00:00
}
2015-02-01 03:21:54 +00:00
2022-05-24 10:18:44 +00:00
,onConfigureClick: function() {
Htk.Toast.showWarning(_('RememberReconfiguringImpact'));
2022-05-30 01:30:33 +00:00
this.hash.setAll({form: 'ecomerce/checkout'});
2015-02-01 03:21:54 +00:00
}
2022-05-26 06:08:31 +00:00
,onDeleteClick: function(form) {
2022-05-24 10:18:44 +00:00
if (confirm(_('ReallyDelete')))
form.deleteRow();
}
2022-05-24 10:18:44 +00:00
,subtotal: function(form) {
2022-05-28 15:49:46 +00:00
return form.$.amount * form.$.price;
}
});
2015-07-10 12:30:08 +00:00