Answer the question
In order to leave comments, you need to log in
How to make price rounding in minishop so that there are 4 digits after the decimal point?
I made sure that in the admin panel in minishop2 it was possible to drive in a price up to ten thousandths and save it, but in the basket it still does not appear that way. For example, instead of: 0.4398 rounds up to 0.44.
The only thing left is to change in assets/components/minishop2/js/web/default.js
Perhaps somewhere in this place, but this is not certain:
miniShop2.Utils = {
empty: function (val) {
return (typeof(val) == 'undefined' || val == 0 || val === null || val === false || (typeof(val) == 'string' && val.replace(/\s+/g, '') == '') || (typeof(val) == 'object' && val.length == 0));
},
formatPrice: function (price) {
var pf = miniShop2Config.price_format;
price = this.number_format(price, pf[0], pf[1], pf[2]);
if (miniShop2Config.price_format_no_zeros && pf[0] > 0) {
price = price.replace(/(0+)$/, '');
price = price.replace(/[^0-9]$/, '');
}
return price;
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question