Adding same Item into Shopping Cart

Hello guys,

how to achieve the following:
add to cart green salad with italian dressing multiple times without creating new row and also adding mixed-salad with italian dressing

below is the code im having trouble with:

function addItemToCart(title, price, imageSrc, dressing) {
    var cartRow = document.createElement('div')
    var cartItems = document.getElementsByClassName('cart_list')[0]
    //stop duplicate items in the cart
    //get the Names of the same class being called
    var cartItemNames = cartItems.getElementsByClassName('dressing')
    //loop through the names
    for (var i = 0; i < cartItemNames.length; i++) {
        //check if the names in the cart equal to the title I am adding
        if (cartItemNames[i].innerText == dressing) {

i can’t add green salad and a mixed salad with the same dressing.
I would like to understand the process of ‘adding’ without having to create new rows for each item being added into the cart.