WebsiteBaker 2.13.8 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
(function($) { $.fn.calcPrice = function() { // Get basic price and keep it stored in global var if (typeof basic_price === 'undefined') { basic_price = container.text().replace(/\D/g, ''); basic_price = parseFloat(basic_price / 100); } var price = basic_price; // Loop through selected options $.each(this, function(key, value) { var sel_option = $(value); // Split the selected option into attribute / currency / sign / price arr = sel_option.text().match(/(.*)([A-Z]{3}) ([+,-]?)(.*)/); if (arr) { var sign = arr[3]; var opt_price = parseFloat(arr[4]); // Calculate new price if (sign == '+') { price = price + opt_price; } else if (sign == '-') { price = price - opt_price; } else { price = opt_price; } } }); // Money number format // Adapted from: http://stackoverflow.com/questions/149055/how-can-i-format-numbers-as-money-in-javascript var n = price, c = 2, d = decimal_sep, t = thousands_sep, sign = (n < 0) ? '-' : '', i = parseInt(n = Math.abs(n).toFixed(c)) + '', j = ((j = i.length) > 3) ? j % 3 : 0; new_price = sign + (j ? i.substr(0, j) + t : '') + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ''); // Refresh item price on page container.html(currency + ' ' + new_price); };})(jQuery);
'TXT_BUY' => $MOD_BAKERY['TXT_BUY'].' '.$setting_shop_currency.' '.$f_order_total