Created
March 16, 2016 06:23
Revisions
-
Prashant Kumar Mishra created this gist
Mar 16, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ var mashkar = { init: function() { this.calculateTotalPrice(); }, calculateTotalPrice: function() { $(document).on("change", '.price-field', function() { var variantRow = $(this).closest(".variant-row"); var sellerPrice = parseFloat($(this).val()); var basePrice = parseFloat(variantRow.find(".base-price").data("base_price")); variantRow.find(".final-price").text((sellerPrice + basePrice).toFixed(2)) }); } }; $(document).ready(function() { mashkar.init(); });