init: function () {
var $this = this;
this.items = this.fluidbook.cache.get('cart', {});
+
$(document).on(this.fluidbook.input.clickEvent, '#open-request', function () {
let input = $(this).closest('#kimplaycart').find('[name=qty]');
$.each(input, function (i, item) {
$(document).on(this.fluidbook.input.clickEvent, '#kimplay-additem button', function () {
let form = $(this).closest('#kimplay-additem');
- $this.items['' + $(this).data('ref')] = {
+ $this.items[''+$(this).data('ref')] = {
name: $(form).find('h3').text(),
quantity: $(form).find('[name=qty]').val(),
comment: $(form).find('[name=comment]').val()
};
+
$this.fluidbook.tooltip.displayTooltipDuring($this.fluidbook.l10n.__("the item has been added to your cart"), 2500);
$this.fluidbook.menu.closeView();
$this.save();
},
emptyCart: function () {
- this.items = [];
+ this.items = {};
this.updateCart();
this.save();
resize();
}
let view = `<div id="kimplay-additem">
- ${this.fluidbook.menu.getCaption("", 'small')}
+ ${this.fluidbook.menu.getCaption("", 'small')}
<div class="content">
<div class="image"><img src="${this.data[ref].image}" /></div>
<div class="form">