Hello!
I am currently creating an app for shopify, and I am using https://github.com/cmcdonaldca/ohShopify.php as the php API which seems to be what everyone uses. However I ran into a few problems.
My code:
Code PHP:<?php include('shopify.php'); $api_key = 'xxxxxxxxxxxxxxxx; $secret = 'xxxxxxxxxxxxxxxxx'; $sc = new ShopifyClient($_GET['shop'], $_GET['t'], $api_key, $secret); try { // Get all products $products = $sc->call('GET', '/admin/products.json', array('published_status'=>'any')); } catch (ShopifyApiException $e) { /* $e->getMethod() -> http method (GET, POST, PUT, DELETE) $e->getPath() -> path of failing request $e->getResponseHeaders() -> actually response headers from failing request $e->getResponse() -> curl response object $e->getParams() -> optional data that may have been passed that caused the failure */ } catch (ShopifyCurlException $e) { // $e->getMessage() returns value of curl_errno() and $e->getCode() returns value of curl_ error() } echo var_dump($products); ?>
Now the problem is that the var_dump results come out NULL, however I do have products in my test store.
This page loads right after the authorization so the $_GET variables are there and filled.
If you can help, I would be forever grateful.



Reply With Quote
Bookmarks