ShoppingCart_Controller::setquantity PHP Method

setquantity() public method

Action: update the quantity of an item in the cart
public setquantity ( $request ) : AjaxHTTPResponse | boolean
$request
return AjaxHTTPResponse | boolean
    public function setquantity($request)
    {
        $product = $this->buyableFromRequest();
        $quantity = (int) $request->getVar('quantity');
        if ($product) {
            $this->cart->setQuantity($product, $quantity, $request->getVars());
        }
        $this->updateLocale($request);
        $this->extend('updateSetQuantityResponse', $request, $response, $product, $quantity);
        return $response ? $response : self::direct();
    }