getColumns: function () {
// Map of data key names to their display labels - this controls the order of the columns
// Note: the key names here should match the first row column titles in the spreadsheet
+ // This can be overridden by specifying the cart_columns in the "Paramètres panier" field (cartExtraSettings)
+ // The format for the setting is:
+ // cart_columns=XLS COL NAME|Display label,XLS COL 2|Display label 2
+ if (fluidbook.settings.cartColumns) {
+ return fluidbook.settings.cartColumns;
+ }
+
return {
'ARTICLE CODE': 'Réf',
'ARTICLE': 'Article',
switch(key) {
+ case 'PRIX':
+ output += $this.formatPrice(value);
+ break;
case 'QUANTITY':
let min_quantity = 1;
getMenuWidth: function () {
return window.location.hash === '#/cart/validate' ? 990 : 1190; // Validate modal is narrower than main cart
},
+
+ formatPrice: function (price) {
+
+ if (typeof price !== 'number') {
+ price = this.parseFloat(price);
+ }
+
+ return price.toLocaleString("fr-FR", {
+ style: "currency",
+ currency: "EUR",
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2
+ });
+ },
+
+ parseFloat: function (s) {
+ if (typeof s === 'number') {
+ return s;
+ }
+ if (s === undefined || s === null || s === '') {
+ return 0;
+ }
+ s = s.replace(/\s/g, '');
+ return parseFloat(s);
+ },
};