С версии 4.3.2 появилась новая сущность - Tygh\Application.
Объект класса Application создаётся при инициализации ядра в файле init.php, после чего он доступен отовсюду:
// получение объекта Application
Tygh::$app
curl -i https://api.selcdn.ru/v3/auth/tokens -XPOST -d '{"auth": { "identity": { "methods": ["password"], "password": { "user": { "id": "foo", "password": "bar"}}}}}' | |
HTTP/2 201 | |
access-control-allow-origin: * | |
content-length: 781 | |
content-type: application/json | |
x-subject-token: xxx | |
date: Thu, 20 Jun 2019 17:20:45 GMT | |
{"token":{"expires_at":"2019-06-21T11:35:20.207420239Z","issued_at":"2019-06-20T20:20:45.207420239Z","methods":["password"],"project":{"domain":{}},"catalog":[{"endpoints":[{"id":"asd","region_id":"ru-1","url":"https://api.selcdn.ru/v1/xxx","region":"ru-1","interface":"public"},{"id":"asd","region_id":"ru-1","url":"https://api.selcdn.ru/v1/xxx","region":"ru-1","interface":"admin"},{"id":"asd","region_id":"ru-1","url":"https://api.selcdn.ru/v1/xxx","region":"ru-1","interface":"internal"}],"type":"object-store","name":"swift","id":""}],"user":{"id":"asd","name":"xxx","domain":{"id":"default","name":"Default","links":{}}},"audit_ids":[""]}} |
<?php | |
$sum_test_cases = [ | |
['1', '2', '3'], | |
['1', '100', '101'], | |
['0', '0', '0'], | |
['1234567', '1', '1234568'], | |
['9999999', '1', '10000000'], | |
// Следующие значения значительно больше, чем Int64 |
server { | |
listen 80; | |
server_name cscart.dev; | |
server_name test.cscart.dev; | |
############################################################################ | |
# listen 443 ssl; | |
# ssl_certificate /etc/nginx/ssl/nginx.crt; | |
# ssl_certificate_key /etc/nginx/ssl/nginx.key; | |
############################################################################ | |
charset utf-8; |
diff --git a/app/addons/reward_points/func.php b/app/addons/reward_points/func.php | |
index f23a317..98a5e8d 100644 | |
--- a/app/addons/reward_points/func.php | |
+++ b/app/addons/reward_points/func.php | |
@@ -164,8 +164,10 @@ function fn_reward_points_calculate_cart_taxes_pre(&$cart, &$cart_products, &$sh | |
if (isset($cart_products[$k]['points_info']['raw_price'])) { | |
$product_price_in_points = $price_coef * $cart_products[$k]['points_info']['raw_price']; | |
$cart['products'][$k]['extra']['points_info']['raw_price'] = $product_price_in_points; | |
- $cart['products'][$k]['extra']['points_info']['display_price'] = $cart['products'][$k]['extra']['points_info']['price'] = round($product_price_in_points); | |
- $cart['points_info']['total_price'] = (isset($cart['points_info']['total_price']) ? $cart['points_info']['total_price'] : 0) + $product_price_in_points; |
diff --git a/app/controllers/backend/exim.php b/app/controllers/backend/exim.php | |
index 22409f8..92bbbae 100644 | |
--- a/app/controllers/backend/exim.php | |
+++ b/app/controllers/backend/exim.php | |
@@ -1793,6 +1793,9 @@ function fn_export_build_conditions($pattern, $options) | |
return $conditions; | |
} | |
+/** | |
+ * @deprecated, use fn_exim_quote instead |
diff --git a/app/controllers/backend/exim.php b/app/controllers/backend/exim.php | |
index 22409f8..92bbbae 100644 | |
--- a/app/controllers/backend/exim.php | |
+++ b/app/controllers/backend/exim.php | |
@@ -1793,6 +1793,9 @@ function fn_export_build_conditions($pattern, $options) | |
return $conditions; | |
} | |
+/** | |
+ * @deprecated, use fn_exim_quote instead |
diff --git a/app/Tygh/Backend/Storage/File.php b/app/Tygh/Backend/Storage/File.php | |
index 70d4a0d..be3910f 100644 | |
--- a/app/Tygh/Backend/Storage/File.php | |
+++ b/app/Tygh/Backend/Storage/File.php | |
@@ -124,7 +124,9 @@ class File extends ABackend | |
return $file; | |
} | |
- if ($this->getOption('cdn') && Cdn::instance()->getOption('is_enabled')) { | |
+ $is_cdn = ($this->getOption('cdn') && Cdn::instance()->getOption('is_enabled')); |
diff --git a/app/functions/fn.fs.php b/app/functions/fn.fs.php | |
index 87d88b7..f28a5fe 100644 | |
--- a/app/functions/fn.fs.php | |
+++ b/app/functions/fn.fs.php | |
@@ -308,7 +308,7 @@ function fn_get_file_type($filename, $not_available_result = 'application/octet- | |
$types = fn_get_ext_mime_types('ext'); | |
- $ext = fn_get_file_ext($filename); | |
+ $ext = fn_strtolower(fn_get_file_ext($filename)); |
diff --git a/app/controllers/frontend/orders.php b/app/controllers/frontend/orders.php | |
index ae83695..7d7f10a 100644 | |
--- a/app/controllers/frontend/orders.php | |
+++ b/app/controllers/frontend/orders.php | |
@@ -501,6 +501,41 @@ function fn_reorder($order_id, &$cart, &$auth) | |
if ($amount = fn_check_amount_in_stock($v['product_id'], $v['amount'], $v['product_options'], $k, $_is_edp, 0, $cart)) { | |
$cart['products'][$k]['amount'] = $amount; | |
+ // Check if the product price with options modifiers equals to zero | |
+ $price = fn_get_product_price($v['product_id'], $amount, $auth); |