Giter Club home page Giter Club logo

shopify.php's People

Contributors

sandeepshetty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

shopify.php's Issues

Unprocessable Entity on adding Application Charges

Hi to all,

I recive an error on running this code present in the example:

Unprocessable Entity - 422

$charge = array
(
"recurring_application_charge"=>array
(
"price"=>10.0,
"name"=>"Super Duper Plan",
"return_url"=>"http://super-duper.shopifyapps.com",
"test"=>true
)
);

    try
    {
        // All requests accept an optional fourth parameter, that is populated with the response headers.
        $recurring_application_charge = $shopify('POST', '/admin/recurring_application_charges.json', $charge, $response_headers);

        // API call limit helpers
        echo shopify_calls_made($response_headers); // 2
        echo shopify_calls_left($response_headers); // 298
        echo shopify_call_limit($response_headers); // 300

    }
    catch (ShopifyApiException $e)
    {
        // If you're here, either HTTP status code was >= 400 or response contained the key 'errors'
    }

Some suggestion?

PUT Shopify Asset

I am having a hard time creating this shopify asset.

public function shopifyAPI_assets($shopify,$id,$attachment){
  try{
    $request = array(
      "assets" => array(
        "key" => "assets/appscript.js",
        "attachment" => "var js = 4;"
      )
    );
    $assets = $shopify("PUT","/admin/themes/{$id}/assets.json",$request);
  }catch (ShopifyApiException $e){
    $assets = false;
  }
  return $assets;
}

This is returning all of the assets for this theme.

Error on line 21 T_FUNCTION

So I just plopped in the code and included it and I'm getting an error right out the gate.

Parse error: syntax error, unexpected T_FUNCTION in *******/shopify.php on line 21

I believe it is refering to that return anonymous function which is something I've personally never seen before, any ideas on why I'm getting this error?

I am using a pretty up to date version of PHP on dreamhost.

Add price when adding product

Hello, I want to add price on new product through api. Below is the code which i am using to add new product. Can you please tell me where is the error.


$newproduct = array
(
"product"=>array
(
"title"=>"Product again",
"body_html"=>"testing product",
"vendor"=>"Vendor",
"product_type"=>"Test",
"variants": [ {"price": 12.00 } ]
)
);

    foreach($newproduct["product"] as $k => $v){
        $newproduct["product"][$k] = iconv("UTF-8", "ISO-8859-2", $v);
    }

    $senditem = $sc->call('POST', '/admin/products.json', $newproduct, $response_headers);

Thanks in advance.

Regards,

stripslashes() breaks javascript

This line breaks my request when I try to push a javascript file to the assets.

$payload = in_array($method, array('POST','PUT')) ? stripslashes(json_encode($params)) : array();

I took the stripslashes() function out and it worked perfectly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.