File tree Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Expand file tree Collapse file tree 1 file changed +1
-5
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { v4 as uuidv4 } from 'uuid';
3
3
import WOO_CONFIG from 'utils/config/nextConfig' ;
4
4
5
5
/**
6
- * Shorten inputted string (usually product description) to a maximum of 20 characters
6
+ * Shorten inputted string (usually product description) to a maximum of length
7
7
* @param {String } string The string that we input
8
8
* @param {Integer } length The length that we want to shorten the text to
9
9
*/
@@ -46,18 +46,14 @@ export const getFloatVal = (string) => {
46
46
*/
47
47
export const getFormattedCart = ( data ) => {
48
48
let formattedCart = null ;
49
-
50
49
if ( ! data || ! data . cart . contents . nodes . length ) {
51
50
return formattedCart ;
52
51
}
53
-
54
52
const givenProducts = data . cart . contents . nodes ;
55
-
56
53
// Create an empty object.
57
54
formattedCart = { } ;
58
55
formattedCart . products = [ ] ;
59
56
let totalProductsCount = 0 ;
60
-
61
57
let i = 0 ;
62
58
givenProducts . forEach ( ( ) => {
63
59
const givenProduct = givenProducts [ parseInt ( i , 10 ) ] . product ;
You can’t perform that action at this time.
0 commit comments