mirror of
https://github.com/welton89/RRBEC.git
synced 2026-04-05 13:35:42 +00:00
nem sei o que fiz
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -9,26 +9,41 @@ from typePay.models import TypePay
|
|||||||
def listProductBalcao(request, comanda_id):
|
def listProductBalcao(request, comanda_id):
|
||||||
product = request.GET.get("search-product")
|
product = request.GET.get("search-product")
|
||||||
products = Product.objects.filter(name__icontains=product)
|
products = Product.objects.filter(name__icontains=product)
|
||||||
return render(request, "htmx_components/htmx_list_products_balcao.html", {"products": products,'comanda_id':comanda_id})
|
print(products)
|
||||||
|
return render(request, "htmx_components/htmx_list_products_balcao.html", {"products": products,})
|
||||||
|
|
||||||
def addProductBalcao(request, product_id, comanda_id):
|
def addProductBalcao(request, product_id, comanda_id, qtd):
|
||||||
product_comanda = ProductComanda(comanda_id=comanda_id, product_id=product_id)
|
for i in range(qtd):
|
||||||
product_comanda.save()
|
product_comanda = ProductComanda(comanda_id=comanda_id, product_id=product_id)
|
||||||
|
product_comanda.save()
|
||||||
consumo = ProductComanda.objects.filter(comanda=comanda_id)
|
consumo = ProductComanda.objects.filter(comanda=comanda_id)
|
||||||
total = 0
|
total = 0
|
||||||
for produto in consumo:
|
for produto in consumo:
|
||||||
total += produto.product.price
|
total += produto.product.price
|
||||||
return render(request, "htmx_components/htmx_list_products_in_comanda.html",{'consumo': consumo, 'total': total})
|
return render(request, "htmx_components/htmx_list_products_in_balcao.html",{'consumo': consumo, 'total': total})
|
||||||
|
|
||||||
|
|
||||||
|
def addProductBalcaoTeclado(request, product_id, comanda_id, qtd):
|
||||||
|
print('entrouuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu', product_id, comanda_id)
|
||||||
|
for i in range(qtd):
|
||||||
|
product_comanda = ProductComanda(comanda_id=comanda_id, product_id=product_id)
|
||||||
|
product_comanda.save()
|
||||||
|
consumo = ProductComanda.objects.filter(comanda=comanda_id)
|
||||||
|
total = 0
|
||||||
|
for produto in consumo:
|
||||||
|
total += produto.product.price
|
||||||
|
return render(request, "htmx_components/htmx_list_products_in_balcao.html",{'consumo': consumo, 'total': total})
|
||||||
|
|
||||||
|
|
||||||
def removeProductBalcao(request, productComanda_id):
|
def removeProductBalcao(request, productComanda_id):
|
||||||
|
print(request.COOKIES['qtd'])
|
||||||
product_comanda = ProductComanda.objects.get(id=productComanda_id)
|
product_comanda = ProductComanda.objects.get(id=productComanda_id)
|
||||||
consumo = ProductComanda.objects.filter(comanda=product_comanda.comanda)
|
consumo = ProductComanda.objects.filter(comanda=product_comanda.comanda)
|
||||||
product_comanda.delete()
|
product_comanda.delete()
|
||||||
total = 0
|
total = 0
|
||||||
for produto in consumo:
|
for produto in consumo:
|
||||||
total += produto.product.price
|
total += produto.product.price
|
||||||
return render(request, "htmx_components/htmx_list_products_in_comanda.html",{'consumo': consumo, 'total': total})
|
return render(request, "htmx_components/htmx_list_products_in_balcao.html",{'consumo': consumo, 'total': total})
|
||||||
|
|
||||||
|
|
||||||
def paymentBalcao(request, comanda_id):
|
def paymentBalcao(request, comanda_id):
|
||||||
|
|||||||
@@ -2,15 +2,12 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% block 'title' %}
|
{% block 'title' %}
|
||||||
{{comanda.name}}
|
{{comanda.name}}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{% block 'head' %}
|
{% block 'head' %}
|
||||||
<link rel="stylesheet" href="{% static 'comandas/css/viewbalcao.css' %}">
|
<link rel="stylesheet" href="{% static 'comandas/css/viewbalcao.css' %}">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -18,19 +15,11 @@
|
|||||||
|
|
||||||
{% block 'body' %}
|
{% block 'body' %}
|
||||||
|
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="grid-container" >
|
<div class="grid-container" >
|
||||||
<div style="text-align: center;">
|
<div style="text-align: center;">
|
||||||
<h1>Venda Balcão</h1>
|
<h1>Venda Balcão</h1>
|
||||||
<div>
|
<div>
|
||||||
<!-- <button class="primary" id="openModal" >Adicionar Produto</button> -->
|
|
||||||
|
|
||||||
<button id="pagarComanda" hx-get="{% url 'closeComanda' comanda.id %} " hx-trigger="click" hx-swap="none" onclick="imprimirConta()"
|
|
||||||
{% if comanda.status != 'OPEN' %}
|
|
||||||
style="display: none;"
|
|
||||||
{% endif %}
|
|
||||||
>Fechar Comanda</button>
|
|
||||||
|
|
||||||
<button id="pagarComanda" onclick="modal_payment_comanda()"
|
<button id="pagarComanda" onclick="modal_payment_comanda()"
|
||||||
{% if total == 0 %}
|
{% if total == 0 %}
|
||||||
@@ -44,21 +33,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
>Imprimir Fichas</button>
|
>Imprimir Fichas</button>
|
||||||
|
|
||||||
<!-- <button class="button" id="imprimirFichas" hx-get="{% url 'reopenComanda' comanda.id %} " hx-trigger="click" hx-swap="none" onclick="reloadPage()"
|
|
||||||
{% if comanda.status == 'OPEN'%}
|
|
||||||
style="display: none;"
|
|
||||||
{% elif comanda.status == 'CLOSED' %}
|
|
||||||
style="display: none;"
|
|
||||||
{% endif %}
|
|
||||||
>Reabrir</button> -->
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <p>Aberta em: {{comanda.dt_open|date:"D"}} {{comanda.dt_open|date:"d/m/Y - H:i"}}</p> -->
|
<table id="list-products-balcao">
|
||||||
|
|
||||||
|
|
||||||
<table id="list-products-comanda">
|
|
||||||
<tr>
|
<tr>
|
||||||
<th style="text-align: left;">Produto</th>
|
<th style="text-align: left;">Produto</th>
|
||||||
<th style="text-align: left;">Preço</th>
|
<th style="text-align: left;">Preço</th>
|
||||||
@@ -70,8 +47,8 @@
|
|||||||
<td>{{item.product.name}}</td>
|
<td>{{item.product.name}}</td>
|
||||||
<td>R$ {{item.product.price}}</td>
|
<td>R$ {{item.product.price}}</td>
|
||||||
<td><button
|
<td><button
|
||||||
hx-get="{% url 'removeProductBalcao' item.id %} " hx-trigger="click" hx-swap="none"
|
hx-get="{% url 'removeProductBalcao' item.id %} " hx-trigger="click" hx-target="#list-products-balcao"
|
||||||
onclick="reloadPage()">🗑️ Excluir</button></td>
|
>🗑️ Excluir</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
@@ -87,27 +64,58 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="add-produto">
|
<div id="add-produto">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <article> -->
|
<!-- <article> -->
|
||||||
|
|
||||||
<form id="productForm" >
|
<form id="productForm" >
|
||||||
<h2 style="text-align: center;">Buscar Produto </h2>
|
<h2 style="text-align: center;">Buscar Produto </h2>
|
||||||
<div class="grid-container">
|
<div class="grid-container">
|
||||||
<input type="text" id="search-product" name="search-product" autofocus placeholder="Buscar Produto" hx-get="{% url 'listProduct' comanda.id %}" hx-trigger="keyup" hx-target="#product-list">
|
<input
|
||||||
|
onchange="salvarValor()"
|
||||||
|
type="text"
|
||||||
|
id="search-product"
|
||||||
|
name="search-product"
|
||||||
|
autofocus
|
||||||
|
placeholder="Buscar Produto"
|
||||||
|
hx-get="{% url 'listProductBalcao' comanda.id %}"
|
||||||
|
hx-trigger="keyup"
|
||||||
|
hx-target="#product-list"
|
||||||
|
>
|
||||||
<input type="number" id="qtd-product" name="qtd-product" value="1" required min="1"><br>
|
<input type="number" id="qtd-product" name="qtd-product" value="1" required min="1"><br>
|
||||||
</div>
|
</div>
|
||||||
<div id="product-list" class="grid-list-products">
|
<div id="product-list" class="grid-list-products">
|
||||||
{% for product in products %}
|
{% for product in products %}
|
||||||
|
|
||||||
<article onclick="reloadPage()" style="background-color: #293552;" hx-get="{% url 'addProduct' product.id comanda.id %} " hx-trigger="click" hx-swap="none">
|
{% if forloop.counter0 == 0 %}
|
||||||
|
|
||||||
|
<article
|
||||||
|
name="productBox"
|
||||||
|
id="productId-{{ product.id }}"
|
||||||
|
|
||||||
|
style="background-color: #293552;"
|
||||||
|
hx-get="{% url 'addProductBalcaoTeclado' product.id comanda.id 1 %}" hx-trigger="click" hx-target="#list-products-balcao"
|
||||||
|
>
|
||||||
|
<p hidden id="{{forloop.counter0}}" >{{product.id}}</p>
|
||||||
|
<p hidden id="comanda{{forloop.counter0}}" >{{comanda.id}}</p>
|
||||||
|
{{product.name}} <br> <p id="{{product.id}}"></p>
|
||||||
|
R$ {{product.price}}
|
||||||
|
</article >
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
<article
|
||||||
|
name="productBox"
|
||||||
|
id="productId-{{ product.id }}"
|
||||||
|
style="background-color: #293552;"
|
||||||
|
hx-get="{% url 'addProductBalcaoTeclado' product.id comanda.id 1 %} " hx-trigger="click" hx-target="#list-products-balcao"
|
||||||
|
><data value="{{product.id}}"></data>
|
||||||
{{ forloop.counter0 }} {{product.name}} <br>
|
{{ forloop.counter0 }} {{product.name}} <br>
|
||||||
R$ {{product.price}}
|
R$ {{product.price}}
|
||||||
</article >
|
</article >
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -123,60 +131,10 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- <dialog id="Modal-add-product" style="display: none;" >
|
|
||||||
<article>
|
|
||||||
|
|
||||||
<form id="productForm" >
|
|
||||||
<h2>Adicionar Produto <button type="button" onclick="closeModal()" style="background-color:red;" >Fechar</button></h2>
|
|
||||||
<input type="text" id="search-product" name="search-product" placeholder="Buscar Produto" hx-get="{% url 'listProduct' comanda.id %}" hx-trigger="keyup" hx-target="#product-list"><br>
|
|
||||||
<div id="product-list" class="grid-list-products">
|
|
||||||
{% for product in products %}
|
|
||||||
|
|
||||||
<article onclick="reloadPage()" style="background-color: #293552;" hx-get="{% url 'addProduct' product.id comanda.id %} " hx-trigger="click" hx-target="#list-products-comanda">
|
|
||||||
{{product.name}} <br>
|
|
||||||
R$ {{product.price}}
|
|
||||||
</article >
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</form>
|
|
||||||
|
|
||||||
</article>
|
|
||||||
</dialog> -->
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<dialog id="remove-product-comanda" style="display: none;" >
|
|
||||||
<article>
|
|
||||||
<h2>Produto Excluido!</h2>
|
|
||||||
<h1>✅</h1>
|
|
||||||
<p>
|
|
||||||
|
|
||||||
</p>
|
|
||||||
<ul>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
<footer>
|
|
||||||
<button class="secondary" onclick="removeCloseModal()">
|
|
||||||
OK
|
|
||||||
</button>
|
|
||||||
<!-- <button >Excluir</button> -->
|
|
||||||
</footer>
|
|
||||||
</article>
|
|
||||||
</dialog>
|
|
||||||
|
|
||||||
<dialog id="payment-comanda" style="display: none;" >
|
<dialog id="payment-comanda" style="display: none;" >
|
||||||
<article>
|
<article>
|
||||||
<h2>Receber</h2>
|
<h2>Receber</h2>
|
||||||
@@ -196,10 +154,7 @@
|
|||||||
</dialog>
|
</dialog>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script src="{% static 'comandas/js/viewbalcao.js' %}"></script>
|
<script src="{% static 'comandas/js/viewbalcao.js' %}"></script>
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,8 +14,9 @@ urlpatterns = [
|
|||||||
|
|
||||||
htmx_urlpatterns = [
|
htmx_urlpatterns = [
|
||||||
# path('listProduct/', htmx_views.listProduct, name='listProduct'),
|
# path('listProduct/', htmx_views.listProduct, name='listProduct'),
|
||||||
path('listProduct/<int:comanda_id>/', htmx_views.listProductBalcao, name='listProductBalcao'),
|
path('listProductBalcao/<int:comanda_id>/', htmx_views.listProductBalcao, name='listProductBalcao'),
|
||||||
path('addProduct<int:product_id>/<int:comanda_id>/', htmx_views.addProductBalcao, name='addProductBalcao'),
|
path('addProductBalcao<int:product_id>/<int:comanda_id>/<int:qtd>/', htmx_views.addProductBalcao, name='addProductBalcao'),
|
||||||
|
path('addProductBalcaoTeclado<int:product_id>/<int:comanda_id>/<int:qtd>/', htmx_views.addProductBalcaoTeclado, name='addProductBalcaoTeclado'),
|
||||||
path('removeProductBalcao<int:productComanda_id>/', htmx_views.removeProductBalcao, name='removeProductBalcao'),
|
path('removeProductBalcao<int:productComanda_id>/', htmx_views.removeProductBalcao, name='removeProductBalcao'),
|
||||||
# path('closeComanda<int:comanda_id>/', htmx_views.closeComanda, name='closeComanda'),
|
# path('closeComanda<int:comanda_id>/', htmx_views.closeComanda, name='closeComanda'),
|
||||||
# path('reopenComanda<int:comanda_id>/', htmx_views.reopenComanda, name='reopenComanda'),
|
# path('reopenComanda<int:comanda_id>/', htmx_views.reopenComanda, name='reopenComanda'),
|
||||||
|
|||||||
Binary file not shown.
@@ -2,20 +2,39 @@
|
|||||||
|
|
||||||
{% for product in products %}
|
{% for product in products %}
|
||||||
|
|
||||||
<article
|
{% if forloop.counter0 == 0 %}
|
||||||
id="product-{{ forloop.counter0 }}"
|
|
||||||
onclick="reloadPage()"
|
<article
|
||||||
style="background-color: #293552;"
|
name="productBox"
|
||||||
hx-get="{% url 'addProduct' product.id comanda_id %} "
|
id="productId-{{ product.id }}"
|
||||||
hx-trigger="click"
|
style="background-color: #293552;"
|
||||||
hx-swap="none">
|
hx-get="{% url 'addProductBalcaoTeclado' product.id comanda.id 1 %} " hx-trigger="click" hx-target="#list-products-balcao"
|
||||||
|
>
|
||||||
|
<p hidden id="{{forloop.counter0}}" >{{product.id}}</p>
|
||||||
|
<p hidden id="comanda{{forloop.counter0}}" >{{comanda.id}}</p>
|
||||||
|
{{product.name}} <br> <p id="{{product.id}}"></p>
|
||||||
|
R$ {{product.price}}
|
||||||
|
</article >
|
||||||
|
|
||||||
|
{% else %}
|
||||||
|
|
||||||
|
<article
|
||||||
|
name="productBox"
|
||||||
|
id="productId-{{ product.id }}"
|
||||||
|
style="background-color: #293552;"
|
||||||
|
hx-get="{% url 'addProductBalcaoTeclado' product.id comanda.id 1 %} " hx-trigger="click" hx-target="#list-products-balcao"
|
||||||
|
><data value="{{product.id}}"></data>
|
||||||
|
{{ forloop.counter0 }} {{product.name}} <br>
|
||||||
|
R$ {{product.price}}
|
||||||
|
</article >
|
||||||
|
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{{ forloop.counter0 }} {{product.name}} <br>
|
|
||||||
R$ {{product.price}}
|
|
||||||
</article>
|
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
<!-- hx-swap="none"> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<tr>
|
||||||
|
<th style="text-align: left;">Produto</th>
|
||||||
|
<th style="text-align: left;">Preço</th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
{% for item in consumo%}
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>{{item.product.name}}</td>
|
||||||
|
<td>R$ {{item.product.price}}</td>
|
||||||
|
<td><button hx-get="{% url 'removeProductBalcao' item.id %} " hx-trigger="click" hx-target="#list-products-balcao" >🗑️ Excluir</button></td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
<tfoot>
|
||||||
|
<tr>
|
||||||
|
<td colspan="2" style="text-align: center;">Total R$ {{total}}</td>
|
||||||
|
</tr>
|
||||||
|
</tfoot>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
function openModal() {
|
// function openModal() {
|
||||||
document.getElementById('Modal-add-product').style.display = 'block';
|
// document.getElementById('Modal-add-product').style.display = 'block';
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
function open_remove_product_comanda() {
|
// function open_remove_product_comanda() {
|
||||||
document.getElementById('remove-product-comanda').style.display = 'block';
|
// document.getElementById('remove-product-comanda').style.display = 'block';
|
||||||
}
|
// }
|
||||||
|
|
||||||
function modal_payment_comanda() {
|
function modal_payment_comanda() {
|
||||||
document.getElementById('payment-comanda').style.display = 'block';
|
document.getElementById('payment-comanda').style.display = 'block';
|
||||||
@@ -15,14 +15,11 @@ function close_modal_payment_comanda() {
|
|||||||
document.getElementById('payment-comanda').style.display = 'none';
|
document.getElementById('payment-comanda').style.display = 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeModal() {
|
// function closeModal() {
|
||||||
document.getElementById('Modal-add-product').style.display = 'none';
|
// document.getElementById('Modal-add-product').style.display = 'none';
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
function removeCloseModal() {
|
|
||||||
document.getElementById('remove-product-comanda').style.display = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
function imprimirFichas() {
|
function imprimirFichas() {
|
||||||
const element = document.getElementById("list-products-comanda");
|
const element = document.getElementById("list-products-comanda");
|
||||||
@@ -105,39 +102,46 @@ function backPage() {
|
|||||||
document.onkeydown = teclado
|
document.onkeydown = teclado
|
||||||
|
|
||||||
function teclado(event){
|
function teclado(event){
|
||||||
if (event.keyCode == 50){
|
if (event.keyCode == 13){
|
||||||
document.getElementById('qtd-product').innerHTML = '2'
|
// const productId = document.getElementById('0').value;
|
||||||
|
// const comandaId = document.getElementById('comanda0').value;
|
||||||
|
addProductBalcao()
|
||||||
|
reloadPage()
|
||||||
}
|
}
|
||||||
// else if (event.keyCode == 73){
|
// else if (event.keyCode == 73){
|
||||||
// imprimirFichas()
|
// imprimirFichas()
|
||||||
// }
|
// }
|
||||||
// else if (event.keyCode == 51){
|
// else if (event.keyCode == 51){
|
||||||
// document.getElementById('qtd-product').innerHTML = '3'
|
// document.getElementById('qtd-product').innerHTML = '3'
|
||||||
// }
|
|
||||||
// else if (event.keyCode == 52){
|
|
||||||
// document.getElementById('qtd-product').innerHTML = '4'
|
|
||||||
// }
|
|
||||||
// else if (event.keyCode == 53){
|
|
||||||
// document.getElementById('qtd-product').innerHTML = '5'
|
|
||||||
// }
|
|
||||||
// else if (event.keyCode == 54){
|
|
||||||
// document.getElementById('qtd-product').innerHTML = '6'
|
|
||||||
// }
|
|
||||||
// else if (event.keyCode == 55){
|
|
||||||
// document.getElementById('qtd-product').innerHTML = '7'
|
|
||||||
// }
|
|
||||||
// else if (event.keyCode == 56){
|
|
||||||
// document.getElementById('qtd-product').innerHTML = '8'
|
|
||||||
// }
|
|
||||||
// else if (event.keyCode == 57){
|
|
||||||
// document.getElementById('qtd-product').innerHTML = '9'
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
document.getElementById('openModal').addEventListener('click', openModal);
|
|
||||||
|
|
||||||
|
function addProductBalcao() {
|
||||||
|
var productId = document.getElementById('0').innerText;
|
||||||
|
var comandaId = document.getElementById('comanda0').innerText;
|
||||||
|
var qtd = document.getElementById('qtd-product').value;
|
||||||
|
console.log(productId, comandaId)
|
||||||
|
const url = `/balcao/addProductBalcaoTeclado${productId}/${comandaId}/${qtd}/`;
|
||||||
|
const listProductsBalcao = document.getElementById('list-products-balcao');
|
||||||
|
fetch(url, {
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json'
|
||||||
|
},
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// document.getElementById('openModal').addEventListener('click', openModal);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
document.getElementById('productForm').addEventListener('submit', function(event) {
|
document.getElementById('productForm').addEventListener('submit', function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@@ -145,3 +149,15 @@ document.getElementById('productForm').addEventListener('submit', function(event
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function salvarValor() {
|
||||||
|
const elemento = document.getElementById('qtd-product');
|
||||||
|
const chave = 'qtd';
|
||||||
|
const valor = elemento.value;
|
||||||
|
localStorage.setItem(chave, valor);
|
||||||
|
setCookie(chave, valor);
|
||||||
|
console.log(chave, valor);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user