There is an Shopify API limit of 250 products so in order to get all product data I need to combine all pages into one PHP variable. So far I have the following but it doesn’t work. Should I be defining $test as an array?
PHP is not my strong point so I’ve probobaly got the syntax all wrong. I just need to be able to read the data provided by both URL’s defined as $productspageone
and $productspagetwo
$test = array();
$productspageone = json_decode(httpGet($apiUrl . "/admin/products.json?limit=250&page=1"));
$productspagetwo = json_decode(httpGet($apiUrl . "/admin/products.json?limit=250&page=2"));
$test = json_decode(productspageone);
$test = json_decode($test=json_decode(productspagetwo);
2
Answers
Try this
it will decode responsed to arrays, then u have to merge them, u will have everything in the variable now
Yuo can make an array of all that items