_getDataObj()->getSponsorCategoryById($categoryId)) { $data['quantity'] = 1; $data['productId'] = $categoryId; $data['cartItemType'] = 'Sponsor_Category_'; $cartObj = new App_ECommerce_Cart_Obj(); $cartObj->setPrimaryKey($cartObj->getCartId()); $cartObj->addItem($data); $cartObj->setSponsorFlag(); $cartPath = Qs_SiteMap::findFirst(null, array('type' => 'ECommerce_Cart_'), null, 'url'); Qs_Http::redirect($cartPath); } else { throw new Qs_Exception('Error while add item'); } return $this; } }