PHP code which queries the Shopify API, and prints the product titles that are returned. Flow: Read the API URL -> Isolate the Product Titles through a loop -> Display the Product Titles

Guys Please help me out i can’t getting output!


My Site

$data = file_get_contents('');

$data = json_decode($data , true);


<div class="table-responsive">

    <table class="table table-hover">




            <th>Product Title</th>





            <?php $i=1; ?>

            <?php foreach ($data as $row) : ?>


                <td><?php $i; ?></td>

                <td><?php $row['products']['title']; ?></td>


            <?php $i++; ?>

            <?php endforeach; ?>




Add echo statements. Right now what you ahve is syntactically null code.

<td><?php $i; ?></td>

This does nothing.

<td><?php echo $i; ?></td>

This will putput the value of $i.

Cheers! :slight_smile:

The link you posted is requiring a Basic Authentication.
Without seeing the original JSON data, it is impossible to support you.

Could you please post here an extract of the json data?