public function validate() { if (parent::validate()) { $itemId = $this->getParam('item_id'); if (!isset($itemId) || $itemId == '') { $this->setError(KancartResult::ERROR_USER_INPUT_PARAMETER); return false; } } return true; }
public function validate() { if (!parent::validate()) { return false; } if ($this->customer->isLogged()) { return true; } $this->setError(KancartResult::ERROR_SYSTEM_INVALID_SESSION_KEY); return false; }
public function validate() { if (!parent::validate()) { return false; } $cartItemId = $this->getParam('cart_item_id'); if (!isset($cartItemId) || $cartItemId == '') { $this->setError(KancartResult::ERROR_CART_INPUT_PARAMETER, 'cart item id is not specified .'); return false; } return true; }
public function validate() { if (!parent::validate()) { return false; } $itemId = $this->getParam('item_id'); if (!isset($itemId)) { $errMesg = 'Item id is not specified .'; } $qty = $this->getParam('qty'); if (!is_numeric($qty) || intval($qty) <= 0) { $errMesg = 'Incorrect number of product.'; } if ($errMesg) { $this->setError(KancartResult::ERROR_CART_INPUT_PARAMETER, $errMesg); return false; } return true; }
public function validate() { if (!parent::validate()) { return false; } $cartItemId = $this->getParam('cart_item_id'); $qty = $this->getParam('qty'); $validateInfo = array(); if (!isset($cartItemId)) { $validateInfo[] = 'Cart item id is not specified .'; } if (!isset($qty) || !is_numeric($qty) || $qty <= 0) { $validateInfo[] = 'Qty is not valid.'; } if ($validateInfo) { $this->setError(KancartResult::ERROR_CART_INPUT_PARAMETER, $validateInfo); return false; } return true; }