Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Yana #23

Closed
wants to merge 10 commits into from
Closed
10 changes: 10 additions & 0 deletions _build/resolvers/resolver_04_statuses.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
'body_manager' => '',
'final' => 0,
'fixed' => 0,
'rank' => 999,
'id' => 1,
],
2 => [
'name' => $modx->lexicon('ms3_order_status_new'),
Expand All @@ -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'),
Expand All @@ -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'),
Expand All @@ -72,6 +78,8 @@
'body_manager' => '',
'final' => 1,
'fixed' => 1,
'rank' => 3,
'id' => 4,
],
5 => [
'name' => $modx->lexicon('ms3_order_status_cancelled'),
Expand All @@ -84,6 +92,8 @@
'body_manager' => '',
'final' => 1,
'fixed' => 1,
'rank' => 4,
'id' => 5,
],
];

Expand Down
3 changes: 2 additions & 1 deletion assets/components/minishop3/action.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
$_REQUEST['ms3_action'] = $_REQUEST['action'];
}


/** @noinspection PhpIncludeInspection */
require dirname(__FILE__, 4) . '/index.php';
require dirname(__FILE__, 4) . '/index.php';
2 changes: 1 addition & 1 deletion core/components/minishop3/docs/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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


3 changes: 1 addition & 2 deletions core/components/minishop3/elements/templates/base.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
</button>
</h2>
<div id="headerMiniCart" class="accordion-collapse collapse" data-bs-parent="#headerAccordion">
{*todo заменить @FILE на чанк tpl.msMiniCart*}
{'!msCart'|snippet:[
'tpl' => '@FILE chunks/ms3_minicart.tpl',
'tpl' => 'tpl.msMiniCart',
'selector' => '#headerMiniCart'
]}
</div>
Expand Down
4 changes: 4 additions & 0 deletions core/components/minishop3/src/Controllers/Order/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ protected function getCart()

/**
* @param msOrder $draft
* @return []
* @return array
*/
public function loadCart($draft)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
10 changes: 1 addition & 9 deletions core/components/minishop3/src/Model/msDelivery.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down