ShoppingCartController::actionUpdate PHP Method

actionUpdate() public method

public actionUpdate ( $product_id, $quantity )
    public function actionUpdate($product_id, $quantity)
    {
        $product = Product::model()->findByPk($product_id);
        if (!is_null($product)) {
            $shoppingCart = Yii::app()->customer->getShoppingCart();
            $shoppingCart->add($product->product_id, intval($quantity));
            $this->redirect(array('index'));
        }
    }