| @@ 374-396 (lines=23) @@ | ||
| 371 | * |
|
| 372 | * @return mixed |
|
| 373 | */ |
|
| 374 | public function changeProductInBasket($credentials, $shop_id, $product_id, $product_variation_id, $quantity, $text = '', $product_detail_id = 0) |
|
| 375 | { |
|
| 376 | $this->checkCredentials($credentials); |
|
| 377 | ||
| 378 | $this->_factoryWebshop($shop_id); |
|
| 379 | ||
| 380 | if (!is_numeric($product_id) and !is_numeric($quantity)) { |
|
| 381 | require_once 'XML/RPC2/Exception.php'; |
|
| 382 | throw new XML_RPC2_FaultException('product id and quantity must be integers', -5); |
|
| 383 | } |
|
| 384 | ||
| 385 | $product_id = $this->processRequestData(intval($product_id)); |
|
| 386 | $product_variation_id = $this->processRequestData(intval($product_variation_id)); |
|
| 387 | $quantity = $this->processRequestData(intval($quantity)); |
|
| 388 | $text = $this->processRequestData($text); |
|
| 389 | $product_detail_id = $this->processRequestData(intval($product_detail_id)); |
|
| 390 | ||
| 391 | if (!$this->webshop->getBasket()->change($product_id, $product_variation_id, $quantity, $text, $product_detail_id)) { |
|
| 392 | return false; |
|
| 393 | } |
|
| 394 | ||
| 395 | return true; |
|
| 396 | } |
|
| 397 | ||
| 398 | /** |
|
| 399 | * Gets an array with the current basket |
|
| @@ 623-645 (lines=23) @@ | ||
| 620 | * |
|
| 621 | * @return mixed |
|
| 622 | */ |
|
| 623 | public function changeProductInBasket($credentials, $shop_id, $product_id, $product_variation_id, $quantity, $text = '', $product_detail_id = 0) |
|
| 624 | { |
|
| 625 | $this->checkCredentials($credentials); |
|
| 626 | ||
| 627 | $this->_factoryWebshop($shop_id); |
|
| 628 | ||
| 629 | if (!is_numeric($product_id) and !is_numeric($quantity)) { |
|
| 630 | require_once 'XML/RPC2/Exception.php'; |
|
| 631 | throw new XML_RPC2_FaultException('product id and quantity must be integers', -5); |
|
| 632 | } |
|
| 633 | ||
| 634 | $product_id = $this->processRequestData(intval($product_id)); |
|
| 635 | $product_variation_id = $this->processRequestData(intval($product_variation_id)); |
|
| 636 | $quantity = $this->processRequestData(intval($quantity)); |
|
| 637 | $text = $this->processRequestData($text); |
|
| 638 | $product_detail_id = $this->processRequestData(intval($product_detail_id)); |
|
| 639 | ||
| 640 | if (!$this->webshop->getBasket()->change($product_id, $product_variation_id, $quantity, $text, $product_detail_id)) { |
|
| 641 | return false; |
|
| 642 | } |
|
| 643 | ||
| 644 | return true; |
|
| 645 | } |
|
| 646 | ||
| 647 | /** |
|
| 648 | * Gets an array with the current basket |
|