ecommerce/carts/templates/carts/form.html
2018-09-10 23:16:35 +03:00

8 lines
418 B
HTML

<form method="POST" action={% url "carts:update" %} class="form"> {% csrf_token %}
<input type="hidden" name="product_id" value="{{ object.id }}" />
{% if object in cart.products.all %}
<button class="btn btn-link" style="padding: 0px">Remove from cart?</button>
{% else %}
<button class="btn btn-success">ADD to cart</button>
{% endif %}
</form>