/** * Get Order */ public function getOrders() { $order = new \erdiko\shopify\models\Order(); $data = $order->getOrders(); $this->setTitle('Shopify Orders'); $this->setContent($this->getLayout('json', $data)); }
/** * Get Order */ public function getOrders() { $order = new \erdiko\shopify\models\Order(); $message = ""; $isError = FALSE; try { $data = $order->getOrders(); } catch (ShopifyApiException $e) { $response_headers = $e->getResponseHeaders(); $message = "Error in getting order list :: " . $response_headers['http_status_code'] . ":" . $response_headers['http_status_message']; $isError = TRUE; } catch (ShopifyCurlException $e) { $message = "Error :: Shopify Curl Exception"; $isError = TRUE; } catch (\Exception $e) { $message = $e->getMessage(); $isError = TRUE; } if (!$isError) { $this->setTitle('Shopify Orders'); $this->setContent($this->getLayout('json', $data)); } else { $this->setContent($this->getLayout('message', $message, dirname(__DIR__))); } }