@@ 110-120 (lines=11) @@ | ||
107 | { |
|
108 | switch($action) |
|
109 | { |
|
110 | case 'remove': |
|
111 | $index = Arr::get($data, 'index'); |
|
112 | ||
113 | if( is_null($index) ) |
|
114 | $index = $this->basket->getIndex($data); |
|
115 | ||
116 | if( is_null($index) || !$this->basket->exists($index) ) |
|
117 | throw new CHttpException(500, 'Данный продукт уже удален. Обновите страницу.'); |
|
118 | ||
119 | $this->basket->remove($index); |
|
120 | break; |
|
121 | ||
122 | case 'changeAmount': |
|
123 | if( !$this->basket->exists($data['index']) ) |
@@ 83-93 (lines=11) @@ | ||
80 | { |
|
81 | switch($action) |
|
82 | { |
|
83 | case 'remove': |
|
84 | $index = Arr::get($data, 'index'); |
|
85 | ||
86 | if( is_null($index) ) |
|
87 | $index = $this->compare->getIndex($data); |
|
88 | ||
89 | if( is_null($index) || !$this->compare->exists($index) ) |
|
90 | throw new CHttpException(500, 'Данный продукт уже удален. Обновите страницу.'); |
|
91 | ||
92 | $this->compare->remove($index); |
|
93 | break; |
|
94 | } |
|
95 | } |
|
96 | } |