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!

API URL : https://7a859ffcc3961df6e1c52d6dc93cf672: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@yourlibaasuae.myshopify.com/admin/api/2021-10/products.json

My Site
<?php

$data = file_get_contents('https://7a859ffcc3961df6e1c52d6dc93cf672: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@yourlibaasuae.myshopify.com/admin/api/2021-10/products.json');

$data = json_decode($data , true);

?>

<div class="table-responsive">

    <table class="table table-hover">

        <thead>

        <tr>

            <th>No.</th>

            <th>Product Title</th>

            <th></th>

        </tr>

        </thead>

        <tbody>

            <?php $i=1; ?>

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

            <tr>

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

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

            </tr>

            <?php $i++; ?>

            <?php endforeach; ?>

        </tbody>

</table>

</div>

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:
=C=

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?