shopify:使用php提取.json文件

How to get the value of product's compare at price from orders.json file?

Can anyone help me?

Here is my code:

<?php
require_once 'lib/shopify.php';
//require_once 'csv.php';
$t="e94c1df5ef5c6b2b2e9d893a3be2eb35";
$sc = new ShopifyClient("cannon-25.myshopify.com", $t, API_KEY, SECRET);
if(isset($t)) {
    $orders = $sc->call('GET', 'admin/orders.json', array('published_status'=>'published'));
    foreach($orders as order) {
        echo $order['name'];
    }
}
?>

Thanks!.

The compare_at_price is part of a product, not an order, so it is available in products.json.

If you need access to the compare_at_price from orders.json, I would try first getting the product_id from orders.json and then retrieving the compare_at_price from products/#{id}.json.