Skip to content

Commit 8eca108

Browse files
committed
Update functions.js
1 parent 72f2fe6 commit 8eca108

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

utils/functions/functions.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { v4 as uuidv4 } from 'uuid';
33
import 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
*/
4747
export 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;

0 commit comments

Comments
 (0)