OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Remove products from the shopping cart

  • Thread starter Thread starter mobin
  • Start date Start date
M

mobin

Guest
When removing the product from the shopping cart, the removing button does not work

my view:

Code:
class CartDeleteView(View):
  def get(self, request, id):
    cart = Cart(request)
    cart.delete(id)
    return redirect('cart:cart_detail')

  def delete(self, id):
    if id in self.cart:
        del self.cart[id]
        self.save()
<p>When removing the product from the shopping cart, the removing button does not work</p>
<p>my view:</p>
<pre><code>class CartDeleteView(View):
def get(self, request, id):
cart = Cart(request)
cart.delete(id)
return redirect('cart:cart_detail')

def delete(self, id):
if id in self.cart:
del self.cart[id]
self.save()
</code></pre>
 
Top