* @copyright 2021 DIGITAL RETAIL TECHNOLOGIES SL * @license https://opensource.org/licenses/MIT The MIT License * * Don't forget to prefix your containers with your own identifier * to avoid any conflicts with others containers. */ require_once dirname(__FILE__) . '/../../bootstrap.php'; class RetailcrmOrdersController extends RetailcrmAdminPostAbstractController { protected function postHandler() { $orderIds = Tools::getValue('orders'); RetailcrmExport::$api = RetailcrmTools::getApiClient(); return RetailcrmExport::uploadOrders($orderIds); } protected function getHandler() { $orders = Tools::getValue('orders', []); $page = (int) (Tools::getValue('page', 1)); switch (Tools::getValue('filter')) { case '1': $withErrors = false; break; case '2': $withErrors = true; break; default: $withErrors = null; } return array_merge([ 'success' => true, ], RetailcrmExportOrdersHelper::getOrders($orders, $withErrors, $page)); } }