I make my E-Commerce Website using Django. When I use Add to Cart functionality on the website refresh the page & I go to the top of the page. But I want the user to stay on the same Product after Add to Cart.
Add To Cart function is made using Session in Django, not JS.
So I want when users use Add To Cart Function user stay on the same product.
I think this thing is possible using JS.
This is Add to Cart button
<form action="{% url 'cart:AddCart' %}" method="POST">{% csrf_token %}
<input hidden type="text" name="product" value="{{i.id}}">
<button id="clickMe" class="main-btn cart cart-btn" style="padding: 5px 32px">Add <i class="fa-solid fa-cart-shopping"></i></button>
</form>