File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -72,19 +72,21 @@ const IndexProducts = ({ products }) => {
72
72
{ onSale && (
73
73
< div className = "flex justify-center" >
74
74
< div className = "pt-1 text-gray-900" >
75
- { variations && filteredVariantPrice ( price ) }
76
- { ! variations && paddedPrice ( salePrice ) }
75
+ { variations &&
76
+ filteredVariantPrice ( paddedPrice ( price , 'kr' ) ) }
77
+ { ! variations && paddedPrice ( salePrice , 'kr' ) }
77
78
</ div >
78
79
< div className = "pt-1 ml-2 text-gray-900 line-through" >
79
- { variations && filteredVariantPrice ( price , 'right' ) }
80
- { ! variations && paddedPrice ( regularPrice ) }
80
+ { variations &&
81
+ filteredVariantPrice ( paddedPrice ( price , 'kr' ) , 'right' ) }
82
+ { ! variations && paddedPrice ( regularPrice , 'kr' ) }
81
83
</ div >
82
84
</ div >
83
85
) }
84
86
{ /* Display regular price when not on sale */ }
85
87
{ ! onSale && (
86
88
< p className = "pt-1 text-center text-gray-900" >
87
- { paddedPrice ( price ) }
89
+ { paddedPrice ( price , 'kr' ) }
88
90
</ p >
89
91
) }
90
92
</ div >
Original file line number Diff line number Diff line change @@ -3,9 +3,11 @@ import { v4 as uuidv4 } from 'uuid';
3
3
/**
4
4
* Add empty character after currency symbol
5
5
* @param {String } price The price string that we input
6
+ * @param {String } symbol Currency symbol to add empty character/padding after
6
7
*/
7
8
8
- export const paddedPrice = ( price ) => price . split ( 'kr' ) . join ( 'kr ' ) ;
9
+ export const paddedPrice = ( price , symbol ) =>
10
+ price . split ( symbol ) . join ( `${ symbol } ` ) ;
9
11
10
12
/**
11
13
* Shorten inputted string (usually product description) to a maximum of length
You can’t perform that action at this time.
0 commit comments