Sha256: 7cae7b55f7887afe7dd8fbee175b4e1f18f72debd1cd0cd4be494f165127cfc8
Contents?: true
Size: 867 Bytes
Versions: 5
Compression:
Stored size: 867 Bytes
Contents
Spree.Views.Tables.SelectableTable.SumReturnItemAmount = Backbone.View.extend({ initialize: function(options) { this.listenTo(this.model, 'change', this.render); this.render(); }, render: function() { var html = HandlebarsTemplates['tables/return_item_sum_amount']({ total_pre_tax_refund: Spree.t("total_pre_tax_refund"), total_selected_item_amount: this.totalSelectedReturnItemAmount() }); this.$el.html(html); }, totalSelectedReturnItemAmount: function () { var totalAmount = 0.00; var selectedItems = []; if(this.model.get('allSelected')) { selectedItems = $('.selectable'); } else { selectedItems = $(this.model.attributes.selectedItems); } selectedItems.each(function(_, selectedItem){ totalAmount += $(selectedItem).data('price'); }) return totalAmount; }, });
Version data entries
5 entries across 5 versions & 1 rubygems