Po naciśnięciu "Dodaj do koszyka" produkt wykonuje mi się
function addToCart(obj){
$('#cart-items').append('<p>Produkt x 1 <span class="pull-right"> 100,00 PLN <span class="glyphicon glyphicon-trash" onclick="deleteFromCart(this)" style="cursor: pointer"></span></span></p>');
updateProductCount();
//tutaj chciałbym aby dodał mi się ciastko z tymi danymi
}
I jak można odczytać później te dane przy wczytaniu innej strony np podsumowanie?
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Nazwa</th>
<th>Ilość</th>
<th>Cena za sztuke</th>
<th>Razem</th>
<th></th>
</tr>
</thead>
<tbody id="cart-elements">
<tr>
<td>Produkt A</td>
<td>
<input value="1" type="number" class="form-control" />
</td>
<td>100,00 PLN</td>
<td class="product-cost">100,00 PLN</td>
<td><span class="glyphicon glyphicon-trash" onclick="deleteItem(this)" style="cursor: pointer"></span></td>
</tr>
<tr>
<td>Produkt B</td>
<td>
<input value="2" type="number" class="form-control" />
</td>
<td>50,00 PLN</td>
<td class="product-cost">100,00 PLN</td>
<td><span class="glyphicon glyphicon-trash" onclick="deleteItem(this)" style="cursor: pointer"></span></td>
</tr>
</tbody>
</table>
</div>