public function process(){ $path = $this->modx->getObject('modNamespace', 'basket')->getCorePath().'processors/'; foreach($products as $product_id => $quantity){ if(!$response = $modx->runProcessor('basket/web/orders/products/add', array( "product_id" => $product_id, "quantity" => $quantity ? $quantity : 1, ), array( 'processors_path' => $path, ))){ return $this->failure("Не удалось выполнить процессор"); } // else if($response->isError()){ return $response->getResponse(); } } return $this->success('Товары успешно добавлены'); }