public function actionClear()
    {
        $rr = new RequestResponse();

        if ($rr->isRequestAjaxPost()) {
            foreach (\Yii::$app->shop->cart->shopOrder->shopOrderItems as $basket) {
                $basket->delete();
            }

            \Yii::$app->shop->cart->shopOrder->link('cmsSite', \Yii::$app->cms->site);
            $rr->data = \Yii::$app->shop->cart->shopOrder->jsonSerialize();
            $rr->success = true;
            $rr->message = "";

            return (array)$rr;
        } else {
            return $this->goBack();
        }
    }
public function actionClear()
    {
        $rr = new RequestResponse();

        if ($rr->isRequestAjaxPost()) {
            foreach (\Yii::$app->shop->cart->shopOrder->shopOrderItems as $basket) {
                $basket->delete();
            }

            \Yii::$app->shop->cart->shopOrder->link('cmsSite', \Yii::$app->cms->site);
            $rr->data = \Yii::$app->shop->cart->shopOrder->jsonSerialize();
            $rr->success = true;
            $rr->message = "";

            return (array)$rr;
        } else {
            return $this->goBack();
        }
    }
public function actionClear ( ) { $ rr = new RequestResponse ( ) ; if ( $ rr -> isRequestAjaxPost ( ) ) { foreach ( \ Yii :: $ app -> shop -> cart -> shopOrder -> shopOrderItems as $ basket ) { $ basket -> delete ( ) ; } \ Yii :: $ app -> shop -> cart -> shopOrder -> link ( 'cmsSite' , \ Yii :: $ app -> cms -> site ) ; $ rr -> data = \ Yii :: $ app -> shop -> cart -> shopOrder -> jsonSerialize ( ) ; $ rr -> success = true ; $ rr -> message = "" ; return ( array ) $ rr ; } else { return $ this -> goBack ( ) ; } }
Cleaning the entire basket

@return array|\yii\web\Response
@throws \Exception
Cleaning the entire basket