@@ -336,6 +336,9 @@ |
||
| 336 | 336 | return false; |
| 337 | 337 | } |
| 338 | 338 | |
| 339 | + /** |
|
| 340 | + * @return \Money\Sums |
|
| 341 | + */ |
|
| 339 | 342 | public function deliverySum() { |
| 340 | 343 | $sum = new \Money\Sums([]); |
| 341 | 344 | if ($this->delivery && $this->needDelivery()) { |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | public function hasDiscount() { |
| 369 | - return (bool)$this->card || $this->discounts; |
|
| 369 | + return (bool) $this->card || $this->discounts; |
|
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | public function discountSum() { |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | } |
| 398 | 398 | |
| 399 | 399 | public function addItem($offer_price_id, $count = 1, $final_price = 0) { |
| 400 | - $price = Item\Offer\Price::get((int)$offer_price_id); |
|
| 400 | + $price = Item\Offer\Price::get((int) $offer_price_id); |
|
| 401 | 401 | |
| 402 | 402 | if (!$price) { |
| 403 | 403 | return false; |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | public static $dataManagers = [ |
| 40 | 40 | 'manager' => [ |
| 41 | 41 | 'cols' => [ |
| 42 | - 'name','code', 'type', 'userfield', 'required', 'fieldItem', 'save' |
|
| 42 | + 'name', 'code', 'type', 'userfield', 'required', 'fieldItem', 'save' |
|
| 43 | 43 | ], |
| 44 | 44 | ] |
| 45 | 45 | ]; |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | public static $forms = [ |
| 84 | 84 | 'manager' => [ |
| 85 | 85 | 'map' => [ |
| 86 | - ['name','delivery_provider_id', 'disabled'], |
|
| 86 | + ['name', 'delivery_provider_id', 'disabled'], |
|
| 87 | 87 | ['price', 'currency_id'], |
| 88 | 88 | ['max_cart_price', 'icon_file_id'], |
| 89 | 89 | ['price_text'], |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * @param int $id города |
| 84 | 84 | */ |
| 85 | 85 | public function setSenderCityId($id) { |
| 86 | - $id = (int)$id; |
|
| 86 | + $id = (int) $id; |
|
| 87 | 87 | if ($id == 0) { |
| 88 | 88 | throw new \Exception("Неправильно задан город-отправитель."); |
| 89 | 89 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | * @param int $id города |
| 97 | 97 | */ |
| 98 | 98 | public function setReceiverCityId($id) { |
| 99 | - $id = (int)$id; |
|
| 99 | + $id = (int) $id; |
|
| 100 | 100 | if ($id == 0) { |
| 101 | 101 | throw new \Exception("Неправильно задан город-получатель."); |
| 102 | 102 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * @param int $id тарифа |
| 110 | 110 | */ |
| 111 | 111 | public function setTariffId($id) { |
| 112 | - $id = (int)$id; |
|
| 112 | + $id = (int) $id; |
|
| 113 | 113 | if ($id == 0) { |
| 114 | 114 | throw new \Exception("Неправильно задан тариф."); |
| 115 | 115 | } |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | * @param int $id режим доставки |
| 123 | 123 | */ |
| 124 | 124 | public function setModeDeliveryId($id) { |
| 125 | - $id = (int)$id; |
|
| 125 | + $id = (int) $id; |
|
| 126 | 126 | if (!in_array($id, array(1, 2, 3, 4))) { |
| 127 | 127 | throw new \Exception("Неправильно задан режим доставки."); |
| 128 | 128 | } |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | */ |
| 140 | 140 | public function addGoodsItemBySize($weight, $length, $width, $height) { |
| 141 | 141 | //проверка веса |
| 142 | - $weight = (float)$weight; |
|
| 142 | + $weight = (float) $weight; |
|
| 143 | 143 | if ($weight == 0.00) { |
| 144 | 144 | throw new \Exception("Неправильно задан вес места № " . (count($this->getGoodslist()) + 1) . "."); |
| 145 | 145 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | "ширина" => $width, |
| 149 | 149 | "высота" => $height); |
| 150 | 150 | foreach ($paramsItem as $k => $param) { |
| 151 | - $param = (int)$param; |
|
| 151 | + $param = (int) $param; |
|
| 152 | 152 | if ($param == 0) { |
| 153 | 153 | throw new \Exception("Неправильно задан параметр '" . $k . "' места № " . (count($this->getGoodslist()) + 1) . "."); |
| 154 | 154 | } |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $paramsItem = array("вес" => $weight, |
| 170 | 170 | "объёмный вес" => $volume); |
| 171 | 171 | foreach ($paramsItem as $k => $param) { |
| 172 | - $param = (float)$param; |
|
| 172 | + $param = (float) $param; |
|
| 173 | 173 | if ($param == 0.00) { |
| 174 | 174 | throw new \ption("Неправильно задан параметр '" . $k . "' места № " . (count($this->getGoodslist()) + 1) . "."); |
| 175 | 175 | } |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | * @param int $priority default false приоритет |
| 198 | 198 | */ |
| 199 | 199 | public function addTariffPriority($id, $priority = 0) { |
| 200 | - $id = (int)$id; |
|
| 200 | + $id = (int) $id; |
|
| 201 | 201 | if ($id == 0) { |
| 202 | 202 | throw new \Exception("Неправильно задан id тарифа."); |
| 203 | 203 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | */ |
| 186 | 186 | public function getGoodslist() { |
| 187 | 187 | if (!isset($this->goodsList)) { |
| 188 | - return NULL; |
|
| 188 | + return null; |
|
| 189 | 189 | } |
| 190 | 190 | return $this->goodsList; |
| 191 | 191 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | */ |
| 214 | 214 | private function _getTariffList() { |
| 215 | 215 | if (!isset($this->tariffList)) { |
| 216 | - return NULL; |
|
| 216 | + return null; |
|
| 217 | 217 | } |
| 218 | 218 | return $this->tariffList; |
| 219 | 219 | } |
@@ -31,14 +31,14 @@ discard block |
||
| 31 | 31 | $ids = []; |
| 32 | 32 | if (!empty($_POST['cartItems'])) { |
| 33 | 33 | foreach ($_POST['cartItems'] as $cartItemId => $cartItemCont) { |
| 34 | - $cartItem = \Ecommerce\Cart\Item::get((int)$cartItemId); |
|
| 34 | + $cartItem = \Ecommerce\Cart\Item::get((int) $cartItemId); |
|
| 35 | 35 | if (!$cartItem) { |
| 36 | 36 | continue; |
| 37 | 37 | } |
| 38 | 38 | if ($cartItem->cart_id != $cart->id) { |
| 39 | 39 | continue; |
| 40 | 40 | } |
| 41 | - $count = (float)$cartItemCont; |
|
| 41 | + $count = (float) $cartItemCont; |
|
| 42 | 42 | if ($count < 0.001) { |
| 43 | 43 | $count = 1; |
| 44 | 44 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | if (!empty($_POST['discounts']['card_item_id'])) { |
| 96 | - $userCard = \Ecommerce\Card\Item::get((int)$_POST['discounts']['card_item_id']); |
|
| 96 | + $userCard = \Ecommerce\Card\Item::get((int) $_POST['discounts']['card_item_id']); |
|
| 97 | 97 | if (!$userCard) { |
| 98 | 98 | $error = true; |
| 99 | 99 | Msg::add('Такой карты не существует', 'danger'); |
@@ -164,7 +164,7 @@ discard block |
||
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | public function orderDetailAction($id = 0) { |
| 167 | - $cart = Ecommerce\Cart::get((int)$id); |
|
| 167 | + $cart = Ecommerce\Cart::get((int) $id); |
|
| 168 | 168 | if ($cart->user_id != Users\User::$cur->id) { |
| 169 | 169 | $this->url->redirect('/', 'Это не ваша корзина'); |
| 170 | 170 | } |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | public function continueAction($id = 0) { |
| 189 | - $cart = \Ecommerce\Cart::get((int)$id); |
|
| 189 | + $cart = \Ecommerce\Cart::get((int) $id); |
|
| 190 | 190 | if ($cart->user_id != Users\User::$cur->id) { |
| 191 | 191 | Tools::redirect('/', 'Это не ваша корзина'); |
| 192 | 192 | } |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | public function deleteAction($id = 0) { |
| 201 | - $cart = \Ecommerce\Cart::get((int)$id); |
|
| 201 | + $cart = \Ecommerce\Cart::get((int) $id); |
|
| 202 | 202 | if ($cart->user_id != Users\User::$cur->id) { |
| 203 | 203 | Tools::redirect('/', 'Это не ваша корзина'); |
| 204 | 204 | } |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | } |
| 214 | 214 | |
| 215 | 215 | public function refillAction($id = 0) { |
| 216 | - $cart = \Ecommerce\Cart::get((int)$id); |
|
| 216 | + $cart = \Ecommerce\Cart::get((int) $id); |
|
| 217 | 217 | if ($cart->user_id != Users\User::$cur->id) { |
| 218 | 218 | Tools::redirect('/', 'Это не ваша корзина'); |
| 219 | 219 | } |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $result->content = 'Произошла непредвиденная ошибка при добавлении товара'; |
| 256 | 256 | $result->send(); |
| 257 | 257 | } |
| 258 | - $price = \Ecommerce\Item\Offer\Price::get((int)$_GET['itemOfferPriceId']); |
|
| 258 | + $price = \Ecommerce\Item\Offer\Price::get((int) $_GET['itemOfferPriceId']); |
|
| 259 | 259 | if (!$price) { |
| 260 | 260 | $result->success = false; |
| 261 | 261 | $result->content = 'Такой цены не найдено'; |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | if (empty($_GET['count'])) { |
| 276 | 276 | $count = 1; |
| 277 | 277 | } else { |
| 278 | - $count = (float)$_GET['count']; |
|
| 278 | + $count = (float) $_GET['count']; |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | $cart = $this->ecommerce->getCurCart(); |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | $handle = fopen(__DIR__ . '/../vendor/CdekCity_RUS_20170729.csv', 'r'); |
| 24 | 24 | $row = 1; |
| 25 | 25 | $cols = []; |
| 26 | - while (($data = fgetcsv($handle, 10000, ";")) !== FALSE) { |
|
| 26 | + while (($data = fgetcsv($handle, 10000, ";")) !== false) { |
|
| 27 | 27 | if ($row === 1) { |
| 28 | 28 | $cols = $data; |
| 29 | 29 | } else { |