Jump to content

[solved] unable to delete cart as a logged in user


Recommended Posts

I have added an option to delete complete cart at once, which is working fine when user is not logged in.

i'm using this function in cartcontroller.php

 

protected function processDeleteProductInCart()

{

$c = new Cart($this->context->cart->id);

$c->delete();

unset($c);

}

 

but , when any client is logged in this feature is not working

please help

Link to comment
Share on other sites

Ok I have found the reason,

the functions are called only when user is not logged in

 

public function postProcess()

{

// Update the cart ONLY if $this->cookies are available, in order to avoid ghost carts created by bots

if ($this->context->cookie->exists() && !$this->errors && !($this->context->customer->isLogged() && !$this->isTokenValid()))

 

 

can anybody tell me which controller/function is run when user is logged in

Link to comment
Share on other sites

Apologies for posting similar king of questions in different threads.

But the problem is not solved, Can you tell me which controller is used for generation of cart, or updating cart or deleting it in case a user is logged in

Link to comment
Share on other sites

×
×
  • Create New...