diff --git a/_build/resolvers/resolver_04_statuses.php b/_build/resolvers/resolver_04_statuses.php index d0515e1..a8115d4 100644 --- a/_build/resolvers/resolver_04_statuses.php +++ b/_build/resolvers/resolver_04_statuses.php @@ -36,6 +36,8 @@ 'body_manager' => '', 'final' => 0, 'fixed' => 0, + 'rank' => 999, + 'id' => 1, ], 2 => [ 'name' => $modx->lexicon('ms3_order_status_new'), @@ -48,6 +50,8 @@ 'body_manager' => 'tpl.msEmail.new.manager', 'final' => 0, 'fixed' => 1, + 'rank' => 1, + 'id' => 2, ], 3 => [ 'name' => $modx->lexicon('ms3_order_status_paid'), @@ -60,6 +64,8 @@ 'body_manager' => 'tpl.msEmail.paid.manager', 'final' => 0, 'fixed' => 1, + 'rank' => 2, + 'id' => 3, ], 4 => [ 'name' => $modx->lexicon('ms3_order_status_sent'), @@ -72,6 +78,8 @@ 'body_manager' => '', 'final' => 1, 'fixed' => 1, + 'rank' => 3, + 'id' => 4, ], 5 => [ 'name' => $modx->lexicon('ms3_order_status_cancelled'), @@ -84,6 +92,8 @@ 'body_manager' => '', 'final' => 1, 'fixed' => 1, + 'rank' => 4, + 'id' => 5, ], ]; diff --git a/assets/components/minishop3/action.php b/assets/components/minishop3/action.php index 93d63bf..1afc4f7 100644 --- a/assets/components/minishop3/action.php +++ b/assets/components/minishop3/action.php @@ -8,5 +8,6 @@ $_REQUEST['ms3_action'] = $_REQUEST['action']; } + /** @noinspection PhpIncludeInspection */ -require dirname(__FILE__, 4) . '/index.php'; +require dirname(__FILE__, 4) . '/index.php'; \ No newline at end of file diff --git a/core/components/minishop3/docs/readme.txt b/core/components/minishop3/docs/readme.txt index 82f9062..caa03e4 100644 --- a/core/components/minishop3/docs/readme.txt +++ b/core/components/minishop3/docs/readme.txt @@ -8,6 +8,6 @@ With questions and problems - contact the https://modx.pro AND https://t.me/ru -------------------- Feel free to suggest ideas/improvements/bugs on GitHub: -https://github.com/modx-pro/miniShop2 +https://github.com/modx-pro/MiniShop3/issues diff --git a/core/components/minishop3/elements/templates/base.tpl b/core/components/minishop3/elements/templates/base.tpl index 38b06ce..d6198c9 100644 --- a/core/components/minishop3/elements/templates/base.tpl +++ b/core/components/minishop3/elements/templates/base.tpl @@ -18,9 +18,8 @@
- {*todo заменить @FILE на чанк tpl.msMiniCart*} {'!msCart'|snippet:[ - 'tpl' => '@FILE chunks/ms3_minicart.tpl', + 'tpl' => 'tpl.msMiniCart', 'selector' => '#headerMiniCart' ]}
diff --git a/core/components/minishop3/src/Controllers/Order/Order.php b/core/components/minishop3/src/Controllers/Order/Order.php index 16a5f37..c4e63b5 100644 --- a/core/components/minishop3/src/Controllers/Order/Order.php +++ b/core/components/minishop3/src/Controllers/Order/Order.php @@ -192,6 +192,10 @@ public function getUserId(): int return $response['message']; } + if (!empty($response['data']['user']) && $response['data']['user'] instanceof modUser) { + $modUser = $response['data']['user']; + } + if (!$modUser) { $orderResponse = $this->ms3->order->get(); if (!$orderResponse['success']) { diff --git a/core/components/minishop3/src/Controllers/Storage/DB/DBCart.php b/core/components/minishop3/src/Controllers/Storage/DB/DBCart.php index 4af41b0..2d1a2b7 100644 --- a/core/components/minishop3/src/Controllers/Storage/DB/DBCart.php +++ b/core/components/minishop3/src/Controllers/Storage/DB/DBCart.php @@ -632,7 +632,7 @@ protected function getCart() /** * @param msOrder $draft - * @return [] + * @return array */ public function loadCart($draft) { diff --git a/core/components/minishop3/src/Controllers/Storage/DB/DBOrder.php b/core/components/minishop3/src/Controllers/Storage/DB/DBOrder.php index 1f3cc82..bb51fb3 100644 --- a/core/components/minishop3/src/Controllers/Storage/DB/DBOrder.php +++ b/core/components/minishop3/src/Controllers/Storage/DB/DBOrder.php @@ -175,7 +175,6 @@ public function getDeliveryCost() if ($cartCostResponse['success']) { $cartCost = $cartCostResponse['data']['cost']; } - //TODO пересмотреть модель доставки и ее методы $costWithDelivery = $msDelivery->getCost($this->ms3->order, $cartCost); $deliveryCost = $costWithDelivery - $cartCost; diff --git a/core/components/minishop3/src/Model/msDelivery.php b/core/components/minishop3/src/Model/msDelivery.php index 96fa55b..5c4996c 100644 --- a/core/components/minishop3/src/Model/msDelivery.php +++ b/core/components/minishop3/src/Model/msDelivery.php @@ -64,16 +64,8 @@ public function loadController() $class = $this->defaultControllerClass; } - if ($class !== $this->defaultControllerClass) { - // TODO: ждём новой реализации - //$this->ms3->loadCustomClasses('delivery'); - } - if (!class_exists($class)) { - $this->xpdo->log(modX::LOG_LEVEL_ERROR, 'Delivery controller class "' . $class . '" not found.'); - $class = $this->defaultControllerClass; - } $this->controller = new $class($this->ms3, []); - if (!($this->controller instanceof DeliveryInterface)) { + if (!$this->controller instanceof DeliveryInterface) { $this->xpdo->log(modX::LOG_LEVEL_ERROR, 'Could not initialize delivery controller class: "' . $class . '"'); return false; diff --git a/core/components/minishop3/src/Processors/Settings/GetClass.php b/core/components/minishop3/src/Processors/Settings/GetClass.php index 89200ad..fb6ab04 100644 --- a/core/components/minishop3/src/Processors/Settings/GetClass.php +++ b/core/components/minishop3/src/Processors/Settings/GetClass.php @@ -13,13 +13,13 @@ class GetClass extends Processor public function process() { $type = $this->getProperty('type'); - + /** @var MiniShop3 $ms3 */ $ms3 = $this->modx->services->get('ms3'); $registeredServices = $ms3->services->get($type); $result = []; - foreach($registeredServices as $class) { + foreach ($registeredServices as $class) { $result[] = [ 'name' => $class, 'class' => $class