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';
33import WOO_CONFIG from 'utils/config/nextConfig' ;
44
55/**
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
77 * @param {String } string The string that we input
88 * @param {Integer } length The length that we want to shorten the text to
99 */
@@ -46,18 +46,14 @@ export const getFloatVal = (string) => {
4646 */
4747export const getFormattedCart = ( data ) => {
4848 let formattedCart = null ;
49-
5049 if ( ! data || ! data . cart . contents . nodes . length ) {
5150 return formattedCart ;
5251 }
53-
5452 const givenProducts = data . cart . contents . nodes ;
55-
5653 // Create an empty object.
5754 formattedCart = { } ;
5855 formattedCart . products = [ ] ;
5956 let totalProductsCount = 0 ;
60-
6157 let i = 0 ;
6258 givenProducts . forEach ( ( ) => {
6359 const givenProduct = givenProducts [ parseInt ( i , 10 ) ] . product ;
You can’t perform that action at this time.
0 commit comments