|
@@ 89-100 (lines=12) @@
|
| 86 |
|
* @throws \InvalidArgumentException if $quantity is not an integer |
| 87 |
|
* @throws \OutOfRangeException if $quantity is not in the allowed range: 0 <= $quantity <= 999 |
| 88 |
|
*/ |
| 89 |
|
public function modifyQuantity($cartItemId, $quantity) |
| 90 |
|
{ |
| 91 |
|
$this->validateModificationCount(); |
| 92 |
|
$this->validateQuantity($quantity); |
| 93 |
|
|
| 94 |
|
$this->parameters['Item.' . $this->itemCounter . '.CartItemId'] = $cartItemId; |
| 95 |
|
$this->parameters['Item.' . $this->itemCounter . '.Quantity'] = $quantity; |
| 96 |
|
|
| 97 |
|
$this->itemCounter++; |
| 98 |
|
|
| 99 |
|
return $this; |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
/** |
| 103 |
|
* Changes an action of CartIteam to move between Cart and SaveForLater lists |
|
@@ 112-123 (lines=12) @@
|
| 109 |
|
* |
| 110 |
|
* @throws \OutOfRangeException if more then self::ITEM_LIMIT items are to be modified |
| 111 |
|
*/ |
| 112 |
|
public function modifyAction($cartItemId, $action) |
| 113 |
|
{ |
| 114 |
|
$this->validateModificationCount(); |
| 115 |
|
$this->validateAction($action); |
| 116 |
|
|
| 117 |
|
$this->parameters['Item.' . $this->itemCounter . '.CartItemId'] = $cartItemId; |
| 118 |
|
$this->parameters['Item.' . $this->itemCounter . '.Action'] = $action; |
| 119 |
|
|
| 120 |
|
$this->itemCounter++; |
| 121 |
|
|
| 122 |
|
return $this; |
| 123 |
|
} |
| 124 |
|
|
| 125 |
|
/** |
| 126 |
|
* Counts cart modification for this operation |