Quantcast
Viewing all articles
Browse latest Browse all 11091

Extracting JSON file using PHP by selva

Hi everyone,

         This is my code:

<?php
require_once 'lib/shopify.php';
$t="4226b767fd10efdcbe234ab0c449eda6";
$sc = new ShopifyClient("https-selvar-myshopify-com.myshopify.com", $t, API_KEY, SECRET);
if(!isset($t))
{
if(!isset($_GET['signature']))
{
      $url = $sc->getAuthorizeUrl("read_orders");
    header('Location: '.$url);
}
if(isset($_GET['code']))
{
    $accTok = $sc->getAccessToken($_GET['code']);
    echo "token=".$accTok;exit;
    $orders = $sc->call('GET', 'admin/orders.json', array('published_status'=>'published'));
    print_r($orders);
}
}
if(isset($t))
{
    $orders = $sc->call('GET', 'admin/orders.json', array('published_status'=>'published'));
    print_r($orders);
    
}

    
?>

 

 

When run my private app it will display all the order details as .json format. but what i m need is get order id from json file using loop through php code. I dont know what is the best way.. If anyone can help me..

Thanks in advance!.


Viewing all articles
Browse latest Browse all 11091

Trending Articles