diff --git a/inc/functions.php b/inc/functions.php index 010d342..dcb8673 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -4,7 +4,7 @@ function shopify_call($token, $shop, $api_endpoint, $query = array(), $method = // Build URL $url = "https://" . $shop . ".myshopify.com" . $api_endpoint; - if (!is_null($query) && in_array($method, array('GET', 'DELETE'))) $url = $url . "?" . http_build_query($query); + if (!is_null($query) && in_array($method, array('GET', 'DELETE'))) $url = $url . "" . http_build_query($query); // Configure cURL $curl = curl_init($url); @@ -49,6 +49,13 @@ function shopify_call($token, $shop, $api_endpoint, $query = array(), $method = // Convert headers into an array $headers = array(); $header_data = explode("\n",$response[0]); + $a=0; // Defining Variable $a in the function + for($f=0;$f $headers, 'response' => $response[1]); + return array('headers' => $headers, 'response' => $response[1],$link_value); // returning link value for pagination } -} \ No newline at end of file +} diff --git a/orders.php b/orders.php new file mode 100644 index 0000000..729e344 --- /dev/null +++ b/orders.php @@ -0,0 +1,65 @@ + + + + Product Customizers + + + + + + + + + + + +
+
+~', $link, $prev); + } elseif(strpos($link, 'rel="next"')) { + preg_match('~<(.*?)>~', $link, $next); + } + } +} +echo $prev[1]; +echo '
'; +echo $next[1]; +// Now you can easily use the previous and next link for displaying orders with pagination, instead of limiting yourself with 250 + + + $orders_db =json_decode($orders_db['response'],JSON_PRETTY_PRINT); + + foreach ($orders_db as $order_db) { +// Your code here +} + + ?> + + + + +
+ + +