In case you use it as an ES module make sure:
you have enabled Babel or Buble to transpile it to ES5 syntax,
you have enabled node modules resolving and babel transpiling for Swiper as it uses Dom7 and ssr-window packages as dependencies.
<?php
// Подключаем
define('MODX_API_MODE', true);
require $_SERVER['DOCUMENT_ROOT'].'/index.php';
// Включаем обработку ошибок
$modx->getService('error','error.modError');
$pdoTools = $modx->getService('pdoTools');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
$data = $_POST['data'];
$id = intval($data['id']);
$obj = $modx->getObject('msProduct', $id);
echo $pdoTools->getChunk('popupProduct', $obj->toArray());
"у вас почтовый сервер настроен?"А это можно сделать локально не на хосте? есть статья какая-нибудь?
2019/09/07 14:33:37 [info] 8436#0: *9 client closed connection while waiting for request, client: 127.0.0.1, server: 0.0.0.0:82
2019/09/07 14:33:38 [error] 8436#0: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Exception: Error: Variable 'sql_mode' can't be set to the value of 'MYSQL40'<br />Error No: 1231<br />SET @@session.sql_mode = 'MYSQL40' in /Users/artemerbulatov/Sites/test/system/library/db/mysqli.php:40
Stack trace:
#0 /Users/artemerbulatov/Sites/test/system/library/db.php(45): DB\MySQLi->query('SET @@session.s...')
#1 /Users/artemerbulatov/Sites/test/install/model/install/install.php(35): DB->query('SET @@session.s...')
#2 /Users/artemerbulatov/Sites/test/system/engine/loader.php(248): ModelInstallInstall->database(Array)
#3 /Users/artemerbulatov/Sites/test/system/engine/proxy.php(47): Loader->{closure}(Array, Array)
#4 /Users/artemerbulatov/Sites/test/install/controller/install/step_3.php(11): Proxy->__call('database', Array)
#5 /Users/artemerbulatov/Sites/test/system/engine/action.php(79): ControllerInstallStep3->index()
#6 /Users/artemerbulatov/Sites/test/system/engine/router.php(67): Action->execute(Object(Registry))
#7 /Users/artemerbulatov/Sites/test/system" while reading response header from upstream, client: 127.0.0.1, server: test.ru, request: "POST /install/index.php?route=install/step_3 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9004", host: "test.ru:82", referrer: "http://test.ru:82/install/index.php?route=install/step_3"
2019/09/07 14:33:37 [info] 8436#0: *9 client closed connection while waiting for request, client: 127.0.0.1, server: 0.0.0.0:82
2019/09/07 14:33:38 [error] 8436#0: *1 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Exception: Error: Variable 'sql_mode' can't be set to the value of 'MYSQL40'<br />Error No: 1231<br />SET @@session.sql_mode = 'MYSQL40' in /Users/artemerbulatov/Sites/test/system/library/db/mysqli.php:40
Stack trace:
#0 /Users/artemerbulatov/Sites/test/system/library/db.php(45): DB\MySQLi->query('SET @@session.s...')
#1 /Users/artemerbulatov/Sites/test/install/model/install/install.php(35): DB->query('SET @@session.s...')
#2 /Users/artemerbulatov/Sites/test/system/engine/loader.php(248): ModelInstallInstall->database(Array)
#3 /Users/artemerbulatov/Sites/test/system/engine/proxy.php(47): Loader->{closure}(Array, Array)
#4 /Users/artemerbulatov/Sites/test/install/controller/install/step_3.php(11): Proxy->__call('database', Array)
#5 /Users/artemerbulatov/Sites/test/system/engine/action.php(79): ControllerInstallStep3->index()
#6 /Users/artemerbulatov/Sites/test/system/engine/router.php(67): Action->execute(Object(Registry))
#7 /Users/artemerbulatov/Sites/test/system" while reading response header from upstream, client: 127.0.0.1, server: test.ru, request: "POST /install/index.php?route=install/step_3 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9004", host: "test.ru:82", referrer: "http://test.ru:82/install/index.php?route=install/step_3"